Srvctl is a tool for Oracle RAC Cluster configuration management. This article is a reference document detailing all the commands for Srvctl.
SRVCTL ADD
Add configuration information for a database or instance. In the Add instance, the name specified with-I should match the instance_name and Oracle_sid parameters.
SRVCTL Add database-d database_name [-M Domain_name]-o oracle_home [-S SPFile]
Srvctl add instance-d database_name-i instance_name-n node_name
Table-SRVCTL Add command detail options
Command options
-m database domain name format such as "Us.mydomain.com"
The database domain name specified by the-m option must match the Db_domain and db_name parameters in the database Init.ora or SPFile. When adding a database, the database name specified by-D must match the db_name parameter
-N Instance Section roll Call
-O $ORACLE _home (used to determine command paths such as Lsnrctl and ORACLE)
-S SPFILE filename
instance: adding a new database
Srvctl Add database-d mydb-o/ora/ora
Instance: Adding an instance to a database
Srvctl add instance-d mydb-i mydb0-n gm0
Srvctl add instance-d mydb-i mydb0-n gm0
Srvctl add instance-d mydb-i mydb0-n gm0
SRVCTL Config
Displays the configuration information saved in the SRVM configuration file
Srvctl Config Database
Display the list of database configurations
Srvctl Config database-d database_name
format for displaying database configuration information:
nodename InstanceName Oraclehome
nodename InstanceName Oraclehome
Instance: Displaying database configuration information
Srvctl config database-d mydb
srvctl Getenv
Getenv operation used to get and display loops from SRVM configuration files Boundary variable
srvctl getenv database-d database_name [-t name[,name, ...]]
Srvctl getenv instance-d database_name-iinstance_name [-t Name[,name, ...]]
Instance: Lists all environment variables for the database
srvctl getenv database-d mydb
Srvctl Modify
Modifies the node configuration information for the instance. These modifications will take effect the next time the program restarts. The modified information will be permanently saved.
Srvctl Modify instance-d database_name-iinstance_name-n node_name
Instance: modifying instance to another node
SRVCT L Modify instance-d mydb-n my_new_node
SRVCTL Remove
This is the command to remove configuration information from the SRVM library. The environment settings associated with the object are also deleted. If you do not use the Force flag (-F), Oracle will prompt you to confirm the deletion.
with the Force option (-f), the delete operation will not prompt
srvctl remove database-d database_name [-f]
Srvctl Remove Instance -ddatabase_name-i instance_name [-f]
SRVCTL remove command verbose option
-F Force Delete application without confirmation prompt
instance: Delete Database
Srvctl Remove database-d mydb
Instance: Delete database instance
Srvctl remove instance-d mydb-i mydb0
Srvctl Remove instance-d mydb-i mydb0
srvctl remove instance-d mydb-i mydb0
Srvctl setenv
The
sets the environment variable value in the SRVM configuration file.
Srvctl setenv database-d database_name-t name=value[,name=value, ...]
Srvctl setenv instance-d database_name [-iinstance_name]-T name=value [, Name=value, ...]
Instance: Setting the database environment variable
Srvctl setenv database-d mydb-t lang=en
srvctl start
Starts the database, all instances, or specified instances, and initiates all related, not-started listening.
Note:
for the start command and other operations that can use a connection string, if you do not supply a connection string, Oracle uses "/as SYSDBA" to perform the relevant action on the instance. In addition, to perform a similar operation, you must be a member of the OSDBA group. For more information on OSDBA group permissions, refer to the Oraclei Installation Guide.
Srvctl Start database-d database_name [-O start_options] [-c connect_string]
Srvctl Start instance -D Database_name-iinstance_name [, Instance_name-list] [-o start_options][-c connect_string]
Table