Overview of Oracle Restart commands
Oracle Restart is a new feature of Oracle 11 that will automatically restart certain Oracle processes in the event of a failure. A manual shutdown will not cause it to restart, as Oracle assumes you intend for it to be down. This is a great feature and can really help minimize downtime in certain cases. Imagine your production database crashes in the middle of the night. By the time your pager wakes you up and you login, your database can already have restarted itself. Of course, you would need to do a post-mortem to figure out why it crashed but it can save precious minutes when high availability is important. It is also responsible for starting Oracle when your server is rebooted. This takes the place of the dbora start/stop scripts that have been around for many years.
Oracle Restart (aka “High Availability Services” aka “has”) is controlled at a high level by the crsctl command. If you have administered a RAC cluster, then you are already familiar with this command as it is used to manage Cluster Ready Services (crs). Use “enable” and “disable” to have HAS start automatically when the server is rebooted. Use “stop” and “start” to start or stop HAS manually.
$ crsctl config has CRS-4621: Oracle High Availability Services autostart is disabled. $ crsctl enable has CRS-4622: Oracle High Availability Services autostart is enabled. $ crsctl disable has CRS-4621: Oracle High Availability Services autostart is disabled. $ srvctl config database -d DB11202 PRCD-1027 : Failed to retrieve database DB11202 PRCR-1115 : Failed to find entities of type resource that match filters ((NAME == ora.db11202.db) && (TYPE == ora.database.type)) and contain attributes VERSION,ORACLE_HOME,DATABASE_TYPE Cannot communicate with crsd
In this case, HAS was not running so I receive the error. I can use “crsctl start has” to start HAS as well as all of the services that it controls.
$ crsctl start has $ srvctl status database -d DB11202 Database is running.
Now that HAS is running, I can use it to manage resources with srvctl:
$ srvctl config database -d DB11202 Database unique name: DB11202 Database name: DB11202 Oracle home: /opt/oracle/product/database/188.8.131.52 Oracle user: oracle Spfile: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Disk Groups: Services:
$ srvctl start database -d DB11202 $ srvctl status database -d DB11202 Database is running. $ srvctl stop database -d DB11202 $ srvctl status database -d DB11202 Database is not running.
You can do the same with the listener and your ASM instance:
$ srvctl status listener Listener LISTENER is enabled Listener LISTENER is not running $ srvctl start listener $ srvctl status listener Listener LISTENER is enabled Listener LISTENER is running on node(s): mdlinux
$ srvctl status asm ASM is running on mdlinux $ srvctl stop asm $ srvctl start asm