Introduce srvctl command


1)SRVCTL is used to manage the following resources (components):

            

Component           Abbreviation       	  Description
asm                 asm                    Oracle ASM instance
database            db                     Database instance
diskgroup           dg                     Oracle ASM disk group
filesystem          filesystem             Oracle ASM file system
home                home                   Oracle home or Oracle Clusterware home
listener            lsnr                   Oracle Net listener
service             serv                   Database service
ons, eons           ons, eons              Oracle Notification Services (ONS)


Command       Description
add                 Adds a component to the Oracle Restart configuration.
config            Displays the Oracle Restart configuration for a component.
disable           Disables management by Oracle Restart for a component.
enable            Reenables management by Oracle Restart for a component.
getenv            Displays environment variables in the Oracle Restart configuration for a database, Oracle ASM instance, or listener.
modify           Modifies the Oracle Restart configuration for a component.
remove           Removes a component from the Oracle Restart configuration.
setenv             Sets environment variables in the Oracle Restart configuration for a database, Oracle ASM instance, or listener.
start                Starts the specified component.
status              Displays the running status of the specified component.
stop                 Stops the specified component.
unsetenv        Unsets environment variables in the Oracle Restart configuration for a database, Oracle ASM instance, or listener.

Here are a matrix of commands/ object combination:

 

Commands Objects Comment

srvctl add
srvctl modify
srvctl remove

instance

database
service
nodeapps

The OCR is modified.

srvctl relocate

service

You can reallocate a service from one named instance to another named instance.

srvctl start
srvctl stop

srvctl status

instance

database
service
asm

nodeapps

 

srvctl disable
srvctl enable

instance

database
service
asm

enable = when the server restart the resource must be restarted

 

disable = when the server restart the resource must NOT be restarted

              (perhaps we are working for some maintenance tasks)

srvctl config

database
service
asm

nodeapps

Lists configuration information from the OCR (Oracle Cluster Registry).

srvctl getenv
srvctl setenv
srvctl unsetenv

instance

database
service
nodeapps

srvctl getenv = displays the environment variables stored in the OCR for target.

srvctl setenv    = allows these variables to be set

srvctl unsetenv = llows these variables to be unset

 

 

The most  SRVCTL commands are:

 

srvctl start database -d DBname
srvctl stop database -d DBname

 

If you don't know the DBname you might run select name from v$database;

 

srvctl start instance -d DBname -i INSTANCEname
srvctl stop instance -d DBname -i INSTANCEname

 

srvctl start instance -d DBname -i INSTANCEname
srvctl stop instance -d DBname -i INSTANCEname

 

srvctl status database -d DBname

srvctl status instance -d DBname -i INSTANCEname

srvctl status nodeapps -n NODEname

 

srvctl enable database -d DBname

srvctl disable database -d DBname

 

srvctl enable instance -d DBname -i INSTANCEname

srvctl disable instance -d DBname -i INSTANCEname

 

srvctl config database -d DBname      -> to get some information about the database from OCR.

 

srvctl getenv nodeaps

 

 

 

ATTENTION:

The following commands are deprecated in Oracle Clusterware 11g release 2 (11.2):

crs_stat
crs_register
crs_unregister
crs_start
crs_stop
crs_getperm
crs_profile
crs_relocate
crs_setperm


crsctl check crsd
crsctl check cssd
crsctl check evmd
crsctl debug log
crsctl set css votedisk
crsctl start resources
crsctl stop resources




Note That:

referred link:http://www.in-oracle.com/Oracle-DBA/RAC/SRVCTL.php














發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章