在安装GUI时,创建了第一块ASM磁盘,命名为DATA1,上面存放了spfile文件,ocrfile文件,并且作为了vote盘。感觉名字和实际不符,容易搞混,所以想删除这个磁盘,直接删除会报错:

ORA-15039: diskgroup not dropped
ORA-15053: diskgroup "DATA1" contains existing files

  经过查询,发现是因为这块ASM磁盘为第一块磁盘,会默认将spfile,ocrfile文件放在上面,所以需要迁移,以下为整个迁移过程,先asmca创建一块VOTE磁盘,将所有东西迁移至VOTE盘上:

[root@RAC1 bin]# export DISPLAY=192.168.137.1:0.0
[root@RAC1 bin]# xhost +
access control disabled, clients can connect from any host
xhost: must be on local machine to enable or disable access control.
[root@RAC1 bin]# su - grid
[grid@RAC1 ~]$ asmca
[grid@RAC1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 390144 389741 0 389741 0 Y DATA1/
MOUNTED HIGH N 512 4096 1048576 10240 9951 4096 1951 0 N VOTE/
ASMCMD> exit
[grid@RAC1 ~]$ cd /u01/app/11.2.0/grid/bin/
[grid@RAC1 bin]$ ./crsctl query css votedisk;
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE ac2441da97ee4fe9bf213a4f04883ddc (/dev/mapper/mpathe) [DATA1]
Located 1 voting disk(s).
[grid@RAC1 bin]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 5 10:58:29 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options SQL> show parameter spfile; NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA1/rac-scan/asmparameterfi
le/registry.253.932423991
SQL> create pfile='$ORACLE_HOME/dbs/init+ASM.ora' from spfile; File created. SQL> shutdown abort
ASM instance shutdown
SQL> startup pfile=$ORACLE_HOME/dbs/init+ASM.ora;
ASM instance started Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> show parameter spfile; NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string SQL> create spfile='+VOTE' from pfile='$ORACLE_HOME/dbs/init+ASM.ora'; File created. SQL> shutdown abort
ASM instance shutdown
SQL> startup
ASM instance started Total System Global Area 1135747072 bytes
Fixed Size 2260728 bytes
Variable Size 1108320520 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
ASM diskgroups volume enabled
SQL> show parameter spfile; NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +VOTE/rac-scan/asmparameterfil
e/registry.253.932469773
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@RAC1 bin]$ ./crsctl query css votedisk;
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE ac2441da97ee4fe9bf213a4f04883ddc (/dev/mapper/mpathe) [DATA1]
Located 1 voting disk(s). [grid@RAC1 bin]$ crsctl replace votedisk +VOTE
Successful addition of voting disk 7ecf201998094fb1bf219f39752209bb.
Successful addition of voting disk 86e35de49d044f23bfdebda27b7caa91.
Successful addition of voting disk 52544b8c0f4e4f75bfe9d075025607ce.
Successful addition of voting disk 53bfc36bc0954f39bf912f190c5788e0.
Successful addition of voting disk 9b1772ca5d224f2bbfd35ce48a204777.
Successful deletion of voting disk ac2441da97ee4fe9bf213a4f04883ddc.
Successfully replaced voting disk group with +VOTE.
CRS-4266: Voting file(s) successfully replaced
[grid@RAC1 bin]$ ./crsctl query css votedisk;
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 7ecf201998094fb1bf219f39752209bb (/dev/mapper/mpathb) [VOTE]
2. ONLINE 86e35de49d044f23bfdebda27b7caa91 (/dev/mapper/mpathc) [VOTE]
3. ONLINE 52544b8c0f4e4f75bfe9d075025607ce (/dev/mapper/mpathd) [VOTE]
4. ONLINE 53bfc36bc0954f39bf912f190c5788e0 (/dev/mapper/mpathf) [VOTE]
5. ONLINE 9b1772ca5d224f2bbfd35ce48a204777 (/dev/mapper/mpathg) [VOTE]
Located 5 voting disk(s).
[grid@RAC1 bin]$ ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2760
Available space (kbytes) : 259360
ID : 1780865708
Device/File Name : +DATA1
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 [grid@RAC1 bin]$ ./ocrconfig -add +VOTE
PROT-20: Insufficient permission to proceed. Require privileged user
权限不足,需要使用root用户
[grid@RAC1 bin]$ exit
logout
[root@RAC1 bin]# ./ocrconfig -add +VOTE
[root@RAC1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2760
Available space (kbytes) : 259360
ID : 1780865708
Device/File Name : +DATA1
Device/File integrity check succeeded
Device/File Name : +VOTE
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 [root@RAC1 bin]# ./ocrconfig -replace +DATA1 -replacement +VOTE
PROT-29: The Oracle Cluster Registry location is already configured
此处报错说明已经添加进来,无法再替换
[root@RAC1 bin]# ./ocrconfig -delete +DATA1
[root@RAC1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2760
Available space (kbytes) : 259360
ID : 1780865708
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 bin]# su - grid
[grid@RAC1 ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 5 12:30:51 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options SQL> drop diskgroup DATA1;
drop diskgroup DATA1
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15053: diskgroup "DATA1" contains existing files SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@RAC1 ~]$ asmcmd
ASMCMD> ls
DATA1/
VOTE/
ASMCMD> cd DATA1
ASMCMD> ls
rac-scan/
ASMCMD> rm -rf rac-scan (注意操作,千万不要误删,此处删除,是因为已经将spfile和ocrfile成功迁移至vote盘)
ASMCMD> ls
ASMCMD> exit
[grid@RAC1 ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 5 12:32:24 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options SQL> drop diskgroup DATA1;
drop diskgroup DATA1
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15073: diskgroup DATA1 is mounted by another ASM instance
此处说明在另外一个节点,磁盘DATA1还仍处于挂载状态,需要先dismount掉: 在节点2上执行:
SQL> alter diskgroup DATA1 dismount; 返回节点1
SQL> drop diskgroup DATA1; Diskgroup dropped. SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@RAC1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac2
ora.VOTE.dg ora....up.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac2
[grid@RAC1 ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 5 12:35:28 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options SQL> col path format a30
SQL> select path,mount_status from v$asm_disk; PATH MOUNT_S
------------------------------ -------
/dev/mapper/mpathh CLOSED
/dev/mapper/mpathi CLOSED
/dev/mapper/mpathe CLOSED
/dev/mapper/mpathc CACHED
/dev/mapper/mpathb CACHED
/dev/mapper/mpathd CACHED
/dev/mapper/mpathf CACHED
/dev/mapper/mpathg CACHED 8 rows selected.

可以看到挂载的三块磁盘已经处于CLOSED状态,可用于重新创建磁盘组
SQL> create diskgroup DATA normal redundancy disk '/dev/mapper/mpathh','/dev/mapper/mpathi'; Diskgroup created. SQL> alter diskgroup DATA add disk '/dev/mapper/mpathe'; Diskgroup altered. SQL> select path,mount_status from v$asm_disk; PATH MOUNT_S
------------------------------ -------
/dev/mapper/mpathh CACHED
/dev/mapper/mpathi CACHED
/dev/mapper/mpathe CACHED
/dev/mapper/mpathc CACHED
/dev/mapper/mpathb CACHED
/dev/mapper/mpathd CACHED
/dev/mapper/mpathf CACHED
/dev/mapper/mpathg CACHED 8 rows selected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@RAC1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 390144 389988 130048 129970 0 N DATA/
MOUNTED HIGH N 512 4096 1048576 10240 8984 4096 1629 0 Y VOTE/

ORACLE迁移votedisk,spfile以及OCRfile的方法的更多相关文章

  1. 适用MySQL Migration Toolkit 1.0 将oracle迁移到mysql中遇到的问题

    这里主要说一下我在适用中碰到的问题,主要过程参考 http://www.cnblogs.com/duwenlei/p/3520759.html. 首先启动MySQLMigrationTool.exe ...

  2. 从Oracle迁移到MySQL的各种坑及自救方案

    当企业内部使用的数据库种类繁杂时,或者有需求更换数据库种类时,都可能会做很多数据迁移的工作.有些迁移很简单,有些迁移可能就会很复杂,大家有没有考虑过为了顺利完成复杂的数据库迁移任务,都需要考虑并解决哪 ...

  3. oracle迁移postgres之-Ora2Pg

    描述 Ora2Pg:甲骨文PostgreSQL数据库模式转换器是一个免费的工具用于Oracle数据库迁移到PostgreSQL兼容模式.它连接Oracle数据库,扫描它自动提取其结构或数据,然后生成S ...

  4. oracle迁移postgres之-oracle_fdw

    1. 安装oracle_fdw 在编译安装前,需要设置postgres的环境变量,如在.bash_profile中增加: export ORACLE_HOME=/u01/app/oracle expo ...

  5. oracle数据库表空间追加数据库文件方法

    oracle数据库表空间追加数据库文件方法   针对非大文件方式表空间,允许追加文件进行表空间的扩展,单个文件最大大小是32G  第一种方式:表空间增加数据文件    www.2cto.com   1 ...

  6. navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法

    原文:navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法 ...

  7. Oracle SQL 基本操作之 用户权限管理方法

     Oracle SQL 基本操作之 用户权限管理方法 最近把有关用户操作和权限管理的东西整理了一下,虽然不少博客都有过类似的整理,但是自己发现他们的内容或多或少都有些错误.于是,本人亲自对每条语句进行 ...

  8. 使用Microsoft SQL Server Migration Assistant for Oracle迁移数据库

    前言:使用Microsoft SQL Server Migration Assistant for Oracle迁移Oracle数据库到SqlServer数据库. 准备:Oracle11g.SqlSe ...

  9. oracle提高查询效率的34条方法

    注:本文来源:远方的守望者  <oracle提高查询效率的34条方法> oracle提高查询效率的34条方法 1.选择最有效率的表名顺序 (只在基于规则的优化器中有效): ORACLE的解 ...

随机推荐

  1. 响应式内容滑动插件jQuery.bxSlider

    bxSlider特性 1.充分响应各种设备,适应各种屏幕: 2.支持多种滑动模式,水平.垂直以及淡入淡出效果: 3.支持图片.视频以及任意html内容: 4.支持触摸滑动: 5.支持Firefox,C ...

  2. SQLServer 游标 (A)

    游标 游标分为客户端游标和服务器端游标.Sql通过游标可以对一个结果集进行逐行处理.对于使用服务器端游标的过程有:声明.打开.读取.关闭.释放. 1 声明游标 1.1 SQL-92标准的声明 Decl ...

  3. NoSQL数据库笔谈(转)

    NoSQL数据库笔谈 databases , appdir , node , paper颜开 , v0.2 , 2010.2 序 思想篇 CAP 最终一致性 变体 BASE 其他 I/O的五分钟法则 ...

  4. DataGrid新增行数据

    本文将介绍一下,如何通过Jquery MiniUI来添加Datagrid一行. 1.效果展示: ↓ 2.具体代码: <script type="text/javascript" ...

  5. linux下TCP/IP及内核参数优化调优(转)

    Linux下TCP/IP及内核参数优化有多种方式,参数配置得当可以大大提高系统的性能,也可以根据特定场景进行专门的优化,如TIME_WAIT过高,DDOS攻击等等. 如下配置是写在sysctl.con ...

  6. FTP连接时出现“227 Entering Passive Mode” 的解决方法

    今天从公网的服务器连接本地内网的FTP server copy文件时,系统老是提示227 Entering Passive Mode (xxx,xxx,,xxx,xxx,x),很是奇怪,于是上网找资料 ...

  7. java中常见的几种异常

    算术异常类:ArithmeticExecption空指针异常类:NullPointerException类型强制转换异常:ClassCastException数组负下标异常:NegativeArray ...

  8. VS2013 添加已有文件夹

    1.将现有项目或文件夹拷贝到指定目录下 2.解决方案右上有个显示所有文件的按钮 然后选中所有要添加的文件,右击

  9. python操作文件案例二则

    前言 python 对于文件及文件夹的操作. 涉及到 遍历文件夹下所有文件 ,文件的读写和操作 等等. 代码一 作用:查找文件夹下(包括子文件夹)下所有文件的名字,找出 名字中含有中文或者空格的文件 ...

  10. centos7安装http服务

    1.yum安装http [root@localhost ~]# yum install httpd -y 2.启动http服务 [root@localhost ~]# systemctl start  ...