Useful SRVCTL Commands (Oracle RAC)

Configurare noua (How To)

Situatie

If you have to administer an Oracle Real Application Clusters (Oracle RAC) databases and instances using the Server Control Utility (SRVCTL).

The Server Control (SRVCTL) utility is installed on each node by default. You can use SRVCTL to start and stop the database and instances, manage configuration information, and to move or remove instances and services. You can also use SRVCTL to add services. SRVCTL also manages configuration information.

Syntax:

srvctl command object [parameters]

To see the command syntax and a list of options for each SRVCTL command, from the command line enter:

srvctl command (or verb) object (or noun) -h

Solutie

Pasi de urmat

STOP DATABASE:

Syntax:

srvctl stop database -d db_unique_name [-o stop_options] [-c connect_str | -q]
Example:
srvctl stop database -d BP1 -o normal
srvctl stop database -d BP1 -o immediate
srvctl stop database -d BP1 -o transactional
srvctl stop database -d BP1 -o abort

START DATABASE:

Syntax:

srvctl start database -d db_unique_name [-o start_options] [-c connect_str | -q]
Example:
srvctl start database -d PRODB -o nomount
srvctl start database -d PRODB -o mount
srvctl start database -d PRODB -o open

STOP AN INSTANCE:

Syntax:

srvctl stop instance -d db_unique_name -i inst_name_list [-o stop_options] [-c connect_str | -q]
Example:
srvctl stop instance -d BP1 -i BP11

START AN INSTANCE:

Syntax:

srvctl start instance -d db_unique_name -i inst_name_list [-o start_options] [-c connect_str | -q]
Example:
srvctl start instance -d BP1 -i BP11

ADDING DB IN CRS:

Syntax:

srvctl add database -d db_unique_name -o oracle_home [-m domain_name] [-p
spfile] [-A addr_str] [-r {PRIMARY |
PHYSICAL_STANDBY | LOGICAL_STANDBY}] [-s start_options] [-n db_name] - y database_name [ automatic | manual ]
Example:
srvctl add database -d BP1 -o /u01/app/oracle/product/19.0.0.0/dbhome_1 -p +DATA/BP1/parameterfile/spfileBP1.ora

REMOVING DB FROM CRS:

Syntax:

srvctl remove database -d db_unique_name [-f]
Example:
srvctl remove database -d BP1 -f -y

REMOVING AN INSTANCE FROM CRS:

Syntax:

srvctl remove instance -d db_unique_name -i inst_name [-f]
Example:
srvctl remove instance -d BP1 -I BP11

ADDING AN INSTANCE TO CRS:

Syntax:

srvctl add instance -d db_unique_name -i inst_name -n node_name
Example:
srvctl add instance -d BP1 -i BP11 -n oracleracnode1

Enable/disable auto restart of the instance:

Syntax:

srvctl enable instance -d DB_UNIQUE_NAME -i INSTANCE_NAME
srvctl disable instance -d DB_UNIQUE_NAME -i INSTANCE_NAME
Example:
srvctl enable instance -d BP1 -i BP11
srvctl disable instance -d BP1 -i BP11

Enable/disable auto restart of the database:

Syntax:

srvctl enable database -d DB_UNIQUE_NAME
srvctl disable database -d DB_UNIQUE_NAME
Example:
srvctl enable database -d BP1
srvctl disable database -d BP1

ADDING A SERVICE:

Syntax:

srvctl add service -d db_unique_name -s service_name -r preferred_list
[-a available_list] [-P TAF_policy]
Example:
srvctl add service -d BP1 -s BP1_SRV -r "BP11,BP12" -a "BP12" -P BASIC

REMOVING A SERVICE:

Syntax:

srvctl remove service -d db_unique_name -s service_name [-i inst_name] [-f]
Example:
srvctl remove service -d BP1 -s BP1_SRV

START A SERVICE:

Syntax:

srvctl start service -d db_unique_name [-s service_name_list [-i inst_name]]  [-o start_options] [-c connect_str | -q]
Example:
srvctl start service -d BP1 -s BP1_SRV

STOP A SERVICE:

Syntax:

srvctl stop service -d db_unique_name [-s service_name_list [-i inst_name]]  [-c connect_str | -q] [-f]
Example:
srvctl stop service -d BP1 -s BP1_SRV

RELOCATE A SERVICE:

Syntax:

srvctl relocate service -d db_unique_name -s service_name -i old_inst_name -t new_inst_name [-f] 
Example:
srvctl relocate service -d BP1 -s BP1_SVC -i BP12 -t BP11

Check the status of service:

Syntax:

srvctl status service -d db_unique_name -s service_name_list [-f] [-v] [-S] level
Example:
srvctl status service -d BP1 -s BP1_SVC

Check the configuration of service:

Syntax:

srvctl config service -d db_unique_name [-s service_name] [-a]
Example:
srvctl config service -d BP1 -s BP1_SVC

Check scan listener configuration:

Syntax:

srvctl config scan_listener
Example:
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1522
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1522
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1522
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:

Check scan listener configuration:

Syntax:

srvctl modify scan_listener -p {new-SCAN-port} 
Example:
srvctl modify scan_listener -p 1525

$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl start scan_listener

alter system set remote_listener='oracleracnode1.example.com:1525' scope=both sid='*';

Tip solutie

Permanent

Voteaza

(20 din 47 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?