Thursday, 23 April 2015

SRVCTL Commands

SRVCTL Commands for administering Oracle RAC RDBMS Instances

Start Database with different option


srvctl start database -d SAPDB -o nomount

srvctl start database -d SAPDB -o mount

srvctl start db -d SAPDB

srvctl start database -d SAPDB -o open

Stop Database with different option


srvctl stop database -d SAPDB -o transactional

srvctl stop database -d SAPDB -o immediate

srvctl stop database -d SAPDB -o abort

srvctl stop db -d SAPDB -o immediate

check the status of the database


srvctl status database -d SAPDB -v service_name

srvctl status database -d SAPDB

Enable and disable database


srvctl enable database -d SAPDB

srvctl disable db -d SAPDB

Check the current database configuration


srvctl config database -d SAPDB

Add the instance


Command: srvctl add instance -d db_name -i inst_name -n node_name

Example: srvctl add instance -d SAPDB -i rac01 -n server1

Remove the instance


Command: srvctl remove instance -d db_name -i inst_name

Example: srvctl remove instance -d SAPDB -i rac01

Start the instance


Command: srvctl start instance -d db_name -i inst_names [-o start_options] [-c connect_str|-q]

Command: srvctl start instance -d db_name -i inst_names [-o open]

Command: srvctl start instance -d db_name -i inst_names -o nomount

Command: srvctl start instance -d db_name -i inst_names -o mount

Example: srvctl start instance -d SAPDB -i rac02

To start the instance in Oracle 11g:


Command: srvctl start instance -d db_unique_name {-n node_name -i "instance_name_list"} [-o

start_options]

Example: srvctl start instance -d SAPDB -n server2

Example: srvctl start instance -d SAPDB -i "rac02, rac03"

To stop the instance


Command: srvctl stop instance -d db_name -i inst_names [-o stop_options] [-c connect_str|-q]

Command: srvctl stop instance -d db_name -i inst_names [-o normal]

Command: srvctl stop instance -d db_name -i inst_names -o transactional

Command: srvctl stop instance -d db_name -i inst_names -o immediate

Command: srvctl stop instance -d db_name -i inst_names -o abort

Example: srvctl stop instance -d SAPDB -i rac03

To stop the instance in Oracle 11g:


Command: srvctl stop instance -d db_unique_name {[-n node_name]|[-i "instance_name_list"]} [-o

stop_options] [-f]

Example: srvctl stop instance -d SAPDB -n server1

Example: srvctl stop instance -d SAPDB -i rac01

To check the status of the instance


Command: srvctl status instance -d db_name -i inst_names [-f] [-v] [-S level]

Example: srvctl status instance -d SAPDB -i rac02

To check the status of the instance in Oracle 11g:


Command: srvctl status instance -d db_unique_name {-n node_name | -i "instance_name_list"} [-f] [-v]

Example: srvctl status instance -d SAPDB -i "rac01,rac02" -v

To enable/disable the instance


Command: srvctl enable instance -d db_name -i inst_names

Example: srvctl enable instance -d SAPDB -i "rac01,rac02"

Command: srvctl disable instance -d db_name -i inst_names

Example: srvctl disable inst -d SAPDB -i "rac01,rac03"

To set dependency of instance to ASM


Command: srvctl modify instance -d db_name -i inst_name {-s asm_inst_name|-r}

Command: srvctl modify instance -d db_unique_name -i instance_name {-n node_name|-z}

Example: srvctl modify instance -d SAPDB -i rac01 -n server1

Example: srvctl modify instance -d SAPDB -i rac01 -z

To move the database instance


Command: srvctl modify instance -d db_name -i inst_name -n node_name

Example: srvctl modify instance -d SAPDB -i rac02 -n server1

To remove the database instance


Command: srvctl modify instance -d db_name -i inst_name -r

Example: srvctl modify instance -d SAPDB -i rac01 -r

To get/set/unset the environment configuration of the instance


Command: srvctl getenv instance -d db_name -i inst_name [-t name_list]

Example: srvctl getenv instance -d SAPDB -i rac01

Command: srvctl setenv instance -d db_name [-i inst_name] {-t "name=val[,name=val,...]" | -T

"name=val"}

Example: srvctl setenv instance -d SAPDB -i rac01 [options]

Command: srvctl unsetenv instance -d db_name [-i inst_name] [-t name_list]

Example: srvctl unsetenv instance -d SAPDB -i rac01 [-t options]

SRVCTL Commands for administering Oracle ASM Instances

Add/Remove the ASM


Command: srvctl add asm [-l lsnr_name] [-p spfile] [-d asm_diskstring]

Command: srvctl remove asm -l [-f]

Example: srvctl add asm -l LISTENER_ASM01 -p +diskg_data/spfile.ora

Example: srvctl remove asm -l LISTENER_ASM01 -f

Start/Stop the ASM


Command: srvctl start asm [-n node_name] [-o start_options]

Example: srvctl start asm -n server1

Command: srvctl stop asm [-n node_name] [-o stop_options] [-f]

Example: srvctl stop asm -n server1 -f

Check the status of the ASM


Command: srvctl status asm [-n node_name] [-a]

Example: srvctl status asm -n server1 -a

Enable/Disable ASM


Command: srvctl enable asm [-n node_name]

Example: srvctl enable asm -n server1

Command: srvctl disable asm [-n node_name]

Example: srvctl disable asm -n server1

Configure the ASM


Command: srvctl config asm [-a]

Example: srvctl config asm -a

SRVCTL command for SCAN(Single Client Access Name):

Add a SCAN


Command: srvctl add scan -n nodename

Example: srvctl add scan -n server1

Remove a SCAN


Example: srvctl remove scan [-f]

Note: Below command is using ordinal_number parameter so An ordinal number is that identifies which

SCAN VIP you want to start. The range of values you can specify for this option is 1 to 3.

Start a SCAN


Command: srvctl start scan [-i ordinal_number] [-n node_name]

Example: srvctl start scan -i 1 -n server1

Stop a SCAN


Command: srvctl stop scan [-i ordinal_number] [-f] </strong>

Example: srvctl stop scan -i 1

Check status of SCAN


Command: srvctl status scan [-i ordinal_number]

Example: srvctl status scan -i 1

Enable a SCAN


Command: srvctl enable scan [-i ordinal_number]

Example: srvctl enable scan -i 1

Disable a SCAN


Command: srvctl disable scan [-i ordinal_number]

Example: srvctl disable scan -i 3

Configure a SCAN


Command: srvctl config scan [-i ordinal_number]

Example: srvctl config scan -i 2

Modify SCAN


Command: srvctl modify scan -n scan_name

Example: srvctl modify scan -n SCAN1

Relocate a SCAN


Command: srvctl relocate scan -i ordinal_number [-n node_name]

Example: srvctl relocate scan -i 2 -n server2

Add service with service goals


Example: srvctl add service -d rac -s rac1 -q TRUE -m BASIC -e SELECT -z 180 -w 5 -j LONG

Add service wih preconnect taf


Command: srvctl add service -d db_unique_name -s service_name -u {-r preferred_list | -a available_list}

Example: srvctl add serv -d rac -s report -r rac01,rac02 -a rac03 -P PRECONNECT

Start service


Command: srvctl start service -d db_unique_name [-s "service_name_list" [-n node_name | -i

instance_name]] [-o start_options]

Example: srvctl start serv -d rac -s rac

Example: srvctl start service -d rac -s rac -i rac2

Stop service


srvctl stop service -d db_unique_name [-s "service_name_list"] [-n node_name | -i instance_name] [-f]

srvctl stop service -d rac -s rac

srvctl stop serv -d rac -s rac -i rac2

View service


srvctl status service -d db_unique_name [-s "service_name_list"] [-f] [-v]

srvctl status service -d rac -s rac -v

Modify the service


Command: srvctl modify service -d db_unique_name -s service_name

[-c {UNIFORM|SINGLETON}] [-P {BASIC|PRECONNECT|NONE}]

[-l {[PRIMARY]|[PHYSICAL_STANDBY]|[LOGICAL_STANDBY]|[SNAPSHOT_STANDBY]} [-q {TRUE|FALSE}] [-

x {TRUE|FALSE}] [-j {SHORT|LONG}] [-B {NONE|SERVICE_TIME|THROUGHPUT}] [-e

{NONE|SESSION|SELECT}] [-m {NONE|BASIC}] [-z failover_retries] [-w failover_delay] [-y

{AUTOMATIC|MANUAL}]

Command: srvctl modify service -d db_unique_name -s service_name -i old_instance_name -t

new_instance_name [-f]

Command: srvctl modify service -d db_unique_name -s service_name -i avail_inst_name -r [-f]

Command: srvctl modify service -d db_unique_name -s service_name -n -i preferred_list [-a

available_list] [-f]

Example: srvctl modify service -d rac -s rac -i rac1 -t rac2

Example: srvctl modify serv -d rac -s rac -i rac1 -r

Example: srvctl modify service -d rac -s rac -n -i rac1 -a rac2

Relocate the service


Command: srvctl relocate service -d db_unique_name -s service_name {-c source_node -n

target_node|-i old_instance_name -t new_instance_name} [-f]

Example: srvctl relocate service -d rac -s rac -i rac1 -t rac3


No comments:

Post a Comment