11gR2和10gR2中crsctl/srvctl的區別

lwitpub發表於2012-04-12
Oracle RAC版本,11gR2中crsctl命令有所增加:

dukerac02 | CBABDB2 | /home/oracle > crsctl
Usage: crsctl []
    command: enable|disable|config|start|stop|relocate|replace|stat|add|delete|modify|getperm|setperm|check|set|get|unset|debug|lsmodules|query|pin|unpin
For complete usage, use:
    crsctl [-h | --help]
For detailed help on each command and object and its options use:
    crsctl -h  e.g. crsctl relocate resource -h

dukerac02 | CBABDB2 | /home/oracle > crsctl add resource --help
Usage:
  crsctl add resource -type [[-file ] | [-attr "[,...]"]] [-f] [-i]
     :   {= | @=}
        :   {@SERVERNAME()[@DEGREEID()] |
                       @CARDINALITYID()[@DEGREEID()] }
where
     resName         Add named resource
     typeName        Resource type
     filePath        Attribute file
     attrName        Attribute name
     value           Attribute value
     server          Server name
     cid             Resource cardinality ID
     did             Resource degree ID
     -f              Force option
     -i              Fail if request cannot be processed immediately

例如,我想把Procwatcher這個oracle tool增加到oracle clusterware中。
注:Procwatcher功能非常的強悍,大概有如下方面的功能:
1. 收集cluster等後臺程式資訊
2. session process的call stack等
3. 還可以收集session的wait,lock等資訊,具體可以參考其prw.sh指令碼,透過修改其中的一些引數進行控制。

Run the following command if on 11.2+ (run this command as the user you want Procwatcher to run as):
dukerac02 | CBABDB2 | /home/oracle > crsctl add resource procwatcher -type application -attr "ACTION_SCRIPT=/home/oracle/prw.sh,START_DEPENDENCIES=hard(ora.racdb.db),AUTO_START=always,STOP_TIMEOUT=15"
Note: Clusterware log info in: /log//agent/crsd/application_oracle

If on 10g or 11.1 run the following as root:
./crs_profile -create procwatcher -t application -a -r -o as=always,pt=15

Example:
./crs_profile -create procwatcher -t application -a /home/oracle/prw.sh -r ora.racdb.racdb1.inst -o as=always,pt=15
 Note: Clusterware log info in:
/log//agent/crsd/application_oracle

Then register the resource:
./crs_register procwatcher

If you intend to run procwatcher as a user other than root, change the permissions:
./crs_setperm procwatcher -u user:oracle:r-x
./crs_setperm procwatcher -o oracle
Note: Refer to the crsd.log to get information about procwatcher monitoring via the clusterware.

11gR2:
dukerac02 | CBABDB2 | /home/oracle > srvctl
Usage: srvctl []
    commands: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config
    objects: database|instance|service|nodeapps|vip|asm|diskgroup|listener|srvpool|server|scan|scan_listener|oc4j|home|filesystem|gns
For detailed help on each command and object and its options use:
  srvctl -h or
  srvctl -h

10gR2:
[oracle@rh4racdb01 ~]$ srvctl
Usage: srvctl []
    command: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config
    objects: database|instance|service|nodeapps|asm|listener
For detailed help on each command and object and its options use:
    srvctl -h

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/628922/viewspace-720982/,如需轉載,請註明出處,否則將追究法律責任。

相關文章