oracle10grac更换共享磁盘(ocr,vote)的方法

2014-11-24 09:21:33 · 作者: · 浏览: 0

1删除ocr盘,vote盘,数据盘

(1)备份数据库之后,停止数据库,使用dbca删除数据库

(2)移除diskgroup

进入节点2:export ORACLE_SID=+ASM2

sqlplus/ as sysdba

Alter diskgroup dgdata dismount;

进入节点1:export ORACLE_SID=+ASM1

先将数据文件删除,否则drop的时候会报错

asmcmd

rm rf *

sqlplus / as sysdba

drop diskgroup dgdata;

(3)停止crs,并且使crs开机不自启动,

两个节点分别用root用户执行

./crsctldisable crs

./crsctlstop crs

(4)导出ocr盘和vote盘数据,做备份

./ocrconfig export /oracle/product/ocr.exp

dd if=/dev/raw/raw3 of=/oracle/product/vote1.exp

dd if=/dev/raw/raw4 of=/oracle/product/vote2.exp

dd if=/dev/raw/raw5 of=/oracle/product/vote3.exp

(5)注释掉/etc/rc.local中格式化裸设备及给裸设备赋予权限的脚本。

此时有很多oracle的进程运行,重启服务器,因为crs开机启动disabled了,重启之后,oracle进程就不会运行了

(6)进入系统,移除共享盘。例如lvremove/dev/DATA/lv_ocr1,…. vgremove DATA, pvremove /dev/mapper/mpath

(7)存储器中删掉LUN

2.导入数据至新建ocr盘,vote盘

(1)LV的建立:磁盘中划一个大容量的LUN,建LV,例如:

pvcreate

vgcreate DATA /dev/mapper/

lvcreate

(2)修改rc.local配置裸设备的脚本,并且重启服务

(3)向raw1 raw2中加载ocr数据:

[root@ts01 bin]# ./ocrconfig -restore /oracle/product/ocr.exp

导入之后,验证

[root@ts01 bin]# ./ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 2

Total space (kbytes) : 1023728

Used space (kbytes) : 3860

Available space (kbytes) : 1019868

ID :2144682474

Device/File Name :/dev/raw/raw1

Device/Fileintegrity check succeeded

Device/File Name :/dev/raw/raw2

Device/Fileintegrity check succeeded

Cluster registry integrity check succeeded

(4)此时ocr注册表正常,检查votedisk位置

[root@ts01 bin]# ./crsctl query css votedisk

0. 0 /dev/raw/raw3

1. 0 /dev/raw/raw4

2. 0 /dev/raw/raw5

(5)导入votedisk备份数据

root@ts01 bin]#dd if=/oracle/product/vot1.exp of=/dev/raw/raw3

2048000+0records in

2048000+0records out

1048576000 bytes(1.0 GB) copied, 417.17 seconds, 2.5 MB/s

[root@ts01 bin]#dd if=/oracle/product/vot2.exp of=/dev/raw/raw4

2048000+0records in

2048000+0records out

1048576000 bytes(1.0 GB) copied, 421.286 seconds, 2.5 MB/s

[root@ts01 bin]#dd if=/oracle/product/vot3.exp of=/dev/raw/raw5

2048000+0records in

2048000+0records out

1048576000 bytes(1.0 GB) copied, 422.608 seconds, 2.5 MB/s

(6)两个节点分别执行启动crs,和设置开机允许启动crs

[root@ts01 bin]# ./crsctl enable crs

[root@ts01 bin]# ./crsctl start crs

Attempting to start CRS stack

The CRS stack will be started shortly

(7)几分钟之后查看各项服务crs_stat t

(8)运行dbca建立数据库

(9)ASM实例已经存在了,之前的diskgroup已经被删除,重新配置新diskgroup即可。