重建ocr,vote磁盘,更改设备大小

一. 概述

OS: aix 6.1
DB: oracle rac 10.2.0.5

安装了crs,db,然后升级到10.2.0.5后,发现数据卷n_datavg的ppsize设置过大,如果使用条带化和多路径等技术来提高磁盘的读写性能,将导致部分存储空间的浪费.

原来的情况:
VG: N_DATAVG
ppsize:128m;

mklv -w n -r n -u 6 -S 256K -t raw -y ora_ocr_01 n_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_ocr_02 n_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_vote_01 n_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_vote_02 n_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_vote_03 n_datavg 6

[@more@]

二. 问题分析

一般ocr,vote 需要的空间在256M左右
所以使用小的ppsize,目前32m比较合适,12个磁盘组成了n_datavg,所以使用条带化,最小条带单元为12*32=384M,不是很浪费,又提高了并行度和运行速度.

VG:N_DATAVG
PPSIZE: 32M


三. 问题解决

1. 停止CRS的运行
two nodes:
#/etc/init.crs stop
#ps -ef|grep d.bin

2. 在U_DATAVG 上创建crs信息的备份lv
因为需要重新建立n_datavg,所以需要在另外一个vg上创建一些lv来备份
mklv -w n -r n -u 6 -S 256K -t raw -y ora_ocr_01_b u_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_ocr_02_b u_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_vote_01_b u_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_vote_02_b u_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_vote_03_b u_datavg 6

chown oracle:dba /dev/rora*
chmod 755 /dev/rora*


3. 修改ocr,vote的配置,使用备份用的lv
#cd /oracle/product/10.2.0/crs/bin
# ./ocrconfig -export /oracle/ocr.bak
# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 786172
Used space (kbytes) : 2016
Available space (kbytes) : 784156
ID : 304318606
Device/File Name : /dev/rora_ocr_01
Device/File integrity check succeeded
Device/File Name : /dev/rora_ocr_02
Device/File integrity check succeeded

Cluster registry integrity check succeeded

# more /etc/oracle/ocr.loc
ocrconfig_loc=/dev/rora_ocr_01
ocrmirrorconfig_loc=/dev/rora_ocr_02
local_only=FALSE

# ./ocrconfig -replace ocrmirror /dev/rora_ocr_01_b
# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 786172
Used space (kbytes) : 2016
Available space (kbytes) : 784156
ID : 304318606
Device/File Name : /dev/rora_ocr_01
Device/File integrity check succeeded
Device/File Name : /dev/rora_ocr_01_b
Device/File integrity check succeeded

Cluster registry integrity check succeeded

# ./ocrconfig -replace ocr /dev/rora_ocr_02_b
# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 786172
Used space (kbytes) : 2016
Available space (kbytes) : 784156
ID : 304318606
Device/File Name : /dev/rora_ocr_02_b
Device/File integrity check succeeded
Device/File Name : /dev/rora_ocr_01_b
Device/File integrity check succeeded

Cluster registry integrity check succeeded

# more /etc/oralce/ocr.loc
/etc/oralce/ocr.loc: A file or directory in the path name does not exist.
# more /etc/oracle/ocr.loc
#Device/file /dev/rora_ocr_01 getting replaced by device /dev/rora_ocr_02_b
ocrconfig_loc=/dev/rora_ocr_02_b
ocrmirrorconfig_loc=/dev/rora_ocr_01_b
local_only=false


/etc/init.crs stop

# ./crsctl query css votedisk
0. 0 /dev/rora_vote_01
1. 0 /dev/rora_vote_02
2. 0 /dev/rora_vote_03
located 3 votedisk(s).

./crsctl add css votedisk /dev/rora_vote_01_b -force
./crsctl add css votedisk /dev/rora_vote_02_b -force
./crsctl add css votedisk /dev/rora_vote_03_b -force

# ./crsctl query css votedisk
0. 0 /dev/rora_vote_01
1. 0 /dev/rora_vote_02
2. 0 /dev/rora_vote_03
3. 0 /dev/rora_vote_01_b
4. 0 /dev/rora_vote_02_b
5. 0 /dev/rora_vote_03_b

./crsctl delete css votedisk /dev/rora_vote_01 -force

./crsctl delete css votedisk /dev/rora_vote_02 -force

./crsctl delete css votedisk /dev/rora_vote_03 -force


4. 删除n_datavg,重新创建n_datavg,ppsize设置为32M
two nodes:
smitty clstop
exportvg n_datavg

node1:
smitty vg--&gtadd a vg--&gtppsize =32m
node2:
importvg -y n_datavg -V 53 hdisk14

two nodes: 启动hacmp
smitty clstart

5. 重新在n_datavg上创建ocr,vote裸设备
mklv -w n -r n -u 12 -S 256K -t raw -y ora_ocr_01 n_datavg 24
mklv -w n -r n -u 12 -S 256K -t raw -y ora_ocr_02 n_datavg 24
mklv -w n -r n -u 12 -S 256K -t raw -y ora_vote_01 n_datavg 12
mklv -w n -r n -u 12 -S 256K -t raw -y ora_vote_02 n_datavg 12
mklv -w n -r n -u 12 -S 256K -t raw -y ora_vote_03 n_datavg 12
mklv -w n -r n -u 6 -S 256K -t raw -y ora_spfile_01 n_datavg 6
mklv -w n -r n -u 6 -S 256K -t raw -y ora_pwdfile_01 n_datavg 6
chown oracle:dba /dev/rora*
chmod 755 /dev/rora*

6. 修改crs的ocr,vote配置,启动crs
# ./ocrconfig -replace ocrmirror /dev/rora_ocr_01
# ./ocrconfig -replace ocr /dev/rora_ocr_02
# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 786172
Used space (kbytes) : 2016
Available space (kbytes) : 784156
ID : 304318606
Device/File Name : /dev/rora_ocr_02
Device/File integrity check succeeded
Device/File Name : /dev/rora_ocr_01
Device/File integrity check succeeded

Cluster registry integrity check succeeded

# ./crsctl add css votedisk /dev/rora_vote_01
Cluster is not in a ready state for online disk addition
# ./crsctl add css votedisk /dev/rora_vote_01 -force
Now formatting voting disk: /dev/rora_vote_01
successful addition of votedisk /dev/rora_vote_01.
# ./crsctl add css votedisk /dev/rora_vote_02
Cluster is not in a ready state for online disk addition
# ./crsctl add css votedisk /dev/rora_vote_02 -force
Now formatting voting disk: /dev/rora_vote_02
successful addition of votedisk /dev/rora_vote_02.
# ./crsctl add css votedisk /dev/rora_vote_03 -force
Now formatting voting disk: /dev/rora_vote_03
successful addition of votedisk /dev/rora_vote_03.
# ./crsctl query css votedisk
0. 0 /dev/rora_vote_01
1. 0 /dev/rora_vote_02
2. 0 /dev/rora_vote_03
3. 0 /dev/rora_vote_01_b
4. 0 /dev/rora_vote_02_b
5. 0 /dev/rora_vote_03_b

located 6 votedisk(s).
# ./crsctl delete css votedisk /dev/rora_vote_01_b
Cluster is not in a ready state for online disk removal
# ./crsctl delete css votedisk /dev/rora_vote_01_b -force
successful deletion of votedisk /dev/rora_vote_01_b.
# ./crsctl delete css votedisk /dev/rora_vote_02_b -force
successful deletion of votedisk /dev/rora_vote_02_b.
# ./crsctl delete css votedisk /dev/rora_vote_03_b -force
successful deletion of votedisk /dev/rora_vote_03_b.
# ./crsctl query css votedisk
0. 0 /dev/rora_vote_01
1. 0 /dev/rora_vote_02
2. 0 /dev/rora_vote_03

located 3 votedisk(s).


7. 检查ocr,vote的lv的打开情况
# lsvg -l u_datavg
u_datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_ocr_01_b raw 6 6 6 open/syncd N/A
ora_ocr_02_b raw 6 6 6 open/syncd N/A
ora_vote_01_b raw 6 6 6 open/syncd N/A
ora_vote_02_b raw 6 6 6 open/syncd N/A
ora_vote_03_b raw 6 6 6 open/syncd N/A

# lsvg -l n_datavg
n_datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_ocr_01 raw 24 24 12 closed/syncd N/A
ora_ocr_02 raw 24 24 12 closed/syncd N/A
ora_vote_01 raw 12 12 12 closed/syncd N/A
ora_vote_02 raw 12 12 12 closed/syncd N/A
ora_vote_03 raw 12 12 12 closed/syncd N/A
ora_spfile_01 raw 6 6 6 closed/syncd N/A
ora_pwdfile_01 raw 6 6 6 closed/syncd N/A

我们可以看到现在虽然通过./crsctl query css votedisk可以看到vote磁盘已经修改为/dev/rora_vote_01/02/03,但lv的状态仍然是close
而被替换掉的ora_ocr_01/02/03_b 的状态仍然是open,这主要是因为我们采用的是在线force替换,之用crs重新启动后才会使用新的ocr和vote盘.

8.停止crs运行,所有ocr,vote磁盘的lv的状态都变为close
/etc/init.crs stop

# lsvg -l u_datavg
u_datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_ocr_01_b raw 6 6 6 closed/syncd N/A
ora_ocr_02_b raw 6 6 6 closed/syncd N/A
ora_vote_01_b raw 6 6 6 closed/syncd N/A
ora_vote_02_b raw 6 6 6 closed/syncd N/A
ora_vote_03_b raw 6 6 6 closed/syncd N/A

# lsvg -l n_datavg
n_datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_ocr_01 raw 24 24 12 closed/syncd N/A
ora_ocr_02 raw 24 24 12 closed/syncd N/A
ora_vote_01 raw 12 12 12 closed/syncd N/A
ora_vote_02 raw 12 12 12 closed/syncd N/A
ora_vote_03 raw 12 12 12 closed/syncd N/A
ora_spfile_01 raw 6 6 6 closed/syncd N/A
ora_pwdfile_01 raw 6 6 6 closed/syncd N/A

9.启动crs运行,所有ocr,vote磁盘的状态都恢复为open状态,而备份的lv的状态变为close
# /etc/init.crs start
Startup will be queued to init within 30 seconds.
# lsvg -l u_datavg
u_datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_ocr_01_b raw 6 6 6 closed/syncd N/A
ora_ocr_02_b raw 6 6 6 closed/syncd N/A
ora_vote_01_b raw 6 6 6 closed/syncd N/A
ora_vote_02_b raw 6 6 6 closed/syncd N/A
ora_vote_03_b raw 6 6 6 closed/syncd N/A

# lsvg -l n_datavg
n_datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_ocr_01 raw 24 24 12 open/syncd N/A
ora_ocr_02 raw 24 24 12 open/syncd N/A
ora_vote_01 raw 12 12 12 open/syncd N/A
ora_vote_02 raw 12 12 12 open/syncd N/A
ora_vote_03 raw 12 12 12 open/syncd N/A
ora_spfile_01 raw 6 6 6 closed/syncd N/A
ora_pwdfile_01 raw 6 6 6 closed/syncd N/A

10.删除备份用的lv
rmlv -f ora_ocr_01_b
rmlv -f ora_ocr_02_b
rmlv -f ora_vote_01_b
rmlv -f ora_vote_02_b
rmlv -f ora_vote_03_b

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/32980/viewspace-1057181/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/32980/viewspace-1057181/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值