- 最后登录
- 2017-5-4
- 在线时间
- 81 小时
- 威望
- 999
- 金钱
- 2391
- 注册时间
- 2013-9-11
- 阅读权限
- 150
- 帖子
- 1124
- 精华
- 5
- 积分
- 999
- UID
- 1220
|
2#
发表于 2013-11-17 16:53:14
修改资源:
crsctl modify resource resource_name -attr "attribute_name=attribute_value"
[-i] [-f] [-delete]
resource_name The name of the resource you want to modify.
-attr "attribute_name=attribute_value"
-i If you specify -i, then the command returns an error if processing this command requires waiting for Oracle Clusterware to unlock the resource or its dependents. Sometimes, Oracle Clusterware locks resources or other objects to prevent commands from interfering with each other.
-f Use the -f option when:
The resource has a hard dependency on a non-existing resource
The owner of the resource does not have execute permissions on one or more hard dependencies
The modification results in servers being moved into the Generic pool and resources being stopped or relocated to accomplish the server move
-delete If you specify the -delete option, then Oracle Clusterware deletes the named attribute.
下面是在11.2.0.3上删除和添加diskgroup ora.RECO.dg的例子:
主要用到的命令:
su - grid
1. 停止依赖于磁盘组ora.RECO.dg的所有数据库:
$ srvctl stop database -d <db_name>
2. 查看ora.RECO.dg的配置信息:
-bash-3.00$ crsctl stat res ora.RECO.dg -p
NAME=ora.RECO.dg
TYPE=ora.diskgroup.type
ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r-- <===这个信息在添加资源的使用需要
...
VERSION=11.2.0.3.0
3. 停止ora.RECO.dg:
-bash-3.00$ crsctl stop res ora.RECO.dg -f
4. 从集群中移除ora.RECO.dg:
-bash-3.00$ crsctl delete res ora.RECO.dg -f
5. 将ora.RECO.dg添加到集群中:
-bash-3.00$ crsctl add res ora.RECO.dg -type ora.diskgroup.type -attr "ACL='owner:grid:rwx,pgrp:oinstall:rwx,other::r-
-',AUTO_START=always,VERSION=11.2.0.3.0" -i
6. 检查资源的配置信息是正确的:
-bash-3.00$ crsctl stat res ora.RECO.dg -p
7. 将这个资源启动:
-bash-3.00$ crsctl start res ora.RECO.dg
-bash-3.00$ crsctl stat res -t
8. 启动所有依赖于这个磁盘组的数据库:
$ srvctl start database -d <db_name>
具体的测试过程及输出:
su - grid
1. 停止依赖于磁盘组ora.RECO.dg的所有数据库:
$ srvctl stop database -d RAC11G2
2. 查看ora.RECO.dg的配置信息:
-bash-3.00$ crsctl stat res ora.RECO.dg -p
NAME=ora.RECO.dg
TYPE=ora.diskgroup.type
ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALIAS_NAME=
AUTO_START=always
CHECK_INTERVAL=300
CHECK_TIMEOUT=30
DEFAULT_TEMPLATE=
DEGREE=1
DESCRIPTION=CRS resource type definition for ASM disk group resource
ENABLED=1
LOAD=1
LOGGING_LEVEL=1
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=60
START_DEPENDENCIES=hard(ora.asm) pullup(ora.asm)
START_TIMEOUT=900
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=hard(intermediate:ora.asm)
STOP_TIMEOUT=180
TYPE_VERSION=1.2
UPTIME_THRESHOLD=1d
USR_ORA_ENV=
USR_ORA_OPI=false
USR_ORA_STOP_MODE=
VERSION=11.2.0.3.0
3. 停止ora.RECO.dg:
-bash-3.00$ crsctl stop res ora.RECO.dg -f
CRS-2673: Attempting to stop 'ora.RECO.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.RECO.dg' on 'rac1'
CRS-2677: Stop of 'ora.RECO.dg' on 'rac2' succeeded
CRS-2677: Stop of 'ora.RECO.dg' on 'rac1' succeeded
4. 从集群中移除ora.RECO.dg:
-bash-3.00$ crsctl delete res ora.RECO.dg <==如果有不加-f, 当有资源依赖于这个磁盘组时会报错
CRS-2730: Resource 'ora.rac11g2.db' depends on resource 'ora.RECO.dg'
CRS-4000: Command Delete failed, or completed with errors.
-bash-3.00$ crsctl delete res ora.RECO.dg -f <=====需要使用-f来强制删除
5. 将ora.RECO.dg添加到集群中:
-bash-3.00$ crsctl add res ora.RECO.dg -type ora.diskgroup.type -attr "ACL='owner:grid:rwx,pgrp:oinstall:rwx,other::r-
-',AUTO_START=always,VERSION=11.2.0.3.0" -i
6. 检查资源的配置信息是正确的:
-bash-3.00$ crsctl stat res ora.RECO.dg -p
NAME=ora.RECO.dg
TYPE=ora.diskgroup.type
ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALIAS_NAME=
AUTO_START=always
CHECK_INTERVAL=300
CHECK_TIMEOUT=30
DEFAULT_TEMPLATE=
DEGREE=1
DESCRIPTION=CRS resource type definition for ASM disk group resource
ENABLED=1
LOAD=1
LOGGING_LEVEL=1
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=5
SCRIPT_TIMEOUT=60
START_DEPENDENCIES=hard(ora.asm) pullup(ora.asm)
START_TIMEOUT=900
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=hard(intermediate:ora.asm)
STOP_TIMEOUT=180
TYPE_VERSION=1.2
UPTIME_THRESHOLD=1d
USR_ORA_ENV=
USR_ORA_OPI=false
USR_ORA_STOP_MODE=
VERSION=11.2.0.3.0
7. 将这个资源启动:
-bash-3.00$ crsctl start res ora.RECO.dg
CRS-2672: Attempting to start 'ora.RECO.dg' on 'rac1'
CRS-2672: Attempting to start 'ora.RECO.dg' on 'rac2'
CRS-2676: Start of 'ora.RECO.dg' on 'rac1' succeeded
CRS-2676: Start of 'ora.RECO.dg' on 'rac2' succeeded
-bash-3.00$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS Local Resources
--------------------------------------------------------------------------------
ora.RECO.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
8.启动所有依赖于这个磁盘组的数据库:
$ srvctl start database -d RAC11G2
参与此主题的后续讨论,可以访问我们的中文社区,跟帖“如何在11.2集群中添加/删除资源?"。 |
|