Saturday, February 1, 2014

Some useful commands to manage Oracle 10g RAC

Some useful commands to manage Oracle 10g RAC



Check status of Oracle RAC
$ srvctl status database -d RAC
Instance RAC1 is running on node orarac1
Instance RAC2 is running on node orarac2

$srvctl status instance -d RAC -i RAC1
Instance RAC1 is running on node orarac1

$srvctl status asm -n orarac1
ASM instance +ASM1 is running on node orarac1

$srvctl status nodeapps -n orarac1
VIP is running on node: orarac1
GSD is running on node: orarac1
PRKO-2016 : Error in checking condition of listener on node: orarac1
ONS daemon is running on node: orarac1

Please refer PRKO-2016 to Oracle Bug No.4625482 "CHECKING/STARTING/STOPING NAMED LISTENER WITH SRVCTL NODEAPPS FAILS /W PRKO-2016". It's a known issue on Oracle 10.2.0.1. Ignore if the listener works fine.

Stop/Start Oracle RAC
1. Stop Oracle 10g on one of RAC nodes.
$ export ORACLE_SID=RAC1
$ srvctl stop instance -d RAC -i RAC1
$ srvctl stop asm -n orarac1 
$ srvctl stop nodeapps -n orarac1 

2. Start Oracle 10g on one of RAC nodes.
$ export ORACLE_SID=RAC1
$ srvctl start nodeapps -n orarac1
$ srvctl start asm -n orarac1 
$ srvctl start instance -d RAC -i RAC1

3. Stop/start Oracle 10g on all RAC nodes.
$ srvctl stop database -d RAC
$ srvctl start database -d RAC


Check Oracle Listener on nodes
$ srvctl config listener -n orarac1
orarac1 LISTENER_ORARAC1
$ lsnrctl start LISTENER_ORARAC1


Check, backup, restore OCR
$ocrconfig -showbackup

$ocrconfig -export /data/backup/rac/ocrdisk.bak

!To restore OCR, it must stop Clusterware on all nodes before.
$ocrconfig -import /data/backup/rac/ocrdisk.bak

$cluvfy comp ocr -n all //verification

$ocrcheck   //check OCR disk usage


Check configuration of ORACLE RAC
$srvctl config database
RAC

$srvctl config database -d RAC
orarac1 RAC1 /space/oracle/product/10.2.0/db_2
orarac2 RAC2 /space/oracle/product/10.2.0/db_2

$srvctl config asm -n orarac2
+ASM2 /space/oracle/product/10.2.0/db_2

$srvctl config nodeapps -n orarac1 -a -g -s -l
VIP exists.: /orarac1-vip.banctecmtl.lan/10.21.51.13/255.255.224.0/Public
GSD exists.
ONS daemon exists.
Listener exists.

SQL> column HOST_NAME format a10;
SQL> select INSTANCE_NAME, HOST_NAME,STARTUP_TIME,STATUS,PARALLEL,DATABASE_STATUS,ACTIVE_STATE from gv$instance;

INSTANCE_NAME   HOST_NAME  STARTUP_T STATUS        PAR DATABASE_STATUS   ACTIVE_ST
---------------- ---------- --------- ------------ --- ----------------- ---------
rac2            ORARAC2    16-SEP-08 OPEN          YES ACTIVE            NORMAL
rac1            ORARAC1    19-SEP-08 OPEN          YES ACTIVE            NORMAL

No comments: