Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

Oracle Restart 11gR2

Oracle Restart 11gR2

Oracle Restart adds a lightweight clusterware functionality to a single instance database. If the instance crashes, Oracle Restart brings it up, monitors it ans so on. And by the way, this is called “Grid Infrastructure” istead of CRS as in earlier Oracle releases. So you have to install two Oracle Homes – one each for grid and the rdbms.

When there is Grid, there is srvctl, of course. The grid infrastructure comes with srvctl. Here is how you check what is running from a specific Oracle Home:

oracle@raclinux1 ~# srvctl status home -o /u01/oracle/product/11gR2/db1 -s state.txt
Database d112d1 is running on node raclinux1

The above command create a file called state.txt.

oracle@raclinux1 ~# cat state.txt
db-db

It shows the database name – DB.

This is done on a single instance Oracle database; not a cluster. But the grid infrastructure looks and feels like a cluster. Here are some more commands to check status:

oracle@raclinux1 ~# srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): raclinux1
oracle@raclinux1 ~# srvctl status asm -a
ASM is running on raclinux1
ASM is enabled.

A bunch of new processes suppor this grid infrastructure:

oracle   19046     1  0 18:13 ?        00:00:03 /u01/oracle/product/11gR2/grid1/bin/ohasd.bin rebootoracle 19487 1 0 18:15 ? 00:01:14 /u01/oracle/product/11gR2/grid1/bin/oraagent.bin

oracle 19502 1 0 18:15 ? 00:00:01 /u01/oracle/product/11gR2/grid1/bin/tnslsnr LISTENER -inheritoracle 19656 1 0 18:15 ? 00:00:01 /u01/oracle/product/11gR2/grid1/bin/cssdagent

oracle 19658 1 0 18:15 ? 00:00:02 /u01/oracle/product/11gR2/grid1/bin/orarootagent.binoracle 19674 1 0 18:15 ? 00:00:01 /u01/oracle/product/11gR2/grid1/bin/ocssd.bin

oracle 19687 1 0 18:15 ? 00:00:00 /u01/oracle/product/11gR2/grid1/bin/diskmon.bin -d -f

Let’s see what happens when you kill the instance.

oracle@raclinux1 ~# ps -aef | grep pmon    14225 13768  0 23:15 pts/7    00:00:00 grep pmon    19866     1  0 18:16 ?        00:00:00 asm_pmon_+ASM

oracle   26965     1  0 20:53 ?        00:00:00 ora_pmon_DB

oracle@raclinux1 ~# kill -9 26965

This will, of course, crash the instance. Let’s chck after some time:

oracle@raclinux1 ~# ps -aef | grep pmon     14315     1  0 23:15 ?        00:00:00 ora_pmon_DB

oracle   14686 11492  0 23:17 pts/2    00:00:00 grep pmon    19866     1  0 18:16 ?        00:00:00 asm_pmon_+ASM

Where did the pmon come from? Didn’t the instance just crash?

The instance was restarted by Oracle Restart.

What if you want to just keep the instance down, e.g. during a maintenance. Well, just shutdown normally; the instance will stay down. When you are ready, start the instance using either SQL*Plus or srvctl:

oracle@raclinux1 ~# srvctl start database -d DB

Remember, DB is a single instance database.

November 7, 2009 Posted by | oracle | 2 Comments