Similar to the clusterware processes in a RAC environment, in 11g R2 even for a standalone instance, functionality is now available to automatically restart components like the database, listener, ASM diskgroup, service etc in the event of their failure.
This feature is called Oracle Restart and it runs out of the Grid Infrastructure home which is separate from the database home.
Oracle Restart is managed by CRSCTL utility and it uses Oracle High Availability Services to start and stop the components managed by Oracle Restart.
Using Oracle Restart, we can stop or start all the components running out of a single Oracle Home with a single srvctl command as well as Oracle Restart will automatically start all components on machine reboot in the proper order taking into account dependencies like ASM instance and the managed database instances. So no more do we have to use the dbstart and dbstop scripts to manage this.
Oracle Restart can be extended to Data Guard configurations as well by integrating with Data Guard Broker to manage the start and stop of database services following a data guard role transition.
Let us examine some of the srvctl commands which can be executed in a single instance environment as well as see the use of the crsctl command – normally previously only used for RAC environments.
-bash-3.2$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA1.dg ora....up.type ONLINE ONLINE redhat64
ora....ER.lsnr ora....er.type ONLINE ONLINE redhat64
ora....WARE.dg ora....up.type ONLINE ONLINE redhat64
ora.asm ora.asm.type ONLINE ONLINE redhat64
ora.cssd ora.cssd.type ONLINE ONLINE redhat64
ora.diskmon ora....on.type ONLINE ONLINE redhat64
ora.eons ora.eons.type ONLINE ONLINE redhat64
ora.ons ora.ons.type ONLINE ONLINE redhat64
bash-3.2$ ./crsctl check has
CRS-4638: Oracle High Availability Services is online
-bash-3.2$ ./crsctl check css
CRS-4529: Cluster Synchronization Services is online
-bash-3.2$ ./srvctl start listener
-bash-3.2$ ps -ef |grep tns
oracle 14899 1 0 14:08 ? 00:00:00 /u02/app/oracle/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit
-bash-3.2$ ./srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): redhat64
-bash-3.2$ ./srvctl status asm
ASM is running on redhat64
-bash-3.2$ ./srvctl status diskgroup -g DATA1
Disk Group DATA1 is running on redhat64
-bash-3.2$ ./srvctl config asm
ASM home: /u02/app/oracle/product/11.2.0/grid
ASM listener: LISTENER
Spfile: +DATA1/asm/asmparameterfile/registry.253.700932479
ASM diskgroup discovery string: /dev/raw/raw*
In case a process dies unexpectedly, Oracle Restart will automatically start the process. In the example below, we kill the PMON process of the ora11gr2 instance and find that in less than 5 seconds the instance has been restarted by the Oracle High Availablity Service running in the background constantly monitoring the health of the managed components.
-bash-3.2$ ps -ef |grep pmon
oracle 12710 1 0 Oct22 ? 00:00:01 asm_pmon_+ASM
oracle 15752 1 0 14:14 ? 00:00:00 ora_pmon_ora11gr2
oracle 15975 18271 0 14:15 pts/2 00:00:00 grep pmon
-bash-3.2$ kill -9 15752
-bash-3.2$ ps -ef |grep pmon
oracle 12710 1 0 Oct22 ? 00:00:01 asm_pmon_+ASM
oracle 16679 1 0 14:22 ? 00:00:00 ora_pmon_ora11gr2
oracle 16775 18271 0 14:22 pts/2 00:00:00 grep pmon
In this example we stop all the components running out of a particular home by executing the srvctl stop home command. After stopping the database home, we find that only the ASM instance is running as it is managed by a seperate home which is the Grid Infrastructure home. After the database home is started, the database instance ora11gr2 also is automatically started.
[oracle@redhat346 ~]$ srvctl stop home -o /u01/app/oracle/product/11.2.0/dbhome_1 -s /tmp/state
[oracle@redhat346 ~]$ ps -ef |grep pmon
oracle 19841 1 0 Sep18 ? 00:01:24 asm_pmon_+ASM
oracle 31843 27855 0 15:19 pts/1 00:00:00 grep pmon
[oracle@redhat346 ~]$ srvctl start home -o /u01/app/oracle/product/11.2.0/dbhome_1 -s /tmp/state
[oracle@redhat346 ~]$ ps -ef |grep pmon
oracle 19841 1 0 Sep18 ? 00:01:24 asm_pmon_+ASM
oracle 26690 1 0 Oct08 ? 00:00:41 ora_pmon_emrep
oracle 32054 1 0 15:20 ? 00:00:00 ora_pmon_testdb
oracle 32344 1 0 15:20 ? 00:00:00 ora_pmon_ora11gr2
oracle 32620 27855 0 15:22 pts/1 00:00:00 grep pmon
No comments:
Post a Comment