2012年(33)
分类: Oracle
2012-02-21 08:58:56
Even if you are experienced with 9i srvctl, it's worth taking a look at this section; 9i and 10g srvctl commands are slightly different.
srvctl must be run from the $ORACLE_HOME of the RAC you are administering. The basic format of a srvctl command is
srvctl
where command is one of
enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config
and the target, or object, can be a database, instance, service, ASM instance, or the nodeapps.
The srvctl commands are summarized in this table:
Command | Targets | Description |
---|---|---|
srvctl add srvctl modify srvctl remove |
database instance service nodeapps |
srvctl add / remove adds/removes target's configuration information to/from the OCR.
srvctl modify allows you to change some of target's configuration information in the OCR without wiping out the rest. |
srvctl relocate | service | Allows you to reallocate a service from one named instance to another named instance. |
srvctl config | database service nodeapps asm |
Lists configuration information for target from the OCR. |
srvctl disable srvctl enable |
database instance service asm |
srvctl disable disables target, meaning CRS will not consider it for automatic startup, failover, or restart. This option is useful to ensure an object that is down for maintenance is not accidentally automatically restarted.
srvctl enable reenables the specified object. |
srvctl getenv srvctl setenv srvctl unsetenv |
database instance service nodeapps |
srvctl getenv displays the environment variables stored in the OCR for target.
srvctl setenv allows these variables to be set, and unsetenv unsets them. |
srvctl start srvctl status srvctl stop |
database instance service nodeapps asm |
Start, stop, or display status (started or stopped) of target. |
As you can see, srvctl is a powerful utility with a lot of syntax to remember. Fortunately, there are only really two commands to memorize: srvctl -help displays a basic usage message, and srvctl -h displays full usage information for every possible srvctl command.