Using srvctl to Manage your 10g RAC Database

Oracle recommends that RAC databases be managed with srvctl, an Oracle-supplied tool that was first introduced with 9i RAC. The 10g version of srvctl is slightly different from the 9i implementation. In this article.

How and why -- to manage your 10g databases with srvctl.

RAC Architecture Overview

Brief overview of RAC architecture.

1. A cluster is a set of 2 or more nodes that share or coordinate resources to perform the same task.

2. A RAC database is 2 or more instances running on a set of clustered nodes, with all instances accessing a shared set of database files.

3. Depending on the O/S platform, a RAC database may be deployed on a cluster that uses vendor clusterware plus Oracle's own clusterware (Cluster Ready Services), or on a cluster that solely uses Oracle's own clusterware.

Thus, every RAC sits on a cluster that is running Cluster Ready Services. srvctl is the primary tool DBAs use to configure CRS for their RAC database and processes.

Cluster Ready Services and the OCR

Cluster Ready Services, or CRS, is a new feature for 10g RAC. Essentially, it is Oracle's own clusterware. On most platforms, Oracle supports vendor clusterware; in these cases, CRS interoperates with the vendor clusterware, providing high availability support and service and workload management. On Linux and Windows clusters, CRS serves as the sole clusterware. In all cases, CRS provides a standard cluster interface that is consistent across all
platforms.

CRS consists of four processes (crsd, occsd, evmd, and evmlogger) and two disks: the Oracle Cluster Registry (OCR), and the voting disk.

CRS manages the following resources:

1. The ASM instances on each node
2. Databases
3. The instances on each node
4. Oracle Services on each node
5. The cluster nodes themselves, including the following processes:


1. VIP
2. GSD
3. The listener
4. The ONS daemon


CRS stores information about these resources in the OCR. If the information in the OCR for one of these resources becomes damaged or inconsistent, then CRS is no longer able to manage that resource. Fortunately, the OCR automatically backs itself up regularly and frequently.

Interacting with CRS and the OCR: srvctl

srvctl is the tool Oracle recommends that DBAs use to interact with CRS and the cluster registry. Oracle does provide several tools to interface with the cluster registry and CRS more directly, at a lower level, but these tools are deliberately undocumented and intended only for use by Oracle Support. srvctl, in contrast, is well documented and easy to use. Using other tools to modify the OCR or manage CRS without the assistance of Oracle Support runs the risk of damaging the OCR.

Using srvctl

Even if you are experienced with 9i srvctl, it's worth taking a look at this section; 9i and 10g srvctl commands are slightly different.

srvctl must be run from the $ORACLE_HOME/bin of the RAC you are administering. The basic format of a srvctl command is

$ ./srvctl
Usage: srvctl
[]
command:
enabledisablestartstoprelocatestatusaddremovemodifygetenvsetenvunsetenvconfig
objects: databaseinstanceservicenodeappsasmlistener
For detailed help on each command and object and its options use:
srvctl -h
Examples of starting and stopping RAC follow:-

$ gsdctl stat
GSD is running on local node

$ gsdctl stop

$ gsdctl start

Start all its instances and all its services, on all nodes.
$ srvctl start database -d test

Stop all its instances and all its services, on all nodes.
$ srvctl stop database -d test

Startup up the TEST1 instance of the TEST database
$ srvctl start instance -d test -i test1

Bounce the TEST1 instance of the TEST database
$ srvctl stop instance -d test -i test2


To check the CRS status.


# ./crs_stat -t


Name Type Target State Host
------------------------------------------------------------
ora....D1.inst application OFFLINE OFFLINE
ora....D2.inst application OFFLINE OFFLINE
ora.test.db application OFFLINE OFFLINE
ora....od1.gsd application ONLINE ONLINE test1
ora....od1.ons application ONLINE ONLINE test1
ora....od1.vip application ONLINE ONLINE test2
ora....od2.gsd application ONLINE ONLINE test2
ora....od2.ons application ONLINE ONLINE test2
ora....od2.vip application ONLINE ONLINE test1


After db upgrade, Here some crs services are went OFFLINE.


Solution:


Please remove the DBSID from srvctl and add again, just follow the bellow steps.


su - oracle

$ cd $ORACLE_HOME/bin



$ ./srvctl remove database -d test

Remove the database test? (y/[n]) y


$ ./srvctl add database -d test -o /10.2.0/test/app/oracle
$ ./srvctl add instance -d test -i test1 -n test1
$ ./srvctl add instance -d test -i test2 -n test2
$ ./srvctl start database -d test



# ./crs_stat -t

Name Type Target State Host
------------------------------------------------------------
ora....D1.inst application ONLINE ONLINE test1
ora....D2.inst application ONLINE ONLINE test2
ora.test.db application ONLINE ONLINE test1
ora....od1.gsd application ONLINE ONLINE test1
ora....od1.ons application ONLINE ONLINE test1
ora....od1.vip application ONLINE ONLINE test1
ora....od2.gsd application ONLINE ONLINE test2
ora....od2.ons application ONLINE ONLINE test2
ora....od2.vip application ONLINE ONLINE test2



http://www.orafaq.com/node/70




http://www.oracledba.org/11g/rac/11g_RAC_Admin_Utilities.html

4 comments:

Anonymous said...

Hi,

How to RAC OFF ON?
Please let me know.


Thanks...

Anonymous said...

Hi,

Please provide me some RAC command...

Regards,

Raja

Ramesh Mani said...

Please find the RAC turn ON and OFF

Turn Off RAC

cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk rac_off

If this step did not fail with fatal errors, proceed to step 4.

make -f ins_rdbms.mk ioracle

**************************************

Turn on RAC (In both nodes)


cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk rac_on

If this step did not fail with fatal errors, proceed to step 4.

make -f ins_rdbms.mk ioracle


Reference: 211177.1

Regards,
Ramesh Mani

Ramesh Mani said...

Check CRS

#chkcrs


Check Actual Configuration

Have a clear picture of what needs to be changed before start.

As root check the actual configuration

---- 10crs

# which oifcfg


su -oracle

# /testdb/app/10gCRS/bin/oifcfg getif


Check

# /testdb/app/10gCRS/bin/oifcfg getif



which srvctl
/testdb/app/10gCRS/bin/srvctl



============================


Check, backup, restore OCR

$ocrconfig -showbackup

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

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

$cluvfy comp ocr -n all //verification

$ocrcheck //check OCR disk usage



Reference:

OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE),
including moving from RAW Devices to Block Devices -----> Note ID : 428681.1

How to Export/Import an OCR with Ocrconfig : Doc ID: 779149.1