日期:2014-05-16 浏览次数:20488 次
中午刚去吃饭,就接到同事电话说急着要恢复生产库上的归档日志。系统环境是10.2.0.5,RAC,归档日志在node1上建立了nfs共享,而node2上没有建立nfs共享。另有一套查询库,通过DSG的同步软件将数据从生产库上同步到查询库上。软件原理是通过传说分析归档日志然后加以应用,总体感觉有点像DG。由于生产库上使用的是增量备份,每天都进行备份。且备份完后会自动删除归档日志。恢复生产库的归档日志的原因是,同步到查询库时失败(采用DSG的备份软件时,当遇到大量DML操作时经常遇到同步失败的情况),需要重新同步,但归档日志已经被删除,故需要还原归档日志。查询库昨日17:00后的数据同步失败,故需要还原从昨日至今的归档日志。系统环境交代到这,下面是具体的实施步骤。
在node1上进行操作
$ pwd
/arch_log/restore
root@fjlt_zgsc_db01:/#mount
? node?????? mounted??????? mounted over??? vfs?????? date??????? options?????
-------- ---------------? ---------------? ------ ------------ ---------------
???????? /dev/hd4???????? /??????????????? jfs2?? Apr 21 19:42 rw,log=/dev/hd8
???????? /dev/hd2???????? /usr???????????? jfs2?? Apr 21 19:42 rw,log=/dev/hd8
???????? /dev/hd9var????? /var???????????? jfs2?? Apr 21 19:42 rw,log=/dev/hd8
???????? /dev/hd3???????? /tmp???????????? jfs2?? Apr 21 19:42 rw,log=/dev/hd8
???????? /dev/hd1???????? /home??????????? jfs2?? Apr 21 19:43 rw,log=/dev/hd8
???????? /dev/hd11admin?? /admin?????????? jfs2?? Apr 21 19:43 rw,log=/dev/hd8
???????? /proc??????????? /proc??????????? procfs Apr 21 19:43 rw?????????????
???????? /dev/hd10opt???? /opt???????????? jfs2?? Apr 21 19:43 rw,log=/dev/hd8
???????? /dev/livedump??? /var/adm/ras/livedump jfs2?? Apr 21 19:43 rw,log=/dev/hd8
???????? /dev/lv_oracle10g /oracle10g?????? jfs2?? Apr 21 19:43 rw,log=/dev/hd8
???????? /dev/lv_zs_arch_01 /arch_log??????? jfs2?? Apr 21 19:43 rw,log=/dev/loglv01
???????? /dev/lv_zs_db2bk_01 /rman_db2_bk???? jfs2?? Apr 21 19:43 rw,log=/dev/loglv01
???????? /dev/lv_zs_bck_01 /rman_data?????? jfs2?? Apr 21 19:43 rw,log=/dev/loglv00
???????? /dev/lv_cdump??? /oracle10g/app/oracle/admin/zgscdb/cdump jfs2?? Nov 16 12:05 rw,log=/dev/loglv02
???????? /dev/lv_dsg1???? /dsg1??????????? jfs2?? Nov 16 12:10 rw,log=/dev/loglv02
fjlt_zgsc_db02 /arch_log/zgsc_db02_arch /arch_log/zgsc_db02_arch nfs3?? Jan 16 16:26?
$ df -g
Filesystem??? GB blocks????? Free %Used??? Iused %Iused Mounted on
/dev/hd4????????? 10.00????? 9.56??? 5%??? 12767???? 1% /
/dev/hd2????????? 10.00????? 6.75?? 33%??? 62385???? 4% /usr
/dev/hd9var?????? 10.00????? 9.23??? 8%??? 13956???? 1% /var
/dev/hd3????????? 10.00????? 9.09?? 10%???? 3512???? 1% /tmp
/dev/hd1????????? 10.00????? 8.99?? 11%???? 8013???? 1% /home
/dev/hd11admin????? 0.25????? 0.25??? 1%??????? 5???? 1% /admin
/proc???????????????? -???????? -??? -???????? -???? -? /proc
/dev/hd10opt????? 10.00????? 9.73??? 3%??? 10356???? 1% /opt
/dev/livedump????? 0.25????? 0.25??? 1%??????? 8???? 1% /var/adm/ras/livedump
/dev/lv_oracle10g???? 30.00???? 11.84?? 61%?? 215252???? 7% /oracle10g
/dev/lv_zs_arch_01??? 997.00??? 989.75??? 1%?????? 32???? 1% /arch_log
/dev/lv_zs_db2bk_01??? 998.00??? 432.63?? 57%????? 167???? 1% /rman_db2_bk
/dev/lv_zs_bck_01?? 2992.00?? 1836.57?? 39%????? 224???? 1% /rman_data
/dev/lv_cdump??? 200.00??? 199.97??? 1%?????? 15???? 1% /oracle10g/app/oracle/admin/zgscdb/cdump
/dev/lv_dsg1????? 49.75???? 43.97?? 12%???? 8831???? 1% /dsg1
fjlt_zgsc_db02:/arch_log/zgsc_db02_arch??? 997.00??? 971.00??? 3%?????? 34???? 1% /arch_log/zgsc_db02_arch
/arch_log挂载点下空余空间接近1T,目标将归档日志还原到/arch_log/restore下
第一反应,通过v$archived_log找到17:00以后的归档日志序列号
select sequence#,completion_time from v$archived_log where completion_time > to_date('2012-02-15','hh24:mi:ss');
查询得出从