Oracle-Ninja.com
Andy Colvin's Orac le Blog
1 Comment
I noticed something for the rst time tonight when I was playing around in the Enkitec lab something that I have been doing wrong for a while.
When working in the lab, I often rely on the crsctl command to shut down the entire cluster stack for me. Its really easy to use crsctl stop
cluster -all followed by dcli -l root -g ~/dbs_group /u01/app/11.2.0.4/grid/bin/crsctl stop crs to get everything down quickly. As it turns out,
thats not really the best course of action.
Lets start by looking at our dbm01 database to see how it is con gured.
?
[enkdb01:oracle:dbm011] /home/oracle
> srvctl config database -d dbm01
Database unique name: dbm01
Database name: dbm01
Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_1
Oracle user: oracle
Spfile: +DATA/dbm01/spfiledbm01.ora
Domain:
Start options: open
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
1/10
11/23/2014
As you can see, we have this database con gured to use a shutdown immediate when the database is shut down. When we issue a simple
srvctl stop database -d dbm01 we get the following in the third line of the alert log snippet below:
?
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
2/10
11/23/2014
This is what you would expect. The database is receiving a shutdown immediate command from srvctl. Now, lets try this as part of stopping the
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
3/10
11/23/2014
This is what you would expect. The database is receiving a shutdown immediate command from srvctl. Now, lets try this as part of stopping the
clusterware stack:
?
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
Attempting
Attempting
Attempting
Attempting
Attempting
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2672:
CRS-2672:
CRS-2676:
CRS-2676:
CRS-2672:
CRS-2674:
CRS-2673:
to
to
to
to
to
stop
stop
stop
stop
stop
'ora.LISTENER.lsnr' on 'enkdb01'
'ora.dbm01.andy.svc' on 'enkdb01'
'ora.dbm01.soe.svc' on 'enkdb01'
'ora.dbm01.martin.svc' on 'enkdb01'
'ora.cvu' on 'enkdb01'
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
4/10
11/23/2014
CRS-2790:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2673:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2673:
CRS-2677:
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
5/10
11/23/2014
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2792:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2792:
CRS-2677:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2673:
CRS-2673:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2673:
CRS-2677:
CRS-2673:
6/10
11/23/2014
This command stops CRS resources on each of the nodes in the cluster, including the dbm01 database. To look in the alert log, we can see that
the database received a shutdown abort command. Once again, the third line tells us what we want to know:
?
As it turns out, Oracle says that this is expected behavior. In MOS note #1274270.1, Oracle makes their case for crsctl issuing a shutdown abort
when shutting down:
In other words: crsctl stop crs is a command to stop a cluster environment, more precisely Oracle Clusterware here on one node. This
command should only be issued either in cases of planned maintenance or in cases of emergency.For a case of emergency, it is reasonable for
such a command to take down the stack as fast as possible. As fast as possible regarding databases, however, means shutdown abort, as any
other shutdown option can lead to unwanted delays (immediate / transactional for example). This is what we do. Besides, we have been doing
this for most versions, not only for 11g Rel. 2.
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
7/10
11/23/2014
Before shutting down a cluster, its best to utilize srvctl to stop database instances. In order to shut down everything in a home, use the srvctl
stop home command:
?
[enkdb01:oracle:dbm011] /home/oracle
> srvctl stop home -o /u01/app/oracle/product/11.2.0.4/dbhome_1 -s ~/stophome_11.2.0.4.txt -n enkdb01
The le ~/stophome_11.2.0.4.txt is used to designate all of the resources that were shut down by this command:
?
[enkdb01:oracle:dbm011] /home/oracle
> cat ~/stophome_11.2.0.4.txt
db-colvin
svc-ANDY
svc-soe
db-dbm01
From looking at this, we can see that the colvin and dbm01 databases were shut down along with the ANDY and soe services. When we want to
start the resources up, change the above command from srvctl stop home to srvctl start home
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
8/10
11/23/2014
[enkdb01:oracle:dbm011] /home/oracle
> srvctl start home -o /u01/app/oracle/product/11.2.0.4/dbhome_1 -s ~/stophome_11.2.0.4.txt -n enkdb01
Be Sociable, Share!
Tw eet
Like
Share
StumbleUpon
Guido Campra
April 7, 2014
9/10
11/23/2014
http://blog.oracle-ninja.com/2014/04/database-shutdown-with-crsctl/
10/10