Saturday 24 December 2011

Using SRVCTL for Administration of RAC Database

Using SRVCTL for Administration of RAC Database :::


Overview:
This article is a comprehensive guide for Using SRVCTL for Administration of RAC Database.
The Server Control (SRVCTL) utility is installed on each node by default. We can use SRVCTL to start and stop the database and instances, manage configuration information, and to move or remove instances and services. We can also use SRVCTL to add services. SRVCTL also manages configuration information.
Please do keep in mind that this article should not be considered a substitution of the official guide from Oracle (http://www.oracle.com). The below mentioned link can be used to acceess the official SRVCTL Utility Guide:





Objective of the Article:
By the time we finish this article, we should be able to understand the following:
(1)Basic idea of Server Control (SRVCTL) utility.
(2)The use of Server Control (SRVCTL) utility for managing RAC Database.

Values and parameters used in the article:
 Parameter  Node1  Node2
 Hostname  RAC1  RAC2
 Instance Name  RACDB1  RACDB2
 RAC Database Name  RACDB






Summary of SRVCTL commands:
 Command  Description
 srvctl add  Adds the node applications, database, database instance, ASM instance, or service.
 srvctl remove  Removes the node applications, database, database instance, ASM instance, or service.
 srvctl config  Lists the configuration for the node applications, database, ASM instance, or service.
 srvctl enable  Enables the database, database instance, ASM instance, or service.
 srvctl disable  Disables the database, database instance, ASM instance, or service.
 srvctl start  Starts the node applications, database, database instance, ASM instance, or service.
 srvctl stop  Stops the node applications, database, database instance, ASM instance, or service.
 srvctl modify  Modifies the node applications, database, database instance, or service configuration.
 srvctl relocate  Relocates the service from one instance to another.
 srvctl status  Obtains the status of the node applications, database, database instance, ASM instance, or service.
 srvctl getenv  Displays the environment variable in the configuration for the node applications, database, database instance, or service.








 SRVCTL Command Syntax and Options:
SRVCTL commands, objects, and options are case sensitive. Database, instance, and service names are case insensitive and case preserving. SRVCTL interprets the following command syntax:
command_prompt> srvctl command object [options]
In SRVCTL syntax:
  • srvctl is the command to start the SRVCTL utility.
  • command is a verb such as start, stop, or remove.
  • object is an object or target on which SRVCTL performs the command, such as database or instance.
  • options extend the use of a preceding command combination to include additional parameters for the command.


 For all the screenshots, please visit the link::: http://www.sensehaze.com/mydata/resources_section/rac/srvctl/index.php


SRVCTL Command Examples:

Obtaining Command-Line Help for SRVCTL:
For Obtaining Command-Line Help for SRVCTL, from command prompt(terminal) type:
[oracle@rac1 ] srvctl -h

Obtaining version of SRVCTL:
For Obtaining version of SRVCTL, from command prompt(terminal) type:
[oracle@rac1 ] srvctl -v

Display configuration for our RAC database:
For displaying various configuration for our RAC database, from command prompt(terminal) type:
For configuration of database
[oracle@rac1 ] srvctl config database -d racdb
For configuration of services
[oracle@rac1 ] srvctl config service -d racdb
For configuration of nodeapps
[oracle@rac1 ] srvctl config nodeapps -n rac1
[oracle@rac1 ] srvctl config nodeapps -n rac2
For configuration of ASM
[oracle@rac1 ] srvctl config asm -n rac1
[oracle@rac1 ] srvctl config asm -n rac2
For configuration of listener
[oracle@rac1 ] srvctl config listener -n rac1
[oracle@rac1 ] srvctl config nodeapps -n rac2


SRVCTL enable option:
For enabling database/instance etc, of our RAC database, from command prompt(terminal) type:
For enabling database:
[oracle@rac1 ] srvctl enable database -d racdb
For enabling instance:
[oracle@rac1 ] srvctl enable instance -d racdb -i racdb1
[oracle@rac1 ] srvctl enable instance -d racdb -i racdb2



SRVCTL disable option:
For disabling database/instance etc, of our RAC database, from command prompt(terminal) type:
For disabling database:
[oracle@rac1 ] srvctl disable database -d racdb
[oracle@rac1 ] srvctl enable database -d racdb
For dsabling instance:
[oracle@rac1 ] srvctl disable instance -d racdb -i racdb1
[oracle@rac1 ] srvctl disable instance -d racdb -i racdb2


SRVCTL start option:
For starting database:
[oracle@rac1 ] srvctl start database -d racdb
For starting an instance:
[oracle@rac1 ] srvctl start instance -d racdb -i racdb1
For starting nodeapps:
[oracle@rac1 ] srvctl start nodeapps -n rac1
[oracle@rac1 ] srvctl start nodeapps -n rac2
For starting ASM:
[oracle@rac1 ] srvctl start asm -n rac1
[oracle@rac1 ] srvctl start asm -n rac2
For starting listener:
[oracle@rac1 ] srvctl start listener -n rac1
[oracle@rac1 ] srvctl start listener -n rac2


SRVCTL stop option:
For stopping database:
[oracle@rac1 ] srvctl stop database -d racdb
For stopping instance:
[oracle@rac1 ] srvctl stop instance -d racdb -i racdb1


SRVCTL status option:
For status of database:
[oracle@rac1 ] srvctl status database -d racdb
For status of instance(s):
[oracle@rac1 ] srvctl status instance -d racdb -i "racdb1,racdb2"
[oracle@rac1 ] srvctl status instance -d racdb -i racdb1
For status of service(s):
[oracle@rac1 ] srvctl status service -d racdb -s racdb_srvc


For all the screenshots, please visit the link::: http://www.sensehaze.com/mydata/resources_section/rac/srvctl/index.php











No comments:

Post a Comment