A1.2 SRVCTL: Server control

 < Day Day Up > 



In this section, let us look at the server control (SRVCTL) commands provided by Oracle to manage the clustered databases from the command line. The SRVCTL replaces and extends the capabilities of the OPS tool called OPSCTL, which supported only the START and STOP subcom mands. In comparison to OPSCTL, the START and STOP subcommands have been extended with additional options and new subcommands have been added to support more functionality.

Unlike its predecessor, the SRVCTL utility also helps monitor the instances from the Oracle Enterprise Manager (OEM). It serves as a single point of control between the Oracle Intelligent Agent (OIA) and the nodes of the cluster. Only one node's OIA is used to communicate with the SRVCTL. That node communicates to the other nodes through Oracle Net.

Before invoking any commands to manage the RAC from the SRVCTL utility, it is required that the global services daemon (GSD) is configured and running on the node.

START subcommand

srvctl start -d <db_name>

Start specified RAC database

-i <instance_name,>

Start named instances if specified, otherwise entire RAC

-n <node,. . .>

Start instances on named nodes

-s <stage,. . .>

List of stages to start (stage = inst, lsnr)

-x <stage,. . .>

Except these stages

-c <connect string>

Connect string (default: /as sysdba)

-o <options>

Options to startup command (for example force or nomount)

-S <status level>

Intermediate status level for console

-D <debug level>

Debug level

-h

Print usage

Usage

This starts the instances that are configured for a database (e.g., PRODDB1) and listeners in a RAC:

srvctl start -d PRODDB1

To start the instance RAC1 and its listeners:

srvctl start -d PRODDB1 -i RAC1

To start only instance RAC1:

srvctl start -d PRODDB1 -i RAC1 -s inst

To start only listeners for instance RAC1:

srvctl start -d PRODDB1 -i RAC1 -s lsnr 

Start all instances with debug output enabled:

srvctl start -d PRODDB1 -x lsnr -D 3

STOP subcommand

srvctl stop -d <db_name>

Stop specified RAC database

-i <instance_name,>

Stop named instances if specified, otherwise entire RAC

-n <node,. . .>

Stop instances on named nodes

-s <stage,. . .>

List of stages to stop (stage= inst, lsnr)

-x <stage,. . .>

Except these stages

-c <connect string>

Connect string (default: /as sysdba)

-o <options>

Options to shutdown command (e.g., force or nomount)

-S <status level>

Intermediate status level for console

-D <debug level>

Debug level

-h

Print usage

Usage

Stop instances and listeners in database PRODDB1:

srvctl stop -d PRODDB1

Stop only listeners:

srvctl stop -d PRODDB1 -s lsnr

Stop instance RAC1 with an option and with debug output:

srvctl stop -d PRODDB1 -i RAC1 -s inst -o immediate -D 3

Stop the instance on node ora-db1:

srvctl stop -p PRODDB1 -n ora-db1 -x lsnr

Stop database PRODDB1 with connection string system/manager:

srvctl stop -d PRODDB1 -c 'system/manager' 

STATUS subcommand

srvctl status -d <db_name>

Check specified RAC database

-i <instance_name,>

Check named instances if specified, otherwise entire RAC

-n <node,. . .>

Check instances on named nodes

-s <stage,. . .>

List of stages to check status (stage = inst, lsnr)

-x <stage,. . .>

Except these stages

-c <connect string>

Connect string (default: /as sysdba)

-S <status level>

Intermediate status level for console

-D <debug level>

Debug level

-h

Print usage

Usage

Get status of database PRODDB1:

srvctl status -d PRODDB1

Get status of instance PRODDB1:

srvctl status -d PRODDB1 -i RAC1 -s inst

Get status of all listeners in database PRODDB1:

srvctl status -p PRODDB1 -s lsnr

CONFIG subcommand

srvctl status -d <db_name>

Show configuration for specified RAC database

-n <node,. . .>

Only show services on named nodes

-D <debug level>

Debug level

-V

Show version

-h

Print usage

Usage

List Real Application Clusters on the raw device:

srvctl config 

Get configuration of database PRODDB1:

srvctl config -d PRODDB1

Get configuration of node ora-db1 (entries from all database configurations apply):

srvctl config -n ora-db1

Get configuration of node ora-db1 in database PRODDB1:

srvctl config -d PRODDB1 -n ora-db1

Display version:

srvctl config -V

ADD, DELETE, and RENAME subcommands

srvctl add -d <db_name>

Name of RAC to add to

-i <instance_name,>

Name of instance to add

-n <node,. . .>

Name of node on which to add instance

-D <debug level>

Debug level

-h

Print usage

  

srvctl delete -d

Name of RAC to delete from

<db_name>

 

-i <instance_name,>

Name of instance to delete

-D <debug level>

Debug level

-h

Print usage

  

srvctl rename -d

Name of RAC to rename

<db_name>

 

-i <oldinstance_name,>

Name of instance to rename

-e <newinstance_name,>

New name for instance

-D <debug level>

Debug level

-h

Print usage

Usage

Add database PRODDB1 to raw device:

srvctl add db -d PRODDB1 -o /disk1/ora9 

Add an instance to PRODDB1:

srvctl add instance -d PRODDB1 -i RAC1 -n ora-db1

Delete instance OLDRACx from PRODDB1:

srvctl delete instance -d PRODDB1 -i RACx

Delete database PRODDB1:

srvctl delete db -d PRODDB1

Rename instance RACx as RAC1:

srvctl rename instance -d PRODDB1 -i RACx -e RAC1

MOVE, SET, and UNSET subcommands

srvctl move -d <db_name>

Name of RAC in which instance should be moved

-i <instance_name,>

Name of instance to move

-n <newnode,. . .>

New node for instance

-D <debug level>

Debug level

-h

Print usage

  

srvctl set env -d <db_name>

Name of RAC in which to set environment

-t <name>= <value>

Name and value of environment variable

-i <instance_name,>

Instance for which environment should be set

-D <debug level>

Debug level

-h

Print usage

  

srvctl unset -d <db_name>

Name of RAC to unset

-t <name>

Name of environment variable to unset

-i <instance_name,>

Instance for which environment vari- able should be unset

Usage

Move an instance RAC1 to new node ora-db2:

srvctl move instance -d PRODDB1 -i RAC1 -n ora-db2

Set Real Application Clusters environment:

srvctl set env -d PRODDB1 -t NLS_LANGUAGE= English

Set instance environment:

srvctl set env -d PRODDB1 -i RAC1 -t NLS_LANGUAGE= English

Unset Real Application Clusters environment:

srvctl unset env -d PRODDB1 -t NLS_LANGUAGE

GET subcommands

srvctl get env -d <db_name>

Name of RAC from which to get environment

-i <instance_name,>

Instance for which environment variables should be displayed

-V

Print version

Usage

Display all Real Application Clusters environment settings:

srvctl get env -d PRODDB1

Display all instance environment settings:

srvctl get env -d PRODDB1 -i RAC1



 < Day Day Up > 



Oracle Real Application Clusters
Oracle Real Application Clusters
ISBN: 1555582885
EAN: 2147483647
Year: 2004
Pages: 174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net