Existing sessions are allowed to continue
Note that stopping will only affect new connections. Existing sessions that used the DEMO_BATCH service are allowed to continue until they disconnect or you kill them. This gives you the flexibility of a grace period where you just wait for existing sessions to finish their work and disconnect by themselves. [code]SELECT NAME FROM V$ACTIVE_SERVICES WHERE NAME = 'DEMO_BATCH'; no rows selected SELECT SERVICE_NAME, USERNAME FROM V$SESSION WHERE SERVICE_NAME='DEMO_BATCH'; SERVICE_NAME USERNAME -------------------- ------------------------------ DEMO_BATCH BROST[/code]Grid Infrastructure has option to force disconnects
If you are using grid infrastructure and manage services through srvctl this behaviour is basically the same but you get an extra "force" switch to also disconnect existing sessions while stopping a service. [code][oracle@ractrial1 ~]$ srvctl stop service -db orcl42 -service racdemo_batch [-force] [oracle@ractrial1 ~]$ srvctl stop service -h Stops the service. Usage: srvctl stop service -db <db_unique_name> [-service "<service_name_list>"] [-serverpool <pool_name>] [-node <node_name> | -instance <inst_name>] [-pq] [-global_override] [-force [-noreplay]] [-eval] [-verbose] -db <db_unique_name> Unique name for the database -service "<serv,...>" Comma separated service names -serverpool <pool_name> Server pool name -node <node_name> Node name -instance <inst_name> Instance name -pq To perform the action on parallel query service -global_override Override value to operate on a global service.Ignored for a non-global service -force Disconnect all sessions during stop or relocate service operations -noreplay Disable session replay during disconnection -eval Evaluates the effects of event without making any changes to the system -verbose Verbose output -help Print usage[/code]Conclusion
Creating extra services on a database allows you to stop and start them for maintenance which can be used as a convenient way to lock out only certain parts of an application while leaving user accounts unlocked to connect via different services.On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Oracle service secrets: group and filter
Oracle service secrets: group and filter
Aug 25, 2016 12:00:00 AM
3
min read
Issues with Oracle secure external password stores
Issues with Oracle secure external password stores
Jan 15, 2016 12:00:00 AM
9
min read
TNS-12564 Errors and the Importance of the Parameter LOCAL_LISTENER During a Data Guard Switchover
TNS-12564 Errors and the Importance of the Parameter LOCAL_LISTENER During a Data Guard Switchover
Nov 9, 2020 12:00:00 AM
13
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.