FLASHCOPY增量同步在数据库恢复中的应用(3/4)
时间:2011-05-25 来源:djb1008
1.1.8 主机B识别flashcopy的目标盘,FBVOL为8000-8102,导入VG,修改LV属性。
1.1.8.1 在DS8100上,增加主机B访问8000-8102的路径
dscli> chvolgrp -action add -volume 8000-8002,8100-8102 V5
Date/Time: 2011年5月17日 下午04时01分11秒 IBM DSCLI Version: 5.3.1.172 DS: IBM.2107-75TXXXX
CMUC00031I chvolgrp: Volume group V5 successfully modified.
1.1.8.2 在主机上识别8000-8100等LUN,导入VG,设置lv的访问权限
#cfgmgr –v
# datapath query device
Total Devices : 6
DEV#: 0 DEVICE NAME: vpath0 TYPE: 2107900 POLICY: Optimized
SERIAL: 75TXXXX8000
DEV#: 1 DEVICE NAME: vpath1 TYPE: 2107900 POLICY: Optimized
SERIAL: 75TXXXX8001
DEV#: 2 DEVICE NAME: vpath2 TYPE: 2107900 POLICY: Optimized
SERIAL: 75TXXXX8002
DEV#: 3 DEVICE NAME: vpath3 TYPE: 2107900 POLICY: Optimized
SERIAL: 75TXXXX8100
DEV#: 4 DEVICE NAME: vpath4 TYPE: 2107900 POLICY: Optimized
SERIAL: 75TXXXX8101
DEV#: 5 DEVICE NAME: vpath5 TYPE: 2107900 POLICY: Optimized
SERIAL: 75TXXXX8102
#lspv
hdisk0 00c87badb8db2ba6 rootvg active
hdisk1 00c87bad75ee70a9 rootvg active
hdisk2 none None
。。。。。。
hdisk49 none None
vpath0 00c87badd701de12 None
vpath1 00c87badd701dff1 None
vpath2 00c87badd701e1a2 None
vpath3 00c87badd701e362 None
vpath4 00c87badd701e514 None
vpath5 00c87badd701e6de None
注意flashcopy 的目标盘与源盘的PVID是相同的,所以最好不要同时将源盘和目标盘都赋予主机访问。
# importvg -y testvg vpath0
testvg
# chown oracle:dba /dev/rora*
# chmod 755 /dev/rora*
# lsvg -l testvg
testvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
ora_system raw 6 6 6 closed/syncd N/A
ora_sysaux raw 6 6 6 closed/syncd N/A
ora_data01 raw 30 30 6 closed/syncd N/A
ora_data02 raw 30 30 6 closed/syncd N/A
ora_data03 raw 30 30 6 closed/syncd N/A
ora_index01 raw 30 30 6 closed/syncd N/A
ora_index02 raw 30 30 6 closed/syncd N/A
ora_redo01 raw 6 6 6 closed/syncd N/A
ora_redo02 raw 6 6 6 closed/syncd N/A
ora_redo03 raw 6 6 6 closed/syncd N/A
ora_control02 raw 6 6 6 closed/syncd N/A
ora_control03 raw 6 6 6 closed/syncd N/A
ora_control01 raw 6 6 6 closed/syncd N/A
ora_temp01 raw 30 30 6 closed/syncd N/A
ora_undotbs01 raw 30 30 6 closed/syncd N/A
1.1.9 主机B上启动数据库,检查特征值表的内容
SQL> startup
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 2101912 bytes
Variable Size 545262952 bytes
Database Buffers 524288000 bytes
Redo Buffers 2088960 bytes
Database mounted.
Database opened.
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
475546 ####稍大于之前记载的455256
SQL> select count(1) from aidu.test02;
select count(1) from aidu.test02
*
ERROR at line 1:
ORA-00942: table or view does not exist
这里我们可以看到,使用pprc的源盘(5000-5102)进行flashcopy,生成目标盘(8000-8102),可以很顺利将数据库启动起来,不需要在数据库层做任何操作(例如suspend或者begin backup)。主机B上的数据库的时间点就是mkflash执行的时间点。
1.1.10 关闭主机B上的数据库,关闭VG
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
# varyoffvg testvg
注意这里不需要exportvg,删除hdisk,删除path,只需要关闭VG 就可以了.
FLASHCOPY增量同步在数据库恢复中的应用(4/4)