Oracle RAC Srvctl Command Detailed Documentation Document (original translation)

xiaoxiao2021-03-06  21

Srvctl command detailed documentation (translation)

Introduction:

SRVCTL is a tool for Oracle9i RAC cluster configuration management. This article is a reference documentation for all commands for SRVCTL.

Reader Object: Oracle9i RAC Database Cluster Administrator.

Note:

RAC: Real Application Clusters

SRVM: Server Management

-------------------------------------------------- -----------------------------

l SRVCTL ADD

Adding a database or instance configuration information. In adding an example, 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 4-5 SRVCTL Add Command Detailed Options

-------------------------------------------------- -----------------------------

Command option

-------------------------------------------------- -----------------------------

-M database domain name format, "US.Mydomain.com"

-m option The database domain name specified must match the database init.ora or the db_domain and db_name parameters in the SPFILE. When adding a database, the -d specified database name must match the DB_NAME parameter.

-n instance node name

-o $ oracle_home (used to determine the path path of lsnrctl and oracle)

-s spfile file name

-------------------------------------------------- -----------------------------

Example: Add a new database

SRVCTL Add Database -D mydb -o / ora / ora9

Example: Add an instance to the database

SRVCTL Add Instance -D mydb -i mydb01 -n gm01

SRVCTL Add Instance -D mydb -i mydb02 -n gm02

SRVCTL Add Instance -d mydb -i mydb03 -n gm03

l SRVCTL Config

Display configuration information saved in the SRVM configuration file

SRVCTL Config Database

Display database configuration list

SRVCTL config database -d database_name

Database configuration information display format:

Nodename1 instancename1 oraclehome

Nodename2 instancename2 oraclehome

Example: Display database configuration information

SRVCTL config database -d mydb

l Srvctl GetENV

GetENV operation is used to get and display environment variables from the SRVM configuration file

SRVCTL GETENV DATABASE -D Database_name [-t name [, name, ...]]]]]

SRVCTL GETENV Instance -d Database_name -i instance_name [-t name [, name, ...]]

Example: List all environment variables of the database SRVCTL GETENV DATABASE -D MYDB

l srvctl modify

Modify the node configuration information of the instance. These modifications will take effect after the program is restarted next time. The modified information will be saved permanently.

SRVCTL Modify Instance -d Database_name -i Instance_name -n Node_Name

Example: Modify instance to another node

Srvctl modify instance -d mydb -n my_new_node

l SRVCTL Remove

This is a command used to delete configuration information in the SRVM library. Object-related environmental settings are also deleted. If you don't use the mandatory flag (-f), Oracle will prompt you to confirm whether it is deleted.

Use the mandatory option (-f), the delete operation will not be prompted

SRVCTL Remove Database -d Database_name [-f]

SRVCTL REMOVE Instance -d Database_name -i instance_name [-f]

SRVCTL Remove Command Detailed Options

-------------------------------------------------- -----------------------------

-f to force a confirmation prompt when applying the application

-------------------------------------------------- -----------------------------

Example: Delete the database

SRVCTL Remove Database -D mydb

Example: Delete Database instance

SRVCTL Remove Instance -d mydb -i mydb01

SRVCTL REMOVE Instance -d mydb -i mydb02

SRVCTL Remove Instance -d mydb -i mydb03

l Srvctl setENV

Set the environment variable value in the SRVM configuration file.

SRVCTL STENV DATABASE -D Database_name -t name = value [, name = value, ...]

SRVCTL STENV Instance -d Database_name [-i instance_name] -t name = value [, name = value, ...]

Example: Setting the database environment variable

SRVCTL STENV DATABASE -D MYDB -T LANG = EN

l Srvctl Start

Start the database, all instances, or specified instances, and start all relevant unpartked listening.

-------------------------------------------------- -----------------------------

Note:

For start commands and other operations that can use the connection string, if you don't provide a connection string, Oracle uses "/ as sysdba" to perform related operations on an instance. Also, to perform a similar operation, you must be a member of the OSDBA group. For more information on more OSDBA group, please refer to Oracle9i installation guide.

-------------------------------------------------- -----------------------------

SRVCTL Start Database -d Database_name [-o start_options] [-c connection_string]

Srvctl start instance -d database_name -i instance_name [, instance_name-list] [-o start_options] [-c connection_string] Table 4-6 Srvctl start command detailed options

-------------------------------------------------- -----------------------------

Command option

-------------------------------------------------- -----------------------------

-o STARTUP command option directly passed directly from SQL * Plus, can include Pfile

-c Using SQL * Plus Connection Database Instance Connection Strings

-------------------------------------------------- -----------------------------

Example: Start database and all instances

SRVCTL Start Database -d MYDB

Example: Start the specified instance

Srvctl start instance -d mydb -i mydb1, mydb4

l Srvctl status

Display the current status of the specified database

SRVCTL STATUS DATABASE -D Database_name

SRVCTL STATUS Instance -d Database_name -i instance_name [, instance_name-list]

Example: Display data and all instance status

SRVCTL Status Database -d MYDB

Example: Display the status of the specified instance

Srvctl status instance -d mydb -i mydb1, mydb2

l SRVCTL STOP

Stop database All instances can specify an instance

SRVCTL Stop Database -D Database_name [-o stop_options] [-c connect_string]

SRVCTL Stop Instance -D Database_name -i instance_name [, instance_name_list] [-o stop_options] [- c connection_string]

Table 4-7 SRVCTL STOP Command Detailed Options

-------------------------------------------------- -----------------------------

Command option

-------------------------------------------------- -----------------------------

-c Using SQL * Plus Connection Database Instance Connection Strings

-o SHUTDOWN command option directly passed directly in SQL * Plus

-------------------------------------------------- -----------------------------

Example: Stop database all instances

SRVCTL Stop Database -D MYDB

Example: Stop Specify instance

SRVCTL Stop Instance -D mydb -i mydb1

l SRVCTL UNSETENV

Cancel the environment variable definition value in the SRVM configuration file

SRVCTL Unstenv Database -d Database_name-T Name [, Name, ...]

Srvctl unstenv instance -d Database_name [-i instance_name] -t name [, name, ...]

Example: Cancel the environment variable, return to the default value

SRVCTL Unstenv Database -d Mydb -t ClassPath

l Import and export RAW device configuration information using Srvconfig

You can import and export the RAW device configuration information, regardless of the configuration file on the cluster file system or on the RAW device. You can use this method to back up and restore SRVM configuration information.

E.g:

The following command uses the content of the configuration information to the text file you specify the file name.

SRVCONFIG-EXP FILE_NAME

The following command is used to import configuration information from the specified text file to the RAC environment configuration information library to you run the command.

SRVCONFIG-IMP file_name

Yasheng (translation)

2005-04-03

转载请注明原文地址:https://www.9cbs.com/read-40199.html

New Post(0)