RAC在线替换OCR、DATA、FRA等ASM磁盘-创新互联
环境描述:
成都网站建设公司更懂你!成都创新互联只做搜索引擎喜欢的网站!成都网站制作前台采用搜索引擎认可的DIV+CSS架构,全站HTML静态,H5高端网站建设+CSS3网站,提供:网站建设,微信开发,微信小程序定制开发,商城网站定制开发,app软件定制开发,空间域名,服务器租售,网站代托管运营,微信公众号代托管运营。ORACLE Version:11.2.0.3.0
RHEL6.4+ASMlib
由于共享存储需进行升级,故需对所有ASM磁盘进行在线迁移。
1.收集信息
su - grid
export ORACLE_SID=+ASM1
sqlplus / as sysasm
col NAME for a10
col LABEL for a20
col STATE for a10
col FAILGROUP for a10
col PATH for a20
set line 150
SELECT GROUP_NUMBER, DISK_NUMBER, LABEL, STATE, FAILGROUP, NAME, PATH, TOTAL_MB, FREE_MB FROM V$ASM_DISK;
GROUP_NUMBER DISK_NUMBER LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB
------------ ----------- -------------------- ---------- ---------- ---------- -------------------- ---------- ---------
1 0 DATA01 NORMAL DATA01 DATA01 ORCL:DATA01 20479 16773
1 1 DATA02 NORMAL DATA02 DATA02 ORCL:DATA02 20479 16773
2 0 FRA01 NORMAL FRA01 FRA01 ORCL:FRA01 30719 28906
3 0 OCR01 NORMAL OCR01 OCR01 ORCL:OCR01 2046 1921
3 1 OCR02 NORMAL OCR02 OCR02 ORCL:OCR02 2046 1952
3 2 OCR03 NORMAL OCR03 OCR03 ORCL:OCR03 2046 1954
3 3 OCR04 NORMAL OCR04 OCR04 ORCL:OCR04 2046 1955
2.备份整库以及OCR磁盘组
export ORACLE_SID=JSTDB1
rman target /
crosscheck archivelog all;
delete expired archivelog all;
backup format '/u01/rman/fulldb_%d_%U' database include current controlfile plus archivelog delete input;
su - root
ocrconfig -export /u01/rman/ocr.bak
3.映射新磁盘给操作系统
Disk /dev/sdi: 21.5 GB
Disk /dev/sdk: 32.2 GB
Disk /dev/sdl: 2147 MB
Disk /dev/sdj: 21.5 GB
Disk /dev/sdm: 2147 MB
Disk /dev/sdn: 2147 MB
4.标识为ASM磁盘
/etc/init.d/oracleasm createdisk NEW_DATA01 /dev/sdi1
/etc/init.d/oracleasm createdisk NEW_DATA02 /dev/sdj1
/etc/init.d/oracleasm createdisk NEW_FRA01 /dev/sdk1
/etc/init.d/oracleasm createdisk NEW_OCR01 /dev/sdl1
/etc/init.d/oracleasm createdisk NEW_OCR02 /dev/sdm1
/etc/init.d/oracleasm createdisk NEW_OCR03 /dev/sdn1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
col NAME for a10
col LABEL for a20
col STATE for a10
col FAILGROUP for a10
col PATH for a20
set line 150
SELECT GROUP_NUMBER, DISK_NUMBER, LABEL, STATE, FAILGROUP, NAME, PATH, TOTAL_MB, FREE_MB FROM V$ASM_DISK;
GROUP_NUMBER DISK_NUMBER LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB
------------ ----------- -------------------- ---------- ---------- ---------- -------------------- ---------- ---------
0 0 NEW_DATA01 NORMAL ORCL:NEW_DATA01 00
0 1 NEW_DATA02 NORMAL ORCL:NEW_DATA02 00
0 2 NEW_FRA01 NORMAL ORCL:NEW_FRA01 00
0 3 NEW_OCR01 NORMAL ORCL:NEW_OCR01 00
0 4 NEW_OCR02 NORMAL ORCL:NEW_OCR02 00
0 5 NEW_OCR03 NORMAL ORCL:NEW_OCR03 00
1 0 DATA01 NORMAL DATA01 DATA01 ORCL:DATA01 20479 16773
1 1 DATA02 NORMAL DATA02 DATA02 ORCL:DATA02 20479 16773
2 0 FRA01 NORMAL FRA01 FRA01 ORCL:FRA01 30719 30142
3 0 OCR01 NORMAL OCR01 OCR01 ORCL:OCR01 2046 1921
3 1 OCR02 NORMAL OCR02 OCR02 ORCL:OCR02 2046 1952
3 2 OCR03 NORMAL OCR03 OCR03 ORCL:OCR03 2046 1954
3 3 OCR04 NORMAL OCR04 OCR04 ORCL:OCR04 2046 1955
14 rows selected.
5.添加磁盘到ASM磁盘组
ALTER DISKGROUP DATA ADD DISK 'ORCL:NEW_DATA01';
ALTER DISKGROUP DATA ADD DISK 'ORCL:NEW_DATA02';
ALTER DISKGROUP FRA ADD DISK 'ORCL:NEW_FRA01';
ALTER DISKGROUP OCR ADD DISK 'ORCL:NEW_OCR01';
ALTER DISKGROUP OCR ADD DISK 'ORCL:NEW_OCR02';
ALTER DISKGROUP OCR ADD DISK 'ORCL:NEW_OCR03';
或者使用asmca图形界面添加
6.删除磁盘
ALTER DISKGROUP DATA DROP DISK DATA01;
ALTER DISKGROUP DATA DROP DISK DATA02;
ALTER DISKGROUP FRA DROP DISK FRA01;
ALTER DISKGROUP OCR DROP DISK OCR01;
ALTER DISKGROUP OCR DROP DISK OCR02;
ALTER DISKGROUP OCR DROP DISK OCR03;
ALTER DISKGROUP OCR DROP DISK OCR04;
查看删除后的状态
col NAME for a10
col LABEL for a20
col STATE for a10
col FAILGROUP for a10
col PATH for a20
set line 150
SELECT GROUP_NUMBER, DISK_NUMBER, LABEL, STATE, FAILGROUP, NAME, PATH, TOTAL_MB, FREE_MB FROM V$ASM_DISK;
GROUP_NUMBER DISK_NUMBER LABEL STATE FAILGROUP NAME PATH TOTAL_MB FREE_MB
------------ ----------- -------------------- ---------- ---------- ---------- -------------------- ---------- ---------
0 2 NEW_FRA01 NORMAL ORCL:NEW_FRA01 00
0 3 NEW_OCR01 NORMAL ORCL:NEW_OCR01 00
0 4 NEW_OCR02 NORMAL ORCL:NEW_OCR02 00
0 5 NEW_OCR03 NORMAL ORCL:NEW_OCR03 00
1 0 DATA01 DROPPING DATA01 DATA01 ORCL:DATA01 20479 20240
1 1 DATA02 NORMAL DATA02 DATA02 ORCL:DATA02 20479 18089
2 0 FRA01 NORMAL FRA01 FRA01 ORCL:FRA01 30719 30142
3 0 OCR01 NORMAL OCR01 OCR01 ORCL:OCR01 2046 1921
3 1 OCR02 NORMAL OCR02 OCR02 ORCL:OCR02 2046 1952
3 2 OCR03 NORMAL OCR03 OCR03 ORCL:OCR03 2046 1954
3 3 OCR04 NORMAL OCR04 OCR04 ORCL:OCR04 2046 1955
1 2 NEW_DATA01 NORMAL NEW_DATA01 NEW_DATA01 ORCL:NEW_DATA01 20479 18085
1 3 NEW_DATA02 NORMAL NEW_DATA02 NEW_DATA02 ORCL:NEW_DATA02 20479 18086
14 rows selected.
或者使用asmca图形界面删除
7.查看reblance的状态
COL ERROR_CODE FOR A10;
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------- ----------
1 REBAL RUN 1 1 1359 2480 1800 0
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------- ----------
3 REBAL REAP 1 1 130148 1390 0
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------- ----------
3 REBAL WAIT 1
可以看到删除的状态:RUN->REAP->WAIT->结束
调整reblance的速度
alter diskgroup DATA rebalance power 8;
select * from v$asm_operation;
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------- ----------
1 REBAL RUN 8 8 120 4006 1440 2
Reblance成功
select * from v$asm_operation;
no rows selected
9.查看RAC的状态
crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
ONLINE OFFLINE rac1
ONLINE 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.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac2
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.jstdb.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.paydb.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.oc4j
1 ONLINE ONLINE rac2
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
ora.scan2.vip
1 ONLINE ONLINE rac2
ora.scan3.vip
1 ONLINE ONLINE rac2
10.将drop后的磁盘从存储系统中取消映射
11.重启服务器(生产系统请慎重此操作)测试RAC状态正常
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站题目:RAC在线替换OCR、DATA、FRA等ASM磁盘-创新互联
URL地址:http://azwzsj.com/article/dgphps.html