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]
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]
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]
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]
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 ]
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]
srvctl remove database -d BP1 -f -y
REMOVING AN INSTANCE FROM CRS:
Syntax:
srvctl remove instance -d db_unique_name -i inst_name [-f]
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
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
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
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]
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]
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]
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]
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]
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
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]
srvctl config service -d BP1 -s BP1_SVC
Check scan listener configuration:
Syntax:
srvctl config scan_listener
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}
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='*';
Leave A Comment?