Oracle 12c RAC 替换 OCR 磁盘组操作步骤

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1312

1 替换OCR 和 Voting disk[p=35, null, left][color=#555555]--替换VOTEDISK[p=35, null, left][color=#555555][root@rac1 ~]# crsctl query css votedisk[p=35, null, left][color=#555555]## STATE File Universal Id File Name Disk group[p=35, null, left][color=#555555]-- ----- ----------------- --------- ---------[p=35, null, left][color=#555555] 1.ONLINE f56b0e0be76b4f03bf4782230c783e67(/dev/asm-diskb) [OCR_VOTING][p=35, null, left][color=#555555]Located 1 voting disk(s).
[p=35, null, left][color=#555555][root@rac1 ~]# crsctl replace votedisk +OCR[p=35, null, left][color=#555555]Successful addition of voting disk2aa04b8a77d84fcbbfd272ad2b665bcc.[p=35, null, left][color=#555555]Successful addition of voting disk7dd098bc01ec4fcebfc8f3e2f12f11b7.[p=35, null, left][color=#555555]Successful addition of voting diskd0b8ab3340ed4f6dbfa087f8f4a59c49.[p=35, null, left][color=#555555]Successful deletion of voting diskf56b0e0be76b4f03bf4782230c783e67.[p=35, null, left][color=#555555]Successfully replaced voting disk groupwith +OCR.[p=35, null, left][color=#555555]CRS-4266: Voting file(s) successfullyreplaced
[p=35, null, left][color=#555555][root@rac1 ~]# crsctl query css votedisk[p=35, null, left][color=#555555]## STATE File Universal Id File Name Disk group[p=35, null, left][color=#555555]-- ----- ----------------- --------- ---------[p=35, null, left][color=#555555] 1.ONLINE 2aa04b8a77d84fcbbfd272ad2b665bcc(/dev/asm-diskf) [OCR][p=35, null, left][color=#555555] 2.ONLINE 7dd098bc01ec4fcebfc8f3e2f12f11b7(/dev/asm-diskg) [OCR][p=35, null, left][color=#555555] 3.ONLINE d0b8ab3340ed4f6dbfa087f8f4a59c49(/dev/asm-diskh) [OCR][p=35, null, left][color=#555555]Located 3 voting disk(s).[p=35, null, left][color=#555555][root@rac1 ~]#

[p=35, null, left][color=#555555][grid@rac1 rac1]$ crsctl stat res -t[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Name Target State Server Statedetails [p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Local Resources[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]ora.ASMNET1LSNR_ASM.lsnr[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.DATA.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.LISTENER.lsnr[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.OCR.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.OCR_VOTING.dg[p=35, null, left][color=#555555] OFFLINE OFFLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.net1.network[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.ons[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.proxy_advm[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Cluster Resources[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]ora.LISTENER_SCAN1.lsnr[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]ora.MGMTLSNR[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 169.254.193.105192.[p=35, null, left][color=#555555] 168.57.5,STABLE[p=35, null, left][color=#555555]ora.asm[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] 2 ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555] 3 OFFLINE OFFLINE STABLE[p=35, null, left][color=#555555]ora.cndba.db[p=35, null, left][color=#555555] 1 ONLINE OFFLINE STABLE[p=35, null, left][color=#555555] 2 OFFLINE OFFLINE CorruptedControlfil[p=35, null, left][color=#555555] e,STABLE[p=35, null, left][color=#555555]ora.cvu[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]ora.mgmtdb[p=35, null, left][color=#555555] 1 ONLINE OFFLINE STABLE[p=35, null, left][color=#555555]ora.oc4j[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]ora.rac1.vip[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]ora.rac2.vip[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.scan1.vip[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555][grid@rac1 rac1]$
[p=35, null, left][color=#555555]SQL> alter diskgroup ocr_voting dismount;[p=35, null, left][color=#555555]alter diskgroup ocr_voting dismount[p=35, null, left][color=#555555]*[p=35, null, left][color=#555555]ERROR at line 1:[p=35, null, left][color=#555555]ORA-15032: not all alterations performed[p=35, null, left][color=#555555]ORA-15027: active use of diskgroup"OCR_VOTING" precludes its dismount
[p=35, null, left][color=#555555]磁盘组正在被使用,使用md_backup 命令备份一下OCR,这里主要是查看这个磁盘组上有哪些文件,然后逐一转移走。
[p=35, null, left][color=#555555][grid@rac1 ~]$ asmcmd md_backup/tmp/ocr_back -G OCR_VOTING[p=35, null, left][color=#555555]Disk group metadata to be backed up:OCR_VOTING[p=35, null, left][color=#555555]Current alias directory path:rac-scan/ASMPARAMETERFILE[p=35, null, left][color=#555555]Current alias directory path: ASM[p=35, null, left][color=#555555]Current alias directory path:CNDBA/CONTROLFILE[p=35, null, left][color=#555555]Current alias directory path: ASM/PASSWORD[p=35, null, left][color=#555555]Current alias directory path: rac-scan[p=35, null, left][color=#555555]Current alias directory path: CNDBA[p=35, null, left][color=#555555]Current alias directory path:rac-scan/OCRFILE

2 更改控制文件位置[p=35, null, left][color=#555555]--查看当前控制文件位置[p=35, null, left][color=#555555]SQL> select name from v$controlfile;
[p=35, null, left][color=#555555]NAME[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]+DATA/CNDBA/CONTROLFILE/current.261.854948915[p=35, null, left][color=#555555]+OCR_VOTING/CNDBA/CONTROLFILE/current.268.854948917

[p=35, null, left][color=#555555]--修改控制文件参数:[p=35, null, left][color=#555555]SQL> alter system set control_files ='+DATA/CNDBA/CONTROLFILE/control01.ctl','+DATA/CNDBA/CONTROLFILE/control02.ctl','+DATA/CNDBA/CONTROLFILE/control03.ctl'scope=spfile sid='*';
[p=35, null, left][color=#555555]System altered.
[p=35, null, left][color=#555555]这里注意,Oracle ASM 中的文件是由OMF 管理的,所以我们不能和之前查询的一样,执行稳定的ID,我们这里只能指定别名,然后OMF 会自动产生一个文件与别名对应,这里我们等会在验证。 继续下一步。
[p=35, null, left][color=#555555][grid@rac1 rac1]$ srvctl stop database -dcndba
[p=35, null, left][color=#555555][grid@rac1 rac1]$ crsctl stat res -t[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Name Target State Server Statedetails [p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Local Resources[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]ora.ASMNET1LSNR_ASM.lsnr[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.DATA.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.LISTENER.lsnr[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.OCR.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.OCR_VOTING.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]……[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Cluster Resources[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]ora.LISTENER_SCAN1.lsnr[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]ora.MGMTLSNR[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 169.254.193.105192.[p=35, null, left][color=#555555] 168.57.5,STABLE[p=35, null, left][color=#555555]ora.asm[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] 2 ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555] 3 OFFLINE OFFLINE STABLE[p=35, null, left][color=#555555]ora.cndba.db[p=35, null, left][color=#555555] 1 OFFLINE OFFLINE InstanceShutdown,ST[p=35, null, left][color=#555555] ABLE[p=35, null, left][color=#555555] 2 OFFLINE OFFLINE InstanceShutdown,ST[p=35, null, left][color=#555555] ABLE[p=35, null, left][color=#555555]……[p=35, null, left][color=#555555][grid@rac1 rac1]$

[p=35, null, left][color=#555555]--移动控制文件位置[p=35, null, left][color=#555555]ASMCMD> pwd[p=35, null, left][color=#555555]+ocr_voting/cndba/controlfile[p=35, null, left][color=#555555]ASMCMD> ls[p=35, null, left][color=#555555]Current.268.854948917
[p=35, null, left][color=#555555]ASMCMD> pwd[p=35, null, left][color=#555555]+ocr_voting/cndba/controlfile[p=35, null, left][color=#555555]ASMCMD> ls[p=35, null, left][color=#555555]Current.268.854948917[p=35, null, left][color=#555555]ASMCMD> cp Current.268.854948917 +DATA/CNDBA/CONTROLFILE/control01.ctl[p=35, null, left][color=#555555]copying+ocr_voting/cndba/controlfile/Current.268.854948917 ->+DATA/CNDBA/CONTROLFILE/control01.ctl[p=35, null, left][color=#555555]ASMCMD> cp Current.268.854948917+DATA/CNDBA/CONTROLFILE/control02.ctl[p=35, null, left][color=#555555]copying+ocr_voting/cndba/controlfile/Current.268.854948917 ->+DATA/CNDBA/CONTROLFILE/control02.ctl[p=35, null, left][color=#555555]ASMCMD> cp Current.268.854948917+DATA/CNDBA/CONTROLFILE/control03.ctl[p=35, null, left][color=#555555]copying+ocr_voting/cndba/controlfile/Current.268.854948917 ->+DATA/CNDBA/CONTROLFILE/control03.ctl[p=35, null, left][color=#555555]ASMCMD>

[p=35, null, left][color=#555555]--启动[color=rgb(223, 52, 52)]数据库并查看:[p=35, null, left][color=#555555][grid@rac1 rac1]$ srvctl start database -dcndba
[p=35, null, left][color=#555555][grid@rac1 rac1]$ crsctl stat res -t[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Name Target State Server Statedetails [p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Local Resources[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]ora.ASMNET1LSNR_ASM.lsnr[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.DATA.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.LISTENER.lsnr[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.OCR.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]ora.OCR_VOTING.dg[p=35, null, left][color=#555555] ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555]……[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]Cluster Resources[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555]ora.LISTENER_SCAN1.lsnr[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555]ora.MGMTLSNR[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 169.254.193.105 192.[p=35, null, left][color=#555555] 168.57.5,STABLE[p=35, null, left][color=#555555]ora.asm[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 STABLE[p=35, null, left][color=#555555] 2 ONLINE ONLINE rac2 STABLE[p=35, null, left][color=#555555] 3 OFFLINE OFFLINE STABLE[p=35, null, left][color=#555555]ora.cndba.db[p=35, null, left][color=#555555] 1 ONLINE ONLINE rac1 Open,STABLE[p=35, null, left][color=#555555] 2 ONLINE ONLINE rac2 Open,STABLE[p=35, null, left][color=#555555]……[p=35, null, left][color=#555555]--------------------------------------------------------------------------------[p=35, null, left][color=#555555][grid@rac1 rac1]$

[p=35, null, left][color=#555555]ASMCMD> pwd[p=35, null, left][color=#555555]+data/cndba/controlfile[p=35, null, left][color=#555555]ASMCMD> ls -l[p=35, null, left][color=#555555]Type Redund Striped Time Sys Name[p=35, null, left][color=#555555]CONTROLFILE UNPROT FINE DEC 08 11:00:00 Y Current.261.854948915[p=35, null, left][color=#555555]CONTROLFILE UNPROT FINE DEC 08 12:00:00 N control01.ctl => +DATA/ASM/CONTROLFILE/control01.ctl.276.865771415[p=35, null, left][color=#555555]CONTROLFILE UNPROT FINE DEC 08 12:00:00 N control02.ctl => +DATA/ASM/CONTROLFILE/control02.ctl.277.865771425[p=35, null, left][color=#555555]CONTROLFILE UNPROT FINE DEC 08 12:00:00 N control03.ctl => +DATA/ASM/CONTROLFILE/control03.ctl.278.865771431[p=35, null, left][color=#555555]ASMCMD>
[p=35, null, left][color=#555555]--drop 还是报错,继续处理:[p=35, null, left][color=#555555]SQL> drop diskgroup ocr_voting includingcontents;[p=35, null, left][color=#555555]drop diskgroup ocr_voting includingcontents[p=35, null, left][color=#555555]*[p=35, null, left][color=#555555]ERROR at line 1:[p=35, null, left][color=#555555]ORA-15039: diskgroup not dropped[p=35, null, left][color=#555555]ORA-15027: active use of diskgroup"OCR_VOTING" precludes its dismount
3 更改ASM中密码文件位置
[p=35, null, left][color=#555555]ASMCMD> showversion[p=35, null, left][color=#555555]ASM version : 12.1.0.1.0[p=35, null, left][color=#555555]ASMCMD> pwd[p=35, null, left][color=#555555]+ocr_voting[p=35, null, left][color=#555555]ASMCMD> ls -l [p=35, null, left][color=#555555]Type Redund Striped Time Sys Name[p=35, null, left][color=#555555] Y ASM/[p=35, null, left][color=#555555] Y CNDBA/[p=35, null, left][color=#555555] Y _MGMTDB/[p=35, null, left][color=#555555]PASSWORD UNPROT COARSE AUG 07 02:00:00 N orapwasm => +OCR_VOTING/ASM/PASSWORD/pwdasm.256.854938127[p=35, null, left][color=#555555] Y rac-scan/[p=35, null, left][color=#555555]ASMCMD>
[p=35, null, left][color=#555555]我们这里直接在新的磁盘组里创建一个:[p=35, null, left][color=#555555][grid@rac1 rac1]$ orapwdfile='+ocr/orapwasm' asm=y
[p=35, null, left][color=#555555]Enter password for SYS:[p=35, null, left][color=#555555][grid@rac1 rac1]$
[p=35, null, left][color=#555555]--验证:[p=35, null, left][color=#555555][grid@rac1 ~]$ srvctl config asm[p=35, null, left][color=#555555]ASM home: /u01/gridsoft/12.1.0[p=35, null, left][color=#555555]Password file: +OCR/orapwasm[p=35, null, left][color=#555555]ASM listener: LISTENER[p=35, null, left][color=#555555]ASM instance count: 3[p=35, null, left][color=#555555]Cluster ASM listener: ASMNET1LSNR_ASM[p=35, null, left][color=#555555][grid@rac1 ~]$
4 修改online redo log 位置[p=35, null, left][color=#555555]进入asmcmd 看,还有onlineredo log 文件,继续转移。
[p=35, null, left][color=#555555]SQL> select group#,thread#,blocksizefrom v$log;
[p=35, null, left][color=#555555] GROUP# THREAD# BLOCKSIZE[p=35, null, left][color=#555555]---------- ---------- ----------[p=35, null, left][color=#555555] 1 1 512[p=35, null, left][color=#555555] 2 1 512[p=35, null, left][color=#555555] 3 2 512[p=35, null, left][color=#555555] 4 2 512
[p=35, null, left][color=#555555]SQL> ALTER DATABASE ADD LOGFILE THREAD 1group 7 '+DATA' size 200M;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> ALTER DATABASE ADD LOGFILE THREAD 1group 6 '+DATA' size 200M;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> ALTER DATABASE ADD LOGFILE THREAD 1group 5 '+DATA' size 200M;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> ALTER DATABASE ADD LOGFILE THREAD 2group 8 '+DATA' size 200M;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> ALTER DATABASE ADD LOGFILE THREAD 2group 9 '+DATA' size 200M;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> ALTER DATABASE ADD LOGFILE THREAD 2group 10 '+DATA' size 200M;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> [color=#c89cf]]alter databasedrop logfile group1;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> alter database drop logfile group4;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> alter system switch logfile;
[p=35, null, left][color=#555555]System altered.
[p=35, null, left][color=#555555]SQL> alter database drop logfile group3;[p=35, null, left][color=#555555]alter database drop logfile group 3[p=35, null, left][color=#555555]*[p=35, null, left][color=#555555]ERROR at line 1:[p=35, null, left][color=#555555]ORA-01624: log 3 needed for crash recoveryof instance cndba2 (thread 2)[p=35, null, left][color=#555555]ORA-00312: online log 3 thread 2:'+DATA/CNDBA/ONLINELOG/group_3.269.854950325'[p=35, null, left][color=#555555]ORA-00312: online log 3 thread 2:[p=35, null, left][color=#555555]'+OCR_VOTING/CNDBA/ONLINELOG/group_3.271.854950331'
[p=35, null, left][color=#555555]--测试库,不等了,直接unarchive:[p=35, null, left][color=#555555]SQL> alter database clear unarchivedlogfile group 3;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> alter database clear unarchivedlogfile group 2;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> alter database drop logfile group2;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> alter database drop logfile group3;[p=35, null, left][color=#555555]Database altered.
[p=35, null, left][color=#555555]SQL> select group#,thread#,blocksize from v$log;
[p=35, null, left][color=#555555] GROUP# THREAD# BLOCKSIZE[p=35, null, left][color=#555555]---------- ---------- ----------[p=35, null, left][color=#555555] 5 1 512[p=35, null, left][color=#555555] 6 1 512[p=35, null, left][color=#555555] 7 1 512[p=35, null, left][color=#555555] 8 2 512[p=35, null, left][color=#555555] 9 2 512[p=35, null, left][color=#555555] 10 2 512
[p=35, null, left][color=#555555]6 rows selected.
5 修改asm spfile位置
[p=35, null, left][color=#555555]--查看当前位置:[p=35, null, left][color=#555555][grid@rac1 grid]$ gpnptool get -o-[p=35, null, left][color=#555555]……[p=35, null, left][color=#555555][p=35, null, left][color=#555555]……[p=35, null, left][color=#555555]Success.[p=35, null, left][color=#555555][grid@rac1 grid]$
[p=35, null, left][color=#555555]--修改:[p=35, null, left][color=#555555][grid@rac1 /]$ sqlplus / as sysasm
[p=35, null, left][color=#555555]SQL*Plus: Release 12.1.0.1.0 Production onTue Dec 9 12:37:03 2014
[p=35, null, left][color=#555555]Copyright (c) 1982, 2013, Oracle. All rights reserved.

[p=35, null, left][color=#555555]Connected to:[p=35, null, left][color=#555555]Oracle Database 12c Enterprise EditionRelease 12.1.0.1.0 - 64bit Production[p=35, null, left][color=#555555]With the Real Application Clusters andAutomatic Storage Management options
[p=35, null, left][color=#555555]SQL> create pfile='/tmp/pfile.asm' fromspfile;[p=35, null, left][color=#555555]File created.
[p=35, null, left][color=#555555]SQL> create spfile='+OCR' FROMPFILE='/tmp/pfile.asm';[p=35, null, left][color=#555555]File created.[p=35, null, left][color=#555555] [p=35, null, left][color=#555555]--检查:[p=35, null, left][color=#555555][grid@rac1 grid]$ gpnptool get -o-[p=35, null, left][color=#555555]……[p=35, null, left][color=#555555][p=35, null, left][color=#555555]……[p=35, null, left][color=#555555]Success.[p=35, null, left][color=#555555][grid@rac1 grid]$
[p=35, null, left][color=#555555]这里修改成功。
[p=35, null, left][color=#555555]但是查看还是旧目录:[p=35, null, left][color=#555555]SQL> show parameter spfile
[p=35, null, left][color=#555555]NAME TYPE VALUE[p=35, null, left][color=#555555]------------------------------------ -----------------------------------------[p=35, null, left][color=#555555]spfile string +OCR_VOTING/rac-scan/ASMPARAME[p=35, null, left][color=#555555] TERFILE/registry.253.854938125
[p=35, null, left][color=#555555]重启ASM实例,让修改生效:
[p=35, null, left][color=#555555]SQL> shutdown immediate[p=35, null, left][color=#555555]ASM diskgroups dismounted[p=35, null, left][color=#555555]ASM instance shutdown[p=35, null, left][color=#555555]SQL> startup[p=35, null, left][color=#555555]ASM instance started
[p=35, null, left][color=#555555]Total System Global Area 1135747072 bytes[p=35, null, left][color=#555555]Fixed Size 2297344 bytes[p=35, null, left][color=#555555]Variable Size 1108283904 bytes[p=35, null, left][color=#555555]ASM Cache 25165824 bytes[p=35, null, left][color=#555555]ASM diskgroups mounted
[p=35, null, left][color=#555555]SQL> show parameter spfile
[p=35, null, left][color=#555555]NAME TYPE VALUE[p=35, null, left][color=#555555]------------------------------------ -----------------------------------------[p=35, null, left][color=#555555]spfile string +OCR/rac-scan/ASMPARAMETERFILE[p=35, null, left][color=#555555] /registry.253.865859837[p=35, null, left][color=#555555]SQL>
[p=35, null, left][color=#555555]以上是在节点1操作的,在节点2 同样也需要重启ASM。
[p=35, null, left][color=#555555]注意:在11g以后,重启ASM,整个节点的CRS 也就挂了。[p=35, null, left][color=#555555][root@rac2 ~]# crs_stat -t[p=35, null, left][color=#555555]CRS-0184: Cannot communicate with the CRSdaemon.
[p=35, null, left][color=#555555]所以改操作只能一个节点依次操作。
6 转移MGMTDB 数据文件[p=35, null, left][color=#555555]在Oracle 12c中,默认情况下,MGMTDB 实例的数据文件也是存放在OCR 磁盘组的,所以我们在drop 之前,必须先转移走对应的数据文件。 这里的具体操作,另篇blog 在说明。
7 drop 旧磁盘组
[p=35, null, left][color=#555555]--在节点2 dismount 磁盘组:[p=35, null, left][color=#555555]SQL> alter diskgroup ocr_votingdismount;[p=35, null, left][color=#555555]Diskgroup altered.
[p=35, null, left][color=#555555]--节点1 上drop:[p=35, null, left][color=#555555]SQL> drop diskgroup ocr_voting includingcontents;[p=35, null, left][color=#555555]Diskgroup dropped.

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】