Friday, 8 April 2016

SRVCTL comands in Oracle RAC

SRVCTL COmands in Oracle RAC

SRVCTL: (Server Control utility)
srvctl command target [options]
srvctl -help or srvctl -vsrvctl -V -- prints version  srvctl version: 10.2.0.0.0 (or) srvctl version: 11.2.0.1.0srvctl -h -- print usagesrvctl status service –h


Database:

srvctl remove database -d db_name [-f]srvctl remove database -d prod
srvctl start database -d db_name [-o start_options] [-c connect_str|-q]srvctl start database -d db_name [-o open]srvctl start database -d db_name -o nomountsrvctl start database -d db_name -o mount
srvctl start db -d prodsrvctl start database -d apps -o open

srvctl stop database -d db_name [-o stop_options] [-c connect_str|-q]
srvctl stop database -d db_name [-o normal]
srvctl stop database -d db_name -o transactional
srvctl stop database -d db_name -o immediate
srvctl stop database -d db_name -o abort
srvctl stop db -d crm -o immediate

srvctl status database -d db_name [-f] [-v] [-S level]
srvctl status database -d db_name -v service_name
srvctl status database -d hrms

srvctl enable database -d db_namesrvctl enable database -d vis

srvctl disable database -d db_namesrvctl disable db -d vis
srvctl config database
srvctl config database -d db_name [-a] [-t]
srvctl config databasesrvctl config database -d HYD -a

srvctl modify database -d db_name [-n db_name] [-o ORACLE_HOME] [-m domain_name] [-p spfile]
[-r {PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY}] [-s start_options] [-y {AUTOMATIC|MANUAL}]
srvctl modify database -d hrms -r physical_standby
srvctl modify db -d RAC -p /u03/oradata/RAC/spfileRAC.ora -- moves p filesrvctl modify database –d HYD –o /u01/app/oracle/product/11.1/db –s open
srvctl getenv database -d db_name [-t name_list]
srvctl getenv database -d prod
srvctl setenv database -d db_name {-t name=val[,name=val,...]|-T name=val}
srvctl setenv database –d HYD –t “TNS_ADMIN=/u01/app/oracle/product/11.1/asm/network/admin”srvctl setenv db -d prod -t LANG=en
srvctl unsetenv database -d db_name [-t name_list]
srvctl unsetenv database -d prod -t CLASSPATH

srvctl add database -d db_unique_name -o ORACLE_HOME [-x node_name] [-m domain_name] [-p spfile] [-r {PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY}] [-s start_options] [-t stop_options] [-n db_name] [-y {AUTOMATIC|MANUAL}] [-g server_pool_list] [-a "diskgroup_list"]

srvctl add database -d prod -o /u01/oracle/product/112/prod -m foo.com -p +dg1/prod/spfileprod.ora -r PRIMARY -s open -t normal -n db2 -y AUTOMATIC -g svrpool1,svrpool2 -a "dg1,dg2"
srvctl remove database -d db_unique_name [-f] [-y] [-v]
srvctl remove database -d prod -y
srvctl stop database -d db_unique_name [-o stop_options] [-f]
srvctl stop database -d dev -f
srvctl status database -d db_unique_name [-f] [-v]
srvctl status db -d sat -v
srvctl enable database -d db_unique_name [-n node_name]
srvctl enable database -d vis -n lnx01
srvctl disable database -d db_unique_name [-n node_name]
srvctl disable db -d vis -n lnx03
srvctl config database [-d db_unique_name [-a]]
srvctl config db -d db_erp -a
srvctl modify database -d db_unique_name [-n db_name] [-o ORACLE_HOME] [-u oracle_user] [-m domain] [-p spfile] [-r {PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY}] [-s start_options] [-t stop_options] [-y {AUTOMATIC|MANUAL}] [-g "server_pool_list"] [-a "diskgroup_list"|-z]
srvctl modify db -d prod -r logical_standbysrvctl modify database -d racTest -a "SYSFILES,LOGS,OLTP"srvctl modify database -d ronedb -e rac1,rac2
srvctl relocate database -d db_unique_name {[-n target_node] [-w timeout] | -a [-r]} [-v]
srvctl relocate database -d rontest -n node2
srvctl relocate database -d rone2db -n lnxrac2 -w 120 -v

srvctl convert database -d ....
srvctl convert database -d ronedb -c RAC -n rac1
srvctl convert database -d ronedb -c RACONENODE -i RoneDB

Instance:


srvctl add instance –d db_name –i inst_name -n node_namesrvctl add instance -d prod -i prod01 -n linux01

srvctl remove instance –d db_name –i inst_name [-f]
srvctl remove instance -d prod -i prod01

srvctl start instance -d db_name -i inst_names [-o start_options] [-c connect_str|-q]
srvctl start instance –d db_name –i inst_names [-o open]
srvctl start instance –d db_name –i inst_names -o nomount
srvctl start instance –d db_name –i inst_names -o mount
srvctl start instance –d dev -i dev2

srvctl stop instance -d db_name -i inst_names [-o stop_options] [-c connect_str|-q]
srvctl stop instance –d db_name –i inst_names [-o normal]
srvctl stop instance –d db_name –i inst_names -o transactional
srvctl stop instance –d db_name –i inst_names -o immediate
srvctl stop instance –d db_name –i inst_names -o abort
srvctl stop inst –d vis -i vis

srvctl status instance –d db_name –i inst_names [-f] [-v] [-S level]
srvctl status inst –d racdb -i racdb2

srvctl enable instance –d db_name –i inst_namessrvctl enable instance -d prod -i "prod1,prod2"

srvctl disable instance –d db_name –i inst_namessrvctl disable inst -d prod -i "prod1,prod3"
srvctl modify instance -d db_name -i inst_name {-s asm_inst_name|-r} -- set dependency of instance to ASMsrvctl modify instance -d db_name -i inst_name -n node_name -- move the instancesrvctl modify instance -d db_name -i inst_name -r -- remove the instance
srvctl getenv instance –d db_name –i inst_name [-t name_list]
srvctl setenv instance –d db_name [–i inst_name] {-t "name=val[,name=val,...]" | -T "name=val"}
srvctl unsetenv instance –d db_name [–i inst_name] [-t name_list]

srvctl start instance -d db_unique_name {-n node_name -i "instance_name_list"} [-o start_options]

srvctl start instance -d prod -n node2srvctl start inst -d prod -i "prod2,prod3"
srvctl stop instance -d db_unique_name {[-n node_name]|[-i "instance_name_list"]} [-o stop_options] [-f]
srvctl stop inst -d prod -n node1srvctl stop instance -d prod -i prod1
srvctl status instance -d db_unique_name {-n node_name | -i "instance_name_list"} [-f] [-v]
srvctl status instance -d prod -i "prod1,prod2" -v
srvctl modify instance -d db_unique_name -i instance_name {-n node_name|-z}
srvctl modify instance -d prod -i prod1 -n mynodesrvctl modify inst -d prod -i prod1 -z

Service:

srvctl add service -d db_name -s service_name -r pref_insts [-a avail_insts] [-P TAF_policy]
srvctl add service -d db_name -s service_name -u {-r "new_pref_inst" | -a "new_avail_inst"}
srvctl add service -d RAC -s PRD -r RAC01,RAC02 -a RAC03,RAC04
srvctl add serv -d CRM -s CRM -r CRM1 -a CRM3 -P basic


srvctl remove service -d db_name -s service_name [-i inst_name] [-f]
srvctl remove serv -d dev -s salessrvctl remove service -d dev -s sales -i dev01,dev02

srvctl start service -d db_name [-s service_names [-i inst_name]] [-o start_options]
srvctl start service -d db_name -s service_names [-o open]
srvctl start service -d db_name -s service_names -o nomount
srvctl start service -d db_name -s service_names -o mount
srvctl start serv -d dwh -s dwh

srvctl stop service -d db_name [-s service_names [-i inst_name]] [-f]
srvctl stop serv -d dwh -s dwh

srvctl status service -d db_name [-s service_names] [-f] [-v] [-S level]srvctl status service -d dev -s dev

srvctl enable service -d db_name -s service_names [–i inst_name]srvctl enable service -d apps -s apps1
srvctl disable service -d db_name -s service_names [–i inst_name]
srvctl disable serv -d dev -s dev -i dev1
srvctl config service -d db_name [-s service_name] [-a] [-S level]
srvctl config service -d db_name -a -- -a shows TAF configurationsrvctl config service -d TEST -s test PREF:TST1 AVAIL:TST2
srvctl modify service -d db_name -s service_name -i old_inst_name -t new_inst_name [-f]
srvctl modify service -d db_name -s service_name -i avail_inst_name -r [-f]
srvctl modify service -d db_name -s service_name -n -i preferred_list [-a available_list] [-f]
srvctl modify service -d db_name -s service_name -i old_inst_name -a avail_inst -P TAF_policy
srvctl modify serv -d PROD -s DWH -n -i I1,I2,I3,I4 -a I5,I6
srvctl relocate service -d db_name -s service_name –i old_inst_name -t target_inst [-f]
srvctl getenv service -d db_name -s service_name -t name_list
srvctl setenv service -d db_name [-s service_name] {-t "name=val[,name=val,...]" | -T "name=val"}
srvctl unsetenv service -d db_name -s service_name -t name_list

srvctl add service -d db_unique_name -s service_name [-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-y {AUTOMATIC|MANUAL}] [-q {true|false}] [-j {SHORT|LONG}] [-B {NONE|SERVICE_TIME|THROUGHPUT}][-e {NONE|SESSION|SELECT}] [-m {NONE|BASIC}][-z failover_retries] [-w failover_delay]srvctl add service -d db_unique_name -s service_name [-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-y {AUTOMATIC|MANUAL}] [-q {true|false}] [-j {SHORT|LONG}] [-B {NONE|SERVICE_TIME|THROUGHPUT}][-e {NONE|SESSION|SELECT}] [-m {NONE|BASIC}][-z failover_retries] [-w failover_delay]srvctl add service -d rac -s rac1 -q TRUE -m BASIC -e SELECT -z 180 -w 5 -j LONG
srvctl add service -d db_unique_name -s service_name -u {-r preferred_list | -a available_list}
srvctl add service -d db_unique_name -s service_name-g server_pool [-c {UNIFORM|SINGLETON}] [-k network_number][-l [PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY][-y {AUTOMATIC|MANUAL}] [-q {TRUE|FALSE}] [-j {SHORT|LONG}][-B {NONE|SERVICE_TIME|THROUGHPUT}] [-e {NONE|SESSION|SELECT}][-m {NONE|BASIC}] [-P {BASIC|NONE|PRECONNECT}] [-x {TRUE|FALSE}][-z failover_retries] [-w failover_delay]
srvctl add service -d db_unique_name -s service_name -r preferred_list [-a available_list] [-P {BASIC|NONE|PRECONNECT}][-l [PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY][-y {AUTOMATIC|MANUAL}] [-q {TRUE|FALSE}] [-j {SHORT|LONG}][-B {NONE|SERVICE_TIME|THROUGHPUT}] [-e {NONE|SESSION|SELECT}][-m {NONE|BASIC}] [-x {TRUE|FALSE}] [-z failover_retries] [-w failover_delay]srvctl add serv -d dev -s sales -r dev01,dev02 -a dev03 -P PRECONNECT
srvctl start service -d db_unique_name [-s "service_name_list" [-n node_name | -i instance_name]] [-o start_options]srvctl start serv -d dev -s devsrvctl start service -d dev -s dev -i dev2
srvctl stop service -d db_unique_name [-s "service_name_list"] [-n node_name | -i instance_name] [-f]srvctl stop service -d dev -s devsrvctl stop serv -d dev -s dev -i dev2
srvctl status service -d db_unique_name [-s "service_name_list"] [-f] [-v]srvctl status service -d dev -s dev -v
srvctl enable service -d db_unique_name -s "service_name_list" [-i instance_name | -n node_name]srvctl enable service -d dev -s devsrvctl enable serv -d dev -s dev -i dev1
srvctl disable service -d db_unique_name -s "service_name_list" [-i instance_name | -n node_name]srvctl disable service -d dev -s "dev,marketing"srvctl disable serv -d dev -s dev -i dev1
srvctl config service -d db_unique_name [-s service_name] [-a]srvctl config service -d dev -s dev
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}]srvctl modify service -d db_unique_name -s service_name -i old_instance_name -t new_instance_name [-f]srvctl modify service -d db_unique_name -s service_name -i avail_inst_name -r [-f]srvctl modify service -d db_unique_name -s service_name -n -i preferred_list [-a available_list] [-f]srvctl modify service -d dev -s dev -i dev1 -t dev2srvctl modify serv -d dev -s dev -i dev1 -rsrvctl modify service -d dev -s dev -n -i dev1 -a dev2
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]srvctl relocate service -d dev -s dev -i dev1 -t dev3

Nodeapps:


#srvctl add nodeapps -n node_name -o ORACLE_HOME -A name|ip/netmask[/if1[|if2|...]]#srvctl add nodeapps -n lnx02 -o $ORACLE_HOME -A 192.168.0.151/255.255.0.0/eth0
#srvctl remove nodeapps -n node_names [-f]
#srvctl start nodeapps -n node_name     -- Starts GSD, VIP, listener & ONS
#srvctl stop nodeapps -n node_name [-r] -- Stops GSD, VIP, listener & ONS
#srvctl status nodeapps -n node_name
#srvctl config nodeapps -n node_name [-a] [-g] [-o] [-s] [-l]-a Display VIP configuration-g Display GSD configuration-s Display ONS daemon configuration-l Display listener configuration
#srvctl modify nodeapps -n node_name [-A new_vip_address]#srvctl modify nodeapps -n lnx06 -A 10.50.99.43/255.255.252.0/eth0
#srvctl getenv nodeapps -n node_name [-t name_list]
#srvctl setenv nodeapps -n node_name {-t "name=val[,name=val,...]"|-T "name=val"}#srvctl setenv nodeapps –n adcracdbq3 –t “TNS_ADMIN=/u01/app/oracle/product/11.1/asm/network/admin”
#srvctl unsetenv nodeapps -n node_name [-t name_list]
In 11g Release 2, some command's syntax has been changed:srvctl add nodeapps -n node_name -A {name|ip}/netmask[/if1[|if2|...]] [-m multicast_ip_address] [-p multicast_port_number] [-l ons_local_port] [-r ons_remote-port] [-t host[:port][,host[:port],...]] [-v]srvctl add nodeapps -S subnet/netmask[/if1[|if2|...]] [-d dhcp_server_type] [-m multicast_ip_address] [-p multicast_port_number] [-l ons_local_port] [-r ons_remote-port] [-t host[:port][,host[:port],...]] [-v]#srvctl add nodeapps -n devnode1 -A 1.2.3.4/255.255.255.0
srvctl remove nodeapps [-f] [-y] [-v]srvctl remove nodeapps
srvctl start nodeapps [-n node_name] [-v]srvctl start nodeapps
srvctl stop nodeapps [-n node_name] [-r] [-v]srvctl stop nodeapps
srvctl status nodeapps
srvctl enable nodeapps [-g] [-v]srvctl enable nodeapps -g -v
srvctl disable nodeapps [-g] [-v]srvctl disable nodeapps -g -v
srvctl config nodeapps [-a] [-g] [-s] [-e]srvctl config nodeapps -a -g -s -e
srvctl modify nodeapps [-n node_name -A new_vip_address] [-S subnet/netmask[/if1[|if2|...]] [-m multicast_ip_address] [-p multicast_port_number] [-e eons_listen_port] [-l ons_local_port] [-r ons_remote_port] [-t host[:port][,host:port,...]] [-v]srvctl modify nodeapps -n mynode1 -A 100.200.300.40/255.255.255.0/eth0
srvctl getenv nodeapps [-a] [-g] [-s] [-e] [-t "name_list"] [-v]srvctl getenv nodeapps -a
srvctl setenv nodeapps {-t "name=val[,name=val][...]" | -T "name=val"} [-v]srvctl setenv nodeapps -T "CLASSPATH=/usr/local/jdk/jre/rt.jar" -v
srvctl unsetenv nodeapps -t "name_list" [-v]srvctl unsetenv nodeapps -t "test_var1,test_var2"

ASM:


srvctl add asm -n node_name -i asminstance -o ORACLE_HOME [-p spfile]
srvctl remove asm -n node_name [-i asminstance] [-f]srvctl remove asm -n db6
srvctl start asm -n node_name [-i asminstance] [-o start_options] [-c connect_str|-q]srvctl start asm -n node_name [-i asminstance] [-o open]srvctl start asm -n node_name [-i asminstance] -o nomountsrvctl start asm -n node_name [-i asminstance] -o mountsrvctl start asm -n linux01
srvctl stop asm -n node_name [-i asminstance] [-o stop_options] [-c connect_str|-q]srvctl stop asm -n node_name [-i asminstance] [-o normal]srvctl stop asm -n node_name [-i asminstance] -o transactionalsrvctl stop asm -n node_name [-i asminstance] -o immediatesrvctl stop asm -n node_name [-i asminstance]-o abortsrvctl stop asm -n racnode1srvctl stop asm -n devnode1 -i +asm1
srvctl status asm -n node_namesrvctl status asm -n racnode1
srvctl enable asm -n node_name [-i asminstance]srvctl enable asm -n lnx03 -i +asm3
srvctl disable asm -n node_name [-i asminstance]srvctl disable asm -n lnx02 -i +asm2 srvctl config asm -n node_namesrvctl config asm -n lnx08
srvctl modify asm -n node_name -i asminstance [-o ORACLE_HOME] [-p spfile]srvctl modify asm –n rac6 -i +asm6 –o /u01/app/oracle/product/11.1/asm

asm_diskstring]srvctl add asmsrvctl add asm -l LISTENERASM -p +dg_data/spfile.ora

srvctl remove asm [-f]srvctl remove asm -f
srvctl start asm [-n node_name] [-o start_options]srvctl start asm -n devnode1
srvctl stop asm [-n node_name] [-o stop_options] [-f]srvctl stop asm -n devnode1 -f
srvctl status asm [-n node_name] [-a]srvctl status asm -n devnode1 -a
srvctl enable asm [-n node_name]srvctl enable asm -n devnode1
srvctl disable asm [-n node_name]srvctl disable asm -n devnode1
srvctl config asm [-a]srvctl config asm -a
srvctl modify asm [-l lsnr_name] [-p spfile] [-d asm_diskstring]srvctl modify asm [-n node_name] [-l listener_name] [-d asm_diskstring] [-p spfile_path_name]srvctl modify asm -l lsnr1
srvctl getenv asm [-t name[, ...]]srvctl getenv asm
srvctl setenv asm {-t "name=val [,...]" | -T "name=value"}srvctl setenv asm -t LANG=en
srvctl unsetenv asm -t "name[, ...]"srvctl unsetenv asm -t CLASSPATH

Listener:
srvctl add listener -n node_name -o ORACLE_HOME [-l listener_name] 
srvctl remove listener -n node_name [-l listener_name] -- 11g R1 command
srvctl start listener -n node_name [-l listener_names]srvctl start listener -n node1
srvctl stop listener -n node_name [-l listener_names]srvctl stop listener -n node1
srvctl status listener [-n node_name] [-l listener_names] -- 11g R1 commandsrvctl status listener -n node2
srvctl config listener -n node_name
srvctl modify listener -n node_name [-l listener_names] -o ORACLE_HOME           

 listener -n racdb4 -o /u01/app/oracle/product/11.1/asm -l "LISTENER_RACDB4"
In 11g Release 2, some command's syntax has been changed:srvctl add listener [-l lsnr_name] [-s] [-p "[TCP:]port[, ...][/IPC:key][/NMP:pipe_name][/TCPS:s_port] [/SDP:port]"] [-k network_number] [-o ORACLE_HOME]srvctl add listener -l LISTENERASM -p "TCP:1522" -o $ORACLE_HOMEsrvctl add listener -l listener112 -p 1341 -o /ora/ora112
srvctl remove listener [-l lsnr_name|-a] [-f]srvctl remove listener -l lsnr01
srvctl stop listener [-n node_name] [-l lsnr_name] [-f]
srvctl enable listener [-l lsnr_name] [-n node_name]srvctl enable listener -l listener_dev -n node5
srvctl disable listener [-l lsnr_name] [-n node_name]srvctl disable listener -l listener_dev -n node5
srvctl config listener [-l lsnr_name] [-a]srvctl config listener
srvctl modify listener [-l listener_name] [-o oracle_home] [-u user_name] [-p "[TCP:]port_list[/IPC:key][/NMP:pipe_name][/TCPS:s_port][/SDP:port]"] [-k network_number]srvctl modify listener -n node1 -p "TCP:1521,1522"
srvctl getenv listener [-l lsnr_name] [-t name[, ...]]srvctl getenv listener
srvctl setenv listener [-l lsnr_name] {-t "name=val [,...]" | -T "name=value"}srvctl setenv listener -t LANG=en
srvctl unsetenv listener [-l lsnr_name] -t "name[, ...]"srvctl unsetenv listener -t "TNS_ADMIN"

Disk group:-

srvctl remove diskgroup -g diskgroup_name [-n node_list] [-f]srvctl remove diskgroup -g DG1 -f
srvctl start diskgroup -g diskgroup_name [-n node_list]srvctl start diskgroup -g diskgroup1 -n node1,node2
srvctl stop diskgroup -g diskgroup_name [-n node_list] [-f]srvctl stop diskgroup -g ASM_FRA_DGsrvctl stop diskgroup -g dg1 -n node1,node2 -f
srvctl status diskgroup -g diskgroup_name [-n node_list] [-a]srvctl status diskgroup -g dg_data -n node1,node2 -a
srvctl enable diskgroup -g diskgroup_name [-n node_list]srvctl enable diskgroup -g diskgroup1 -n node1,node2
srvctl disable diskgroup -g diskgroup_name [-n node_list]srvctl disable diskgroup -g dg_fra -n node1, node2

Home:
srvctl start home -o ORACLE_HOME -s state_file [-n node_name]srvctl start home -o /u01/app/oracle/product/11.2.0/db_1 -s ~/state.txt
srvctl stop home -o ORACLE_HOME -s state_file [-t stop_options] [-n node_name] [-f]srvctl stop home -o /u01/app/oracle/product/11.2.0/db_1 -s ~/state.txt
srvctl status home -o ORACLE_HOME -s state_file [-n node_name]srvctl status home -o /u01/app/oracle/product/11.2.0/db_1 -s ~/state.txt

ONS (Oracle Notification Service):


srvctl add ons [-l ons-local-port] [-r ons-remote-port] [-t host[:port][,host[:port]...]] [-v]srvctl add ons -l 6200
srvctl remove ons [-f] [-v]srvctl remove ons -f
srvctl start ons [-v]srvctl start ons -v
srvctl stop ons [-v]srvctl stop ons -v
srvctl status ons
srvctl enable ons [-v]srvctl enable ons
srvctl disable ons [-v]srvctl disable ons
srvctl config ons
srvctl modify ons [-l ons-local-port] [-r ons-remote-port] [-t host[:port][,host[:port]...]] [-v]srvctl modify ons

EONS (E Oracle Notification Service):
srvctl add eons [-p portnum] [-m multicast-ip-address] [-e eons-listen-port] [-v]#srvctl add eons -p 2018
srvctl remove eons [-f] [-v]srvctl remove eons -f
srvctl start eons [-v]srvctl start eons
srvctl stop eons [-f] [-v]srvctl stop eons -f
srvctl status eons
srvctl enable eons [-v]srvctl enable eons
srvctl disable eons [-v]srvctl disable eons
srvctl config eons
srvctl modify eons [-m multicast_ip_address] [-p multicast_port_number] [-e eons_listen_port] [-v]srvctl modify eons -p 2018

FileSystem:
srvctl add filesystem -d volume_device -v volume_name -g diskgroup_name [-m mountpoint_path] [-u user_name]srvctl add filesystem -d /dev/asm/d1volume1 -v VOLUME1 -d RAC_DATA -m /oracle/cluster1/acfs1
srvctl remove filesystem -d volume_device_name [-f]srvctl remove filesystem -d /dev/asm/racvol1
srvctl start filesystem -d volume_device_name [-n node_name]srvctl start filesystem -d /dev/asm/racvol3
srvctl stop filesystem -d volume_device_name [-n node_name] [-f]srvctl stop filesystem -d /dev/asm/racvol1 -f
srvctl status filesystem -d volume_device_namesrvctl status filesystem -d /dev/asm/racvol2
srvctl enable filesystem -d volume_device_namesrvctl enable filesystem -d /dev/asm/racvol9
srvctl disable filesystem -d volume_device_namesrvctl disable filesystem -d /dev/asm/racvol1
srvctl config filesystem -d volume_device_path
srvctl modify filesystem -d volume_device_name -u user_namesrvctl modify filesystem -d /dev/asm/racvol1 -u sysadmin

SrvPool (Server Pool):
srvctl add srvpool -g server_pool [-i importance] [-l min_size] [-u max_size] [-n node_list] [-f]srvctl add srvpool -g SP1 -i 1 -l 3 -u 7 -n node1,node2
srvctl remove srvpool -g server_poolsrvctl remove srvpool -g srvpool1
srvctl status srvpool [-g server_pool] [-a]srvctl status srvpool -g srvpool2 -a
srvctl config srvpool [-g server_pool]srvctl config srvpool -g dbpool
srvctl modify srvpool -g server_pool [-i importance] [-l min_size] [-u max_size] [-n node_name_list] [-f]srvctl modify srvpool -g srvpool4 -i 0 -l 2 -u 4 -n node3, node4

Server:
srvctl status server -n "server_name_list" [-a]srvctl status server -n server11 -a
srvctl relocate server -n "server_name_list" -g server_pool_name [-f]srvctl relocate server -n "linux1, linux2" -g sp2

Scan (Single client access name):
srvctl add scan -n scan_name [-k network_number] [-S subnet/netmask[/if1[|if2|...]]]#srvctl add scan -n scan.mycluster.example.com
srvctl remove scan [-f]srvctl remove scansrvctl remove scan -f
srvctl start scan [-i ordinal_number] [-n node_name]srvctl start scansrvctl start scan -i 1 -n node1
srvctl stop scan [-i ordinal_number] [-f]srvctl stop scansrvctl stop scan -i 1
srvctl status scan [-i ordinal_number]srvctl status scansrvctl status scan -i 1
srvctl enable scan [-i ordinal_number]srvctl enable scansrvctl enable scan -i 1
srvctl disable scan [-i ordinal_number]srvctl disable scansrvctl disable scan -i 3
srvctl config scan [-i ordinal_number]srvctl config scansrvctl config scan -i 2
srvctl modify scan -n scan_namesrvctl modify scansrvctl modify scan -n scan1
srvctl relocate scan -i ordinal_number [-n node_name]srvctl relocate scan -i 2 -n node2
ordinal_number=1,2,3


Scan-Listener

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

srvctl add scan_listener [-l lsnr_name_prefix] [-s] [-p "[TCP:]port_list[/IPC:key][/NMP:pipe_name][/TCPS:s_port] [/SDP:port]"]#srvctl add scan_listener -l myscanlistener
srvctl remove scan_listener [-f]srvctl remove scan_listenersrvctl remove scan_listener -f
srvctl start scan_listener [-n node_name] [-i ordinal_number]srvctl start scan_listenersrvctl start scan_listener -i 1
srvctl stop scan_listener [-i ordinal_number] [-f]srvctl stop scan_listener -i 3
srvctl status scan_listener [-i ordinal_number]srvctl status scan_listenersrvctl status scan_listener -i 1
srvctl enable scan_listener [-i ordinal_number]srvctl enable scan_listenersrvctl enable scan_listener -i 2
srvctl disable scan_listener [-i ordinal_number]srvctl disable scan_listenersrvctl disable scan_listener -i 1
srvctl config scan_listener [-i ordinal_number]srvctl config scan_listenersrvctl config scan_listener -i 3
srvctl modify scan_listener {-p [TCP:]port[/IPC:key][/NMP:pipe_name] [/TCPS:s_port][/SDP:port] | -u }srvctl modify scan_listener -u
srvctl relocate scan_listener -i ordinal_number [-n node_name]srvctl relocate scan_listener -i 1
ordinal_number=1,2,3

GNS ( Grid Naming Service):


srvctl add gns -i ip_address -d domainsrvctl add gns -i 192.124.16.96 -d cluster.mycompany.com
srvctl remove gns [-f]srvctl remove gns
srvctl start gns [-l log_level] [-n node_name]srvctl start gns
srvctl stop gns [-n node_name [-v] [-f]srvctl stop gns
srvctl status gns [-n node_name]srvctl status gns
srvctl enable gns [-n node_name]srvctl enable gns
srvctl disable gns [-n node_name]srvctl disable gns -n devnode2
srvctl config gns [-a] [-d] [-k] [-m] [-n node_name] [-p] [-s] [-V] [-q name] [-l] [-v]srvctl config gns -n lnx03
srvctl modify gns [-i ip_address] [-d domain]srvctl modify gns -i 192.000.000.007
srvctl relocate gns [-n node_name]srvctl relocate gns -n node2

VIP (Virtual  Interner Protocol):



srvctl add vip -n node_name -A {name|ip}/netmask[/if1[if2|...]] [-k network_number] [-v]#srvctl add vip -n node96 -A 192.124.16.96/255.255.255.0 -k 2
srvctl remove vip -i "vip_name_list" [-f] [-y] [-v]srvctl remove vip -i "vip1,vip2,vip3" -f -y -v
srvctl start vip {-n node_name|-i vip_name} [-v]srvctl start vip -i dev1-vip -v
srvctl stop vip {-n node_name|-i vip_name} [-r] [-v]srvctl stop vip -n node1 -v
srvctl status vip {-n node_name|-i vip_name}srvctl status vip -i node1-vip
srvctl enable vip -i vip_name [-v]srvctl enable vip -i prod-vip -v
srvctl disable vip -i vip_name [-v]srvctl disable vip -i vip3 -v
srvctl config vip {-n node_name|-i vip_name}srvctl config vip -n devnode2
srvctl getenv vip -i vip_name [-t "name_list"] [-v]srvctl getenv vip -i node1-vip
srvctl setenv vip -i vip_name {-t "name=val[,name=val,...]" | -T "name=val"}srvctl setenv vip -i dev1-vip -t LANG=en
srvctl unsetenv vip -i vip_name -t "name_list" [-v]srvctl unsetenv vip -i myvip -t CLASSPATH

OC4J (Oracle Container for Java):
srvctl add oc4j [-v]srvctl add oc4j
srvctl remove oc4j [-f] [-v]srvctl remove oc4j
srvctl start ocj4 [-v]srvctl start ocj4 -v
srvctl stop oc4j [-f] [-v]srvctl stop oc4j -f -v
srvctl status oc4j [-n node_name]srvctl status oc4j -n lnx01
srvctl enable oc4j [-n node_name] [-v]srvctl enable oc4j -n dev3
srvctl disable oc4j [-n node_name] [-v]srvctl disable oc4j -n dev1
srvctl config oc4j
srvctl modify oc4j -p oc4j_rmi_port [-v]srvctl modify oc4j -p 5385
srvctl relocate oc4j [-n node_name] [-v]srvctl relocate oc4j -n lxn06 -v


How to Resolve Virtual IP (VIP) OFFLINE in Oracle Real Application Clusters (RAC) 11gR2?


We have 2 Node Cluster server running on Production , Network team planed and successfully  changed subnet mask  from 255.255.x.x to 255.252.x.x .. suddenly node 1 is went down after changed changed subnet mask.

I checked in cluster statues all the services are up and running but VIP is stopped .


ora.netdb01.vip      1        OFFLINE  INTERMEDIATE netdb02                  FAILED OVER

Tried to reboot the server but no luck.

# srvctl stop nodeapps -n netdb01 

#  srvctl start nodeapps -n netdb01

after stop and started  nodeapps no luck.
[oracle@netdb01 ~]$ srvctl config nodeapps -n netdb01 -a
-n <node_name> option has been deprecated.Network exists: 1/10.130.246.0/255.255.255.0/eth0, type staticVIP exists: /netdb01-vip/10.130.246.65/10.130.246.0/255.255.255.0/eth0, hosting node netdb01 i can see old netmask ip configured in database level.

#srvctl modify nodeapps -n netdb01 -A 10.130.246.61/255.255.252.0/eth0

after modified netmask ip tried to start nodeapps it is successfully started and come in ONLINE.

ora.netdb01.vip      1        ONLINE  ONLINE       netdb01     

please check and revert.


Tuesday, 23 February 2016

ASM DISK creation failed



Marking disk "ASMDATA26" as an ASM disk:                   [FAILED]



I tried to create ASM disk creation failed when you try to create ASM disk,

Kindly check the created Lun size ro correct or not.


[root@vsnlmmdb02 ~]# fdisk -l /dev/mapper/mpath_oradata26

Disk /dev/mapper/mpath_oradata26: 644.2 GB, 644245094400 bytes
255 heads, 63 sectors/track, 78325 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

it is showing size is increasing .

check output file cat /var/log/oracleasm output

Disk "ASMDATA24" does not exist or is not instantiated
Writing disk header: oracleasm-write-label: Unable to clear device "/dev/mapper/mpath_oradata24": Input/output error
failed
Unable to label device "/dev/mapper/mpath_oradata24"
Disk "ASMDATA25" does not exist or is not instantiated
Writing disk header: done
Instantiating disk: done
Disk "ASMDATA26" does not exist or is not instantiated
Writing disk header: oracleasm-write-label: Unable to clear device "/dev/mapper/mpath_oradata26": Input/output error
failed
Unable to label device "/dev/mapper/mpath_oradata26"
Disk "ASMDATA24" does not exist or is not instantiated
Writing disk header: oracleasm-write-label: Unable to clear device "/dev/mapper/mpath_oradata24": Input/output error
failed
Unable to label device "/dev/mapper/mpath_oradata24"

and requested to system team to remove and create properly.




Tuesday, 24 November 2015

Resolve Archive gap between PRIMARY and STANDBY

To Check the below query to confirm ARCHIVE GAP Primary and Standby  servers.


A Physical Standby database syncs with Primary by continuous apply of archive logs from a Primary Database.
When the logs are missing on standby difference is huge (Suppose  more than 600 logs), you have to rebuild the standby database from scratch.

Please use below query to find out archive gap on Standby STEP 1:
set time on
set lines 200

prompt ++++++++++++++++++++LAST SEQUENCE RECIEVED FROM PRODUCTION and APPLIED ON STANDBY+++++++++++++++++++++++++

SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference"
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE
ARCH.THREAD# = APPL.THREAD#
;
OUTPUT ARCHIVE:-
    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         2                  31852                 31852          50
         1                  49127                 49127          50
prompt ++++++++++++++++++++CHECK FOR GAP AT STANDBY+++++++++++++++++++++++++

SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
exit
Find the SCN on the PRIMARY STEP 2:
SQL> select current_scn from v$database;
 
CURRENT_SCN
———–  
222271661
Find the SCN on the STANDBY:
 
SQL> select current_scn from v$database;
CURRENT_SCN
———–  
223762173
Clearly you can see there is difference
In Primary Server will take increment level  backup with SCN STEP 3:-
run {
allocate channel c1 type disk format ‘/oradata/ora_backup/rman/QTSMMDB/%U.bkp’;
backup  AS COMPRESSED BACKUPSET  incremental from scn 223762173 database;
}
run
{
allocate channel c1 type disk format
‘/oradata/ora_backup/rman/QTSMMDB/%U.bkp’;
backup current controlfile for standby;
}
Stop and shutdown the managed standby apply process STEP 4:
SQL> alter database recover managed standby database cancel;
Database altered.
Shutdown the standby database
SQL> shut immediate
Step 5:-
Copy the backup dump to  standby instance.
step 6:-
Connect to RMAN on STANDBY, Catalog backup files to RMAN using below commands STEP 7:
$ rman target /
RMAN> startup nomount;
RMAN> catalog start with ‘/oradata/ora_backup/Standby/c-3875280703-20150907-02’;
RMAN> restore standby controlfile from
'/oradata/ora_backup/Standby/c-3875280703-20150907-02';
RMAN> sql 'alter database mount standby database';
RMAN> catalog start with ‘/oradata/ora_backup/Standby/’;
PERFORM RECOVER:
RMAN> recover database;
Start managed recovery process STEP 8:
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Check the SCN’s in primary and standby it should be close to each other.

Tuesday, 17 November 2015

ORA-00600 Internal Error Solution Troubleshooting

Have you observed an ORA-0600 error reported in your alert log?

The ORA-600 error is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition.
The ORA-600 error statement includes a list of arguments in square brackets:
ORA 600 "internal error code, arguments: [%s], [%s],[%s], [%s], [%s]"
The first argument is the internal message number or character string. This argument and the database version number are critical in identifying the root cause and the potential impact to your system.  The remaining arguments in the ORA-600 error text are used to supply further information (e.g. values of internal variables etc).
The first argument may help to narrow your problem to known issues. However, this argument can point to functionality that is referenced by many areas in the Oracle source code. The more detailed call stack information reported in the ORA-600 error trace may be needed to find a solution.

Looking for the best way to diagnose?
Whenever an ORA-600 error is raised, a trace file is generated and an entry is written to the alert.log with details of the trace file location. As of Oracle 11g, the database includes an advanced fault diagnosability infrastructure to manage trace data.
1) Check the Alert Log
The alert log may indicate additional errors or other internal errors at the time of the problem. Focus your analysis of the problem on the first internal error in the sequence. There are some exceptions, but often additional internal errors are side-effects of the first error condition.
The associated trace file may be truncated if the MAX_DUMP_FILE_SIZE parameter is not setup high enough or to „unlimited‟. If you see a message at the end of the trace file
"MAX DUMP FILE SIZE EXCEEDED"
there could be vital diagnostic information missing in the file and finding the root issue may be very difficult. Set the MAX_DUMP_FILE_SIZE appropriately and regenerate the error for complete trace information.

There are alternative checks that can be made to make sure everything's fine because these internal errors can also be because of the following reasons:

  • Timeouts 
  • File corruption 
  • Failed data checks in memory 
  • Hardware, memory, or I/O errors 
  • Incorrectly restored files.

 Note:- we are getting correct solution for ORA-00600 Error , we raised SR to oracle Support  so if you are still left with unsolved ORA-600 then it'll be better to go for Oracle Support.



Tuesday, 26 August 2014

The database is down. Please specify the host credentials to access database restart and diagnostics tools


The database is down. Please specify the host credentials to access database restart and diagnostics tools.
Enterprise manager shows that database is down but in real it is not.
[oracle@grhldb01 trace]$ sqldba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Sep 13 10:38:01 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select name,open_mode from v$database;

NAME    OPEN_MODE
------------
TCHDB   READ WRITE
check the listener status.

[oracle@grhldb01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 26-AUG-2014 13:16:23

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                13-MAR-2014 12:53:12
Uptime                    165 days 23 hr. 23 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /orabin/grid11gR2/grid/network/admin/listener.ora
Listener Log File         /orabin/grid11gR2/base/diag/tnslsnr/grhldb01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.128.0.42)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "TCHDB" has 2 instance(s).
  Instance "TCHDB1", status READY, has 2 handler(s) for this service...
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCHDB1_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCHDB2_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCHDBXDB" has 2 instance(s).
  Instance "TCHDB1", status READY, has 1 handler(s) for this service...
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCH_ESP_ORANGE_02_RAC" has 2 instance(s).
  Instance "TCHDB1", status READY, has 2 handler(s) for this service...
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCH_GBR_VODA_02_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
Service "TCH_GBR_VODA_RAC" has 1 instance(s).
  Instance "TCHDB2", status READY, has 1 handler(s) for this service...
The command completed successfully

it’s runing.

Solution:
select username, account_status from dba_users order by 2;
shows that
DBSNMP EXPIRED
SYSMAN EXPIRED
SYSTEM EXPIRED.

if they are locked then simple unlock with commands:
alter user DBSNMP account unlock;
alter user SYSTEM account unlock;
alter user SYSMAN account unlock;
it’s all, now enjoy with enterprise manager