分享更有价值
被信任是一种快乐

oracle磁盘组改名字的方法

文章页正文上

这篇文章主要介绍“oracle磁盘组改名字的方法”,在日常操作中,相信很多人在oracle磁盘组改名字的方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”oracle磁盘组改名字的方法”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!oracle 磁盘组改名字创建磁盘组的时候不小心把OCR磁盘组的名字起错了,下面模拟如何给ocr磁盘组改名字参考文档 (文档 ID 1335975.1)测试环境操作系统版本 redhat 6.4数据库版本 11203现在OCR存放在vote磁盘组,现在将VOTE磁盘组名字修改为OCRDG磁盘组,操作时需要有一个磁盘组做中转磁盘组可以是一块次哦按外部冗余也可以1.查看集群状态[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl stat res -t——————————————————————————–NAME TARGET STATE SERVER STATE_DETAILS ——————————————————————————–Local Resources——————————————————————————–ora.ARC.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATADG01.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATADG02.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE OFFLINE rac1 ONLINE ONLINE rac2 ora.VOTE.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started ora.gsd OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2 ora.net1.network ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.ons ONLINE ONLINE rac1 ONLINE ONLINE rac2 ——————————————————————————–Cluster Resources——————————————————————————–ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 ora.cvu 1 ONLINE ONLINE rac2 ora.oc4j 1 ONLINE ONLINE rac1 ora.orcl.db 1 ONLINE ONLINE rac1 Open 2 ONLINE ONLINE rac2 Open ora.rac1.vip 1 ONLINE ONLINE rac1 ora.rac2.vip 1 ONLINE ONLINE rac2 ora.scan1.vip 1 ONLINE ONLINE rac2 2.查看ocr的备份,和手工备份,紧急情况下没有ocr的备份也不要紧,在$CRS_HOME的cdata目录下有ocr的自动备份,默认每天和每周都会保存的,只要没做过架构变更,都一直可用。[root@rac1 cdata]# pwd/oracle/app/grid/11.2.0/cdata[root@rac1 cdata]# ls -lrt总用量 2852drwxr-xr-x 2 grid oinstall 4096 1月 17 2016 localhostdrwxr-xr-x 2 grid oinstall 4096 1月 17 2016 rac1-rw——- 1 root oinstall 272756736 9月 5 07:36 rac1.olrdrwxrwxr-x 2 grid oinstall 4096 9月 5 07:37 rac-cluster查看ocr磁盘组的未知和votingdisk的位置。[root@rac1 cdata]# /oracle/app/grid/11.2.0/bin/ocrcheckStatus of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2904 Available space (kbytes) : 259216 ID : 635069277 Device/File Name : +VOTE 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[root@rac1 cdata]# /oracle/app/grid/11.2.0/bin/crsctl query css votedisk## STATE File Universal Id File Name Disk group– —– —————– ——— ———1. ONLINE 956b16ceaff14f4ebf37414725a67350 (/dev/asm-diskb) [VOTE]2. ONLINE adb3a38f36514f2bbfcaa798303df4a1 (/dev/asm-diskc) [VOTE]3. ONLINE aa9bfeef2ddd4f01bf212f8e020cd040 (/dev/asm-diskd) [VOTE]查看OCR备份的位置和情况查看自动备份:ocrconfig -showbackup auto查看手工备份:ocrconfig -showbackup manual显示的备份全是系统自动备份ocr的备份,最下面的PROT-25提示没有手动的备份[root@rac1 cdata]# /oracle/app/grid/11.2.0/bin/ocrconfig -showbackuprac1 2019/09/05 07:37:35 /oracle/app/grid/11.2.0/cdata/rac-cluster/backup00.ocrrac1 2019/09/05 03:37:34 /oracle/app/grid/11.2.0/cdata/rac-cluster/backup01.ocrrac1 2019/09/04 16:44:33 /oracle/app/grid/11.2.0/cdata/rac-cluster/backup02.ocrrac1 2019/09/04 16:44:33 /oracle/app/grid/11.2.0/cdata/rac-cluster/day.ocrrac1 2019/09/04 16:44:33 /oracle/app/grid/11.2.0/cdata/rac-cluster/week.ocrPROT-25: Manual backups for the Oracle Cluster Registry are not availablesu – gridsqlplus / as sysasmSQL> set line 200 pages 999SQL> col path for a40SQL> col name for a40SQL> select group_number,path,header_status,total_mb/1024 total_GB,free_mb/1024 free_GB,state from v$asm_disk order by 2;GROUP_NUMBER PATH HEADER_STATU TOTAL_GB FREE_GB STATE———— —————————————- ———— ———- ———- ——– 1 /dev/asm-diskb MEMBER 1 .69921875 NORMAL 1 /dev/asm-diskc MEMBER 1 .69921875 NORMAL 1 /dev/asm-diskd MEMBER 1 .69921875 NORMAL 3 /dev/asm-diske MEMBER 5 2.4296875 NORMAL 4 /dev/asm-diskf MEMBER 5 4.90722656 NORMAL 2 /dev/asm-diskg MEMBER 5 4.23242188 NORMAL3. 替换ocr,用ARC磁盘组作为临时OCR磁盘组(ARC以前事归档的磁盘组只有1个盘外部冗余,大小5G) root执行[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrconfig -add +ARC[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrconfig -delete +VOTE[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl replace votedisk +ARCSuccessful addition of voting disk a1133130973b4f80bfc9a6d917eee626.Successful deletion of voti免费主机域名ng disk 6b91880919e64fe3bfc01701f29256d1.Successful deletion of voting disk 2a0eef6d3ee64f10bfa2040621cef851.Successful deletion of voting disk a063e70967dd4fdcbf3b32e675c3246a.Successfully replaced voting disk group with +ARC.CRS-4266: Voting file(s) successfully replaced查看替换是否成功,和新的OCR的位置[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrcheckStatus of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2892 Available space (kbytes) : 259228 ID : 1965781783 Device/File Name : +ARC 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[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl query css votedisk## STATE File Universal Id File Name Disk group– —– —————– ——— ———1. ONLINE a1133130973b4f80bfc9a6d917eee626 (/dev/asm-diskg) [ARC]4. 迁移ASM的spfile,从VOTE迁移到ARC diskgroup上[root@rac1 cdata]# su – grid[grid@rac1 ~]$ asmcmdASMCMD> spget+VOTE/rac-cluster/asmparameterfile/registry.253.901344197sqlplus /as sysasmcreate pfile=’/home/grid/initasm.ora’ from spfile;create spfile=’+ARC’ from pfile=’/home/grid/initasm.ora’;$ORACLE_HOME/bin/gpnptool get5.重启2个节点的集群# /oracle/app/grid/11.2.0/bin/crsctl stop crs# /oracle/app/grid/11.2.0/bin/crsctl start crs6.卸载原来的VOTE磁盘组,如果磁盘组没有mount就直接跳过执行下一步# su – grid$ sqlplus / as sysasm> alter diskgorup VOTE dismount;7.重命名磁盘组原命令[grid@test ~]$ renamedg phase=both dgname=DATA newdgname=CRS asm_diskstring=’‘ verbose=truegrid用户执行命令[grid@rac1 ~]$ renamedg phase=both dgname=VOTE newdgname=OCRDG asm_diskstring=’/dev/asm*’ verbose=trueNOTE: No asm libraries found in the systemParsing parameters..Parameters in effect: Old DG name : VOTE New DG name : OCRDG Phases : Phase 1 Phase 2 Discovery str : /dev/asm* Clean : TRUE Raw only : TRUErenamedg operation: phase=both dgname=VOTE newdgname=OCRDG asm_diskstring=/dev/asm* verbose=trueExecuting phase 1Discovering the groupPerforming discovery with string:/dev/asm*Identified disk UFS:/dev/asm-diskc with disk number:1 and timestamp (33088676 -1089116160)Identified disk UFS:/dev/asm-diskb with disk number:0 and timestamp (33088676 -1089116160)Identified disk UFS:/dev/asm-diskd with disk number:2 and timestamp (33088676 -1089116160)Checking for hearbeat…Re-discovering the groupPerforming discovery with string:/dev/asm*Identified disk UFS:/dev/asm-diskc with disk number:1 and timestamp (33088676 -1089116160)Identified disk UFS:/dev/asm-diskb with disk number:0 and timestamp (33088676 -1089116160)Identified disk UFS:/dev/asm-diskd with disk number:2 and timestamp (33088676 -1089116160)Checking if the diskgroup is mounted or used by CSSChecking disk number:1Checking disk number:0Checking disk number:2Generating configuration file..Completed phase 1Executing phase 2Looking for /dev/asm-diskcModifying the headerLooking for /dev/asm-diskbModifying the headerLooking for /dev/asm-diskdModifying the headerCompleted phase 2Terminating kgfd context 0x7f5dc77880a08.查询磁盘信息SQL> set line 1000SQL> set pages 599SQL> col path format a30SQL> select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk;NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB—————————— —————————— ———— ———— ———- ———- /dev/asm-diskc 0 MEMBER 0 0 /dev/asm-diskd 0 MEMBER 0 0 /dev/asm-diskb 0 MEMBER 0 0DATADG01_0000 /dev/asm-diske 2 MEMBER 5120 2488DATADG02_0000 /dev/asm-diskf 3 MEMBER 5120 5025ARC_0000 /dev/asm-diskg 1 MEMBER 5120 40116 rows selected.SQL> select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB—————————— ———– ————– ———- ———- ———————–ARC MOUNTED 4011 5120 4011 0DATADG01 MOUNTED 2488 5120 2488 0DATADG02 MOUNTED 5025 5120 5025 0OCRDG DISMOUNTED 0 0 0 09.挂载新命名的OCRDG磁盘组alter diskgorup OCRDG mount;10 迁移OCR和vote file到新的磁盘CRS[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrconfig -add +OCRDG[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/ocrconfig -delete +ARC[root@rac1 ~]# /oracle/app/grid/11.2.0/bin/crsctl replace votedisk +OCRDGSuccessful addition of voting disk a109d7db3f9b4f92bf31f0496ccce75e.Successful addition of voting disk 7423098d541f4f77bfc41c7672180af9.Successful addition of voting disk b0a02397b8604f18bfca5319d03f9116.Successful deletion of voting disk a1133130973b4f80bfc9a6d917eee626.Successfully replaced voting免费主机域名 disk group with +OCRDG.CRS-4266: Voting file(s) successfully replaced11.修改SPFILE路径[root@rac1 ~]# su – grid[grid@rac1 ~]$ sqlplus / as sysasmSQL> create spfile=’+OCRDG’ from pfile=’/home/grid/initasm.ora’;File created.12.重启2个节点的集群crsctl stop crscrsctl start crs13.如果需要删除临时的磁盘组,执行删除命令drop diskgroup xxxxxx including contents;14.更新集群信息,因为原来集群中记录的VOTE磁盘组名字改成了OCRDG,[grid@rac1 ~]$ crsctl stat res -t——————————————————————————–NAME TARGET STATE SERVER STATE_DETAILS ——————————————————————————–Local Resources——————————————————————————–ora.ARC.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATADG01.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATADG02.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.OCRDG.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.VOTE.dg OFFLINE OFFLINE rac1 OFFLINE OFFLINE rac2[grid@rac1 ~]$ srvctl remove diskgroup -g VOTE15.验证集群信息,集群资源中没有了VOTE磁盘组[grid@rac1 ~]$ crsctl stat res -t——————————————————————————–NAME TARGET STATE SERVER STATE_DETAILS ——————————————————————————–Local Resources——————————————————————————–ora.ARC.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATADG01.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.DATADG02.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.LISTENER.lsnr ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.OCRDG.dg ONLINE ONLINE rac1 ONLINE ONLINE rac2 ora.asm ONLINE ONLINE rac1 Started ONLINE ONLINE rac2 Started 到此,关于“oracle磁盘组改名字的方法”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注云技术网站,小编会继续努力为大家带来更多实用的文章!

相关推荐: MySQL5.5源码安装报错”[ERROR] Can’t start server”怎么解决

这篇文章主要讲解了“MySQL5.5源码安装报错”[ERROR] Can’t start server”怎么解决”,文中的讲解内容简单清晰,易于免费主机域名学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“MySQL5.5源码安装报错”[ERRO…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册