参考Rename Diskgroup having OCR , Vote File , ASM SPILE (文档 ID 1335975.1)
目标:
Consider a 11.2 Grid Infrastructure with CLUSTER setup having OCR ,Vote File and ASM SPFILE on a diskgroup.
Under certain circumstances you may wish to rename that diskgroup.
"renamedg" utility can be used to rename of the diskgroup when the diskgroup is dismounted.
But since the diskgroup contains OCR and Vote File we need to use an intermediate diskgroup for storing OCR and Vote File temporarily while renaming the actual diskgroup.
更改条件说明:
-> Name of Temporary diskgroup is TEMP.
-> OCR,Voting Disks and ASM SPFILE are originally stored in a diskgroup DATA.
-> Diskgroup DATA should be renamed to CRS.
-> $ORACLE_HOME points to GRID Home.
-> Cluster is up and running in all nodes of RAC.
操作:
1 创建临时磁盘组:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
sqlplus '/as sysasm'
create diskgroup TEMP normal redundancy disk '/dev/asm11' ,'/dev/asm12' ,'/dev/asm13' attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0', 'au_size'='4M';
2 迁移
Move OCR and Vote file from DATA to
:
$ORACLE_HOME/bin/bin/ocrconfig -add +TEMP
$ORACLE_HOME/bin/bin/ocrconfig -delete +DATA
$ORACLE_HOME/bin/crsctl replace votedisk +TEMP
Successful addition of voting disk 9d351cfdbef64facbfe2d1519880ef33.
Successful addition of voting disk 302c23b19e864f92bfa68eda9045e5cc.
Successful addition of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b.
Successful deletion of voting disk 32f7d65cf17d4fa3bf2932998251635f.
Successful deletion of voting disk 10c31fb0891d4f5abfb38ef34cd49f4d.
Successful deletion of voting disk 7d6f7d6480554f01bfc2621a3adb8f5f.
Successfully replaced voting disk group with +TEMP.
CRS-4266: Voting file(s) successfully replaced
检查完整性
$ORACLE_HOME/bin/crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 9d351cfdbef64facbfe2d1519880ef33 (ORCL:DISK4) [TEMP]
2. ONLINE 302c23b19e864f92bfa68eda9045e5cc (ORCL:DISK5) [TEMP]
3. ONLINE 6eeca4920acb4f8fbf6ec5a4e2b8ea7b (ORCL:DATA4) [TEMP]
Located 3 voting disk(s).
$ORACLE_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2804
Available space (kbytes) : 259316
ID : 1778064925
Device/File Name : +TEMP
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
3 迁移spfile,从DATA迁移到TEMP diskgroup上
Change ASM SPFILE location from DATA to TEMP diskgroup.
sqlplus '/as sysasm'
create pfile='/tmp/init/init' from spfile;
create spfile='+TEMP' from pfile='/tmp/init/init';
Now GPNPTOOL will get updated with new ASM SPFILE location.
That can be verified by below command :
$ORACLE_HOME/bin/gpnptool get
4 2个节点重启crs
Restart CRS on all nodes to startup CRS using new SPFILE from TEMP diskgroup
crsctl stop crs
crsctl start crs
5 卸载OLD盘(即DATA盘)
Dismount the OLD Diskgroup on all cluster nodes
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
sqlplus '/as sysasm'
alter diskgroup data dismount;
6 重命名OLD盘(即重命名DATA盘为CRS盘)
Rename OLD diskgroup to NEW diskgroup name
renamedg phase=both dgname=DATA newdgname=CRS verbose=true
查询磁盘信息
set line 1000
set pages 599
col path format a30
select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk;
select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;
7 挂载CRS盘
Mount the renamed diskgroup on All the nodes
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:
sqlplus '/as sysasm'
alter diskgroup CRS mount;
查询磁盘信息
select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;
8 迁移OCR和vote file到新的磁盘CRS
Move OCR and Vote file from TEMP Diskgroup to CRS Diskgroup
$ORACLE_HOME/bin/ocrconfig -add +CRS
$ORACLE_HOME/bin/ocrconfig -delete +TEMP
$ORACLE_HOME/bin/crsctl replace votedisk +CRS
Successful addition of voting disk ae0f06430e724fb7bf3757a7cdf8a101.
Successful addition of voting disk 1b355413f5904f5abff181938191ed97.
Successful addition of voting disk a7f75c9872ac4f6fbf77bbcb10ea17a6.
Successful deletion of voting disk 9d351cfdbef64facbfe2d1519880ef33.
Successful deletion of voting disk 302c23b19e864f92bfa68eda9045e5cc.
Successful deletion of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b.
Successfully replaced voting disk group with +CRS.
CRS-4266: Voting file(s) successfully replaced
9 修改spfile 路径
Change ASM SPFILE location from TEMP to CRS Diskgroup:
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands
sqlplus '/as sysasm'
create spfile='+CRS' from pfile='/tmp/init/init';
10 2个节点重启crs
Restart CRS on all nodes to startup CRS using new SPFILE from TEMP diskgroup
crsctl stop crs
crsctl start crs
11 删掉临时的TEMP磁盘组
Drop the Intermediate Diskgroup TEMP
Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands::
drop diskgroup temp including contents;
NOTE: Diskgroup TEMP must be mounted in order to be able to drop it.You need to mount it (if it is not already mounted at CRS startup) and then run "drop diskgroup.."
12 删除磁盘的信息
Need to Remove the Diskgroup Resources TEMP and from Oracle Clusterware
srvctl remove diskgroup -g DATA
srvctl remove diskgroup -g TEMP
13 验证信息
Ensure ALL Cluster resources are started successfully using below sample commands
$ORACLE_HOME/bin/crsctl stat res -init -t
$ORACLE_HOME/bin/crsctl check cluster -all
$ORACLE_HOME/bin/crsctl stat res -t
当前题目:Oracle11gracOCR磁盘组重命名(创建时OCR磁盘组命名错误之后的纠正方案)
网页URL:http://cqcxhl.com/article/jgsgis.html