How to “unregister” a service from a listener

If a service is registered with your listener outside of the clusterware, you can unregister it with the following call:

dbms_service.stop_service(service_name,instance_name)

I verified that this will not disconnect existing sessions in the instance on which the service is being stopped.

I did this by performing the following steps:

create 100 sessions to service and verify some are on the instance on which you want to stop the service

exec dbms_service.stop_service(service_name,instance_name)
select count(*),inst_id from gv$session where service_name = '&service_name' group by inst_id;

You will see the sessions are still on the instance on which you stopped the service.  However, if you issue the following:

lsnrctl service listener_name

…you will see the service no longer shows up in the list.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.