更改votingdisk和OCR到其他asm磁盘组

1.查看ocr和votedisk
[oracle:/home/oracle:RACTEST1] ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3104
Available space (kbytes) : 259016
ID : 44728649
Device/File Name : +OCR1
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 bypassed due to non-privileged user

[oracle:/home/oracle:RACTEST1] crsctl query css votedisk
*## STATE File Universal Id File Name Disk group


  1. ONLINE a5ef8885d1564f99bf0e0d77286c3b1f (/dev/oracleasm/disks/OCR11) [OCR1]
    Located 1 voting disk(s).

SQL> select GROUP_NUMBER,NAME,SECTOR_SIZE,ALLOCATION_UNIT_SIZE,STATE,TYPE,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME SECTOR_SIZE ALLOCATION_UNIT_SIZE STATE TYPE VOT


       1 DATA               512              1048576 MOUNTED    EXTERN     N
       2 OCR1               512              1048576 MOUNTED    EXTERN     Y

2.创建新的ASM diskgroup(asmca图形界面创建)
SQL> select GROUP_NUMBER,NAME,SECTOR_SIZE,ALLOCATION_UNIT_SIZE,STATE,TYPE,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME SECTOR_SIZE ALLOCATION_UNIT_SIZE STATE TYPE VOT


       1 DATA               512              1048576 MOUNTED    EXTERN     N
       2 OCR1               512              1048576 MOUNTED    EXTERN     Y
       3 OCR                512              1048576 MOUNTED    NORMAL     N

3.votedisk从+OCR1 更改到 +OCR
[oracle:/home/oracle:RACTEST1] crsctl replace votedisk +OCR
Successful addition of voting disk 9b4ac868901f4f89bf191e59baa3442b.
Successful addition of voting disk 2c2eff1ca2ad4f7bbfcdf8fc913dcc45.
Successful addition of voting disk 652d503ff1154fd6bfdfe3273a12d529.
Successful deletion of voting disk a5ef8885d1564f99bf0e0d77286c3b1f.
Successfully replaced voting disk group with +OCR.
CRS-4266: Voting file(s) successfully replaced
[oracle:/home/oracle:RACTEST1] crsctl query css votedisk
*## STATE File Universal Id File Name Disk group


  1. ONLINE 9b4ac868901f4f89bf191e59baa3442b (/dev/oracleasm/disks/OCR01) [OCR]
  2. ONLINE 2c2eff1ca2ad4f7bbfcdf8fc913dcc45 (/dev/oracleasm/disks/OCR02) [OCR]
  3. ONLINE 652d503ff1154fd6bfdfe3273a12d529 (/dev/oracleasm/disks/OCR03) [OCR]
    Located 3 voting disk(s).

4.更改ocr
[[email protected] disks]# ocrconfig -add +OCR
[[email protected] disks]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3108
Available space (kbytes) : 259012
ID : 44728649
Device/File Name : +OCR1
Device/File integrity check succeeded
Device/File Name : +OCR
Device/File integrity check succeeded

                                Device/File not configured

                                Device/File not configured

                                Device/File not configured

     Cluster registry integrity check succeeded

     Logical corruption check succeeded

[[email protected] disks]# ocrconfig -delete +OCR1
[[email protected] disks]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3108
Available space (kbytes) : 259012
ID : 44728649
Device/File Name : +OCR
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    

5.查看asm参数文件存放的位置并修改到+OCR上
SQL> show parameter spfile

NAME TYPE VALUE



spfile string +OCR1/ractest-cluster/asmparam
eterfile/registry.253.10297677
13

SQL> create pfile=‘/oracle/app/product/grid/dbs/pfile_ASM1.ora‘ from spfile;

File created.

SQL> create spfile=‘+OCR‘ from pfile=‘/oracle/app/product/grid/dbs/pfile_ASM1.ora‘;

File created.

SQL> show parameter spfile

NAME TYPE VALUE



spfile string +OCR1/ractest-cluster/asmparam
eterfile/registry.253.10297677
13

6.一节点重启crs
[[email protected] disks]# crsctl stop crs
[[email protected] disks]# crsctl start crs
[[email protected] disks]# su - oracle
[oracle:/home/oracle:RACTEST1] srvctl start instance -d RACTEST -n ractest1
[oracle:/home/oracle:RACTEST1] crs
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
*--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2
ora.LISTENER.lsnr
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2
ora.OCR.dg
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2
ora.OCR1.dg
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2
ora.asm
ONLINE ONLINE ractest1 Started
ONLINE ONLINE ractest2 Started
ora.gsd
OFFLINE OFFLINE ractest1
OFFLINE OFFLINE ractest2
ora.net1.network
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2
ora.ons
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2
ora.registry.acfs
ONLINE ONLINE ractest1
ONLINE ONLINE ractest2

Cluster Resources

ora.cvu
1 ONLINE ONLINE ractest2
ora.oc4j
1 OFFLINE OFFLINE
ora.ractest.db
1 ONLINE ONLINE ractest1 Open
2 ONLINE ONLINE ractest2 Open
ora.ractest1.vip
1 ONLINE ONLINE ractest1
ora.ractest2.vip
1 ONLINE ONLINE ractest2
ora.testdb.db
1 ONLINE OFFLINE Instance Shutdown

SQL> show parameter spfile

NAME TYPE VALUE



spfile string +OCR/ractest-cluster/asmparame
terfile/registry.253.102983977
5

7.2节点重启crs
[[email protected] ~]# crsctl stop crs
[[email protected] ~]# crsctl start crs
[[email protected] ~]# su - oracle
[oracle:/home/oracle:RACTEST2] srvctl start instance -d RACTEST -n ractest2
SQL> show parameter spfile

NAME TYPE VALUE



spfile string +OCR/ractest-cluster/asmparame
terfile/registry.253.102983977
5

8.删除 +OCR1

SQL> select GROUP_NUMBER,NAME,SECTOR_SIZE,ALLOCATION_UNIT_SIZE,STATE,TYPE,VOTING_FILES from v$asm_diskgroup;
GROUP_NUMBER NAME SECTOR_SIZE ALLOCATION_UNIT_SIZE STATE TYPE VOT


       1 DATA               512              1048576 MOUNTED                           EXTERN             N
       2 OCR1               512              1048576 MOUNTED                           EXTERN             N
       3 OCR                512              1048576 MOUNTED                           NORMAL             Y

SQL> drop diskgroup OCR1 including contents;
drop diskgroup OCR1 including contents
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15073: diskgroup OCR1 is mounted by another ASM instance

SQL> alter diskgroup OCR1 dismount;

Diskgroup altered.

SQL> select GROUP_NUMBER,NAME,SECTOR_SIZE,ALLOCATION_UNIT_SIZE,STATE,TYPE,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME SECTOR_SIZE ALLOCATION_UNIT_SIZE STATE TYPE VOT


       1 DATA               512              1048576 MOUNTED                           EXTERN             N
       0 OCR1                 0                    0 DISMOUNTED                                           N
       3 OCR                512              1048576 MOUNTED                           NORMAL             Y

SQL> drop diskgroup OCR1 including contents;
drop diskgroup OCR1 including contents
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "OCR1" does not exist or is not mounted

SQL> alter diskgroup OCR1 mount;

Diskgroup altered.

SQL> drop diskgroup OCR1 including contents;

Diskgroup dropped.

SQL> select GROUP_NUMBER,NAME,SECTOR_SIZE,ALLOCATION_UNIT_SIZE,STATE,TYPE,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME SECTOR_SIZE ALLOCATION_UNIT_SIZE STATE TYPE VOT


       1 DATA               512              1048576 MOUNTED                           EXTERN             N
       3 OCR                512              1048576 MOUNTED                           NORMAL             Y

2节点查看:
SQL> select GROUP_NUMBER,NAME,SECTOR_SIZE,ALLOCATION_UNIT_SIZE,STATE,TYPE,VOTING_FILES from v$asm_diskgroup;

GROUP_NUMBER NAME SECTOR_SIZE ALLOCATION_UNIT_SIZE STATE TYPE VOT


       1 DATA                                                                                               512              1048576 MOUNTED                           EXTERN             N
       3 OCR                                                                                                512              1048576 MOUNTED                           NORMAL             Y                    

9.最后在2个节点都查看一下
[oracle:/home/oracle:+ASM1] crsctl query css votedisk
*## STATE File Universal Id File Name Disk group


  1. ONLINE 9b4ac868901f4f89bf191e59baa3442b (/dev/oracleasm/disks/OCR01) [OCR]
  2. ONLINE 2c2eff1ca2ad4f7bbfcdf8fc913dcc45 (/dev/oracleasm/disks/OCR02) [OCR]
  3. ONLINE 652d503ff1154fd6bfdfe3273a12d529 (/dev/oracleasm/disks/OCR03) [OCR]
    Located 3 voting disk(s).
    [oracle:/home/oracle:+ASM1] ocrcheck
    Status of Oracle Cluster Registry is as follows :
    Version : 3
    Total space (kbytes) : 262120
    Used space (kbytes) : 3088
    Available space (kbytes) : 259032
    ID : 44728649
    Device/File Name : +OCR
    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 bypassed due to non-privileged user

[oracle:/home/oracle:+ASM2] crsctl query css votedisk
*## STATE File Universal Id File Name Disk group


  1. ONLINE 9b4ac868901f4f89bf191e59baa3442b (/dev/oracleasm/disks/OCR01) [OCR]
  2. ONLINE 2c2eff1ca2ad4f7bbfcdf8fc913dcc45 (/dev/oracleasm/disks/OCR02) [OCR]
  3. ONLINE 652d503ff1154fd6bfdfe3273a12d529 (/dev/oracleasm/disks/OCR03) [OCR]
    Located 3 voting disk(s).
    [oracle:/home/oracle:+ASM2] ocrcheck
    Status of Oracle Cluster Registry is as follows :
    Version : 3
    Total space (kbytes) : 262120
    Used space (kbytes) : 3088
    Available space (kbytes) : 259032
    ID : 44728649
    Device/File Name : +OCR
    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 bypassed due to non-privileged user

原文地址:https://blog.51cto.com/214320/2467219

时间: 2024-10-06 22:24:48

更改votingdisk和OCR到其他asm磁盘组的相关文章

11g RAC 更改归档模式 ,归档文件存放在ASM 磁盘组(转载)

11g RAC 更改归档模式 ASM 本实验有两个节点tip01,tip02oracle_sid 分别是 tips1,tips2 1.在节点1 tip01上执行[[email protected] ~]# su - grid[[email protected] ~]$ sqlplus / as sysasm SQL> select name from v$asm_diskgroup; NAME------------------------------DATAOCR SQL> alter di

ORACLE 11G RAC ASM磁盘组全部丢失后的恢复

一.环境描述(1)Oracle 11.2.0.3 RAC ON Oracle Linux 6 x86_64,只有一个ASM外部冗余磁盘组--DATA:(2)OCR,VOTEDISK,DATAFILE,CONTROLFILE,SPFILE全部位于这个磁盘组上:二.故障描述(1)存储故障导致ASM磁盘丢失.(2)CRS因为OCR和VOTEDISK的丢失,除了OHAS还联机外,CLUSTERWARE服务都已经停止.三.备份情况(1)RMAN备份:包括controlfile,database,spfil

AMDU恢复ASM磁盘组数据(测)

--umount ASMCMD> umoung -a asmdg commands: md_backup, md_restor lsattr, setattr cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias mkdir, pwd, rm, rmalias chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount offline, online, rebal, remap, umount

LINUX 11G RAC ASM磁盘组在线增加磁盘扩容

[javascript] view plain copy LINUX 11G RAC ASM磁盘组在线增加磁盘扩容 1.操作系统版本 OEL 6.1 [[email protected] ~]# more /etc/redhat-release Red Hat Enterprise Linux Server release 6.1 (Santiago) 2.数据库版本 oracle 11g rac SQL> select * from v$version; BANNER ------------

11G ORACLE RAC DBCA 无法识别asm磁盘组

ASM磁盘无法识别几种现象: 1) gi家目录或者其子目录权限错误 2)asm磁盘的权限错误 3)asm实例未启动或者asm磁盘组没有mount上 4)asm磁盘组资源没有在线 5)oracle用户的权限错误 6)oracle($ORACLE_HOME/bin)可执行文件的权限错误 OK,那我就按照上面的分析结果进行逐一排查: 1) gi家目录或者其子目录权限错误 [[email protected] ~]# ls -ld /u01/app/11.2.0/grid/drwxr-x--- 66 r

ASM磁盘组异机迁移

环境: Source: OS:redhat 6.3 DB:Oralce RAC 11.2.4.0 destination: OS:redhat 6.3 DB:Oralce RAC 11.2.4.0 背景:客户的PC机上面有两个实例,压力太大,需要迁移出一个实例.数据量TB级别,因为同平台,同版本,外挂存储.所以这里采用直接迁移asm磁盘组 操作前需要注意的: 1.Voting Disk是单独的盘,不包含需要迁移的数据 话不多,这里模拟出来分享给大家(PS:我的原库和目标库的主机名是一样的,第三步

【RAC】 RAC For W2K8R2 安装--创建ASM磁盘组(六)

[RAC] RAC For W2K8R2 安装--创建ASM磁盘组(六) 一.1  BLOG文档结构图 一.2  前言部分 一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① RAC for windows 2008R2 的安装 ② rac环境下共享存储的规划和搭建 ③ starwind软件的应用 ④ VMware workstation 如何做共享存储 ⑤ rac数据的静默安装和dbca静默建库 ⑥ rac数据库在

AIX使用LV创建ASM磁盘组

纠结啊为毛感觉只过了一天,就有两天没写了,今天晚上的机票离开上海.希望小叶子不会难为我. 昨晚研究了一下插卡小哥的业务流程,发现他并不是每个房间都插的,时间在每晚的9点到11点之间.估计是会在周边每个宾馆巡回一遍,插广告的房间有两种可能,第一种就是他们和宾馆沆瀣一气,知道哪个房间有人,第二种可能就是他们只给大床房的房间发,7天没有单间所以单身旅客一般会选择大床房,这绝对是优质潜在用户哇. 晚上看了个 正者无敌 还挺好看的样子,里面男主娶了3房姨太太,不错不错~ 晚上做了个梦,醒来后还是格外清晰,

ASM磁盘组状态和使用率的监控

最近根据需求,使用Zabbix对ASM磁盘组的状态和使用率进行监控,于是写了个Shell脚步对ASM磁盘组进行监控. 1.Shell脚步如下: #!/bin/bash ############################################################### # Check usage rate -- Check the ASM disk usage # # History: 2016/04/07 zhuwei First release ##########