- 最后登录
- 2017-5-4
- 在线时间
- 81 小时
- 威望
- 999
- 金钱
- 2391
- 注册时间
- 2013-9-11
- 阅读权限
- 150
- 帖子
- 1124
- 精华
- 5
- 积分
- 999
- UID
- 1220
|
1#
发表于 2017-4-12 18:54:07
|
查看: 1371 |
回复: 0
我为了月末的搬家做一些备份恢复演练,其中一个模拟就是从热备中迁移恢复,下面是三台机器:
a.production machine
b.test machine
c.catalog machine
d.Veritas在第四台机器管理磁带库
1. 我做了一个热全备,22号中午12点45结束。
2. 另外有一台测试机器我都配好了一模一样的环境了
3. Catalog在第三台机器上。
4. 在测试机上(rman target / catalog rman/rman@aaa)
5. RMAN>startup nomount
6. run {
allocate channel c1 type sbt;
send 'NB_ORA_CLIENT=db';
restore controlfile;
}
7. RMAN>alter database mount;
8. list backup of controlfile;
List of Backup Sets
===================
............
............
............
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
74053 Incr 0 5.75M SBT_TAPE 00:01:38 22-APR-09
BP Key: 74063 Status: AVAILABLE Compressed: NO Tag: TAG20090422T182046
Handle: full_FIMASYS_4400_1_684873116.bak Media: 0050L2
Control File Included: Ckp SCN: 153914435 Ckp time: 22-APR-09
9. host;sqlplus ...
10. SQL> select controlfile_change# from v$database;
CONTROLFILE_CHANGE#
-------------------
153914435
//controlfile是最新的了
11.exit to RMAN
12.RMAN> run {
2> set until time "to_date('2009/04/22 13:00','yyyy/mm/dd hh24:mi:ss')";
3> allocate channel c1 type sbt;
4> send 'NB_ORA_CLIENT=db';
5> restore database;
6> recover database;
7> }
Finished restore at 22-APR-09
Starting recover at 22-APR-09
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: '/oradata/FIMASYS10G/undotbs1.dbf'
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/22/2009 20:02:50
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 4346 lowscn 150296436 found to restore
13. Go to Sqlplus to check the latest v$log
SQL> select thread#,sequence# from v$log;
THREAD# SEQUENCE#
---------- ----------
1 4474
1 4472
1 4473
SQL> select controlfile_change# from v$database;
CONTROLFILE_CHANGE#
-------------------
153914435
SQL> select archivelog_change# from v$database;
ARCHIVELOG_CHANGE#
------------------
153912062
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
153913134
153913863
153913659
153913659
153913863
153913134
153913659
153913133
153913133
153913133
153913863
CHECKPOINT_CHANGE#
------------------
153913134
153913659
153913133
153913863
153913134
153913659
153913133
18 rows selected.
SQL> select * from v$backup
2 ;
FILE# STATUS CHANGE# TIME
---------- ------------------------------------ ---------- ------------
1 NOT ACTIVE 0
2 NOT ACTIVE 0
3 NOT ACTIVE 0
4 NOT ACTIVE 0
5 NOT ACTIVE 0
6 NOT ACTIVE 0
7 NOT ACTIVE 0
8 NOT ACTIVE 0
9 NOT ACTIVE 0
10 NOT ACTIVE 0
11 NOT ACTIVE 0
FILE# STATUS CHANGE# TIME
---------- ------------------------------------ ---------- ------------
12 NOT ACTIVE 0
13 NOT ACTIVE 0
14 NOT ACTIVE 0
15 NOT ACTIVE 0
16 NOT ACTIVE 0
17 NOT ACTIVE 0
18 NOT ACTIVE 0
18 rows selected.
我开始认为可能是归档已经过期,所以运行crosscheck archivelog all
然后又做了一次热备(18点45结束)。然后又恢复,还是遇到了相同的错误。
我又去看了看archivelog "list backup of archivelog":
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
57403 784.50M SBT_TAPE 00:00:58 16-APR-09
BP Key: 57406 Status: AVAILABLE Compressed: NO Tag: TAG20090416T210415
Handle: al_4241_1_684363858 Media:
List of Archived Logs in backup set 57403
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4340 150132389 16-APR-09 150158118 16-APR-09
1 4341 150158118 16-APR-09 150181582 16-APR-09
1 4342 150181582 16-APR-09 150211583 16-APR-09
1 4343 150211583 16-APR-09 150232988 16-APR-09
1 4344 150232988 16-APR-09 150269585 16-APR-09
1 4345 150269585 16-APR-09 150296436 16-APR-09
1 4346 150296436 16-APR-09 150326478 16-APR-09
1 4347 150326478 16-APR-09 150349458 16-APR-09
1 4348 150349458 16-APR-09 150363355 16-APR-09
1 4349 150363355 16-APR-09 150363386 16-APR-09
4346 是 available的
4346 是上周四归档的 Thu, 2009-4-16.
我突然想起来,上周四,我做过一次模拟恢复是成功的,用的recover database until time.
后来有些网络问题,我就做了一个单个文件的备份实验
RMAN>backup datafile 2
datafile 2就是上面出现问题的data file 2: '/oradata/FIMASYS10G/undotbs1.dbf'
后来再做恢复测试的时候就是遇到这个问题了。
我想到先把这些归档找回来:
RMAN> run {
2> allocate channel c1 type sbt;
3> send 'NB_ORA_CLIENT=db';
4> restore archivelog from logseq 4340 until logseq 4352;
5> }
归档已经恢复到Archive的文件夹了。
这时候再运行
RMAN> run {
2> set until time "to_date('2009/04/22 19:00:00','yyyy/mm/dd hh24:mi:ss')";
3> allocate channel c1 type sbt;
4> send 'NB_ORA_CLIENT=db';
recover database;
5> 6> }
executing command: SET until clause
allocated channel: c1
channel c1: sid=322 devtype=SBT_TAPE
channel c1: VERITAS NetBackup for Oracle - Release 5.1 (2004043014)
sent command to channel: c1
Starting recover at 23-APR-09
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: '/oradata/FIMASYS10G/undotbs1.dbf'
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/23/2009 01:22:11
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 4346 lowscn 150296436 found to restore
我就奇怪了,既然全备是刚刚做的,为啥还要老早以前的归档啊???
而且有了以前的归档还是提示有问题。。。
谢谢大家给出出主意!!!
|
|