Oracle 11g rac OCR磁盘组重命名(创建时OCR磁盘组命名错误之后的纠正方案)
发表于:2025-01-21 作者:千家信息网编辑
千家信息网最后更新 2025年01月21日,参考Rename Diskgroup having OCR , Vote File , ASM SPILE (文档 ID 1335975.1)目标:Consider a 11.2 Grid Infra
千家信息网最后更新 2025年01月21日Oracle 11g rac OCR磁盘组重命名(创建时OCR磁盘组命名错误之后的纠正方案)参考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
目标:
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
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
磁盘
信息
节点
查询
完整性
文档
条件
目标
路径
参考
检查
验证
方案
错误
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
义乌学习网络安全要怎么学
用什么软件开发越南客户
网络连接已断开服务器主动断开
青岛众志盈科网络技术
如何删除万象数据库
趣步类似软件开发需要多少钱
珠海教育软件开发外包
信息系统当中的数据库
什么是计算机的网络安全机制
vc是可视化编程软件开发
冬奥会网络安全公司
加强网络安全管理 经验
网络服务器连接
全州网络安全信息
北京大学商业养老保险数据库
网络安全的角度
易语言数据库登陆教程源码
美好生活互联网科技
浏览器代理服务器设置出错
登录我的世界网易大神服务器
搭建智能家居云服务器
国家服务器管理平台
网络安全管理系统报告
数据库钟数据的独立性是指
如何用代码建立数据库
服务器怎么验证客户端证书
南通技术管理软件开发
oracle数据库解释sql
旅游业网络技术的缺点
武汉定制软件开发机构