一个alter database open resetlogs后的一个问题!

[复制链接]
查看11 | 回复9 | 2007-9-26 18:42:10 | 显示全部楼层 |阅读模式
基于时间点的恢复:
alter database open resetlogs 后发现恢复的时间点不正确,没有得到想要的数据,但是我再用之前的那个备份再做同样的事情是,报了个"该备份在resetlogs之前,不可用"。
查了一下资料:
不完全恢复之后,都必须用resetlogs的方式打开数据库,建议马上再做一次全备份,因为resetlogs之后再用以前的备份恢复是很难了。
如果不能使用这个备份,那我想要得那些数据是否要通过其他方法?
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
做不完全恢复之前需要对数据库做一个冷备份
如果是10g应该没有问题,可以使用以前的备份进行不完全恢复
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
我觉得不完全恢复之前还是先备份下,这样还能有后悔药
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
最初由 luckysea 发布
[B]做不完全恢复之前需要对数据库做一个冷备份
如果是10g应该没有问题,可以使用以前的备份进行不完全恢复 [/B]

不是,我现在的问题是基于一个相同的备份集,可以做多次不完全恢复么?
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
说到冷备份啊。有一次太险了,教训阿。做dba真的是要胆大心细!
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
最初由 seamanczg1984 发布
[B]
不是,我现在的问题是基于一个相同的备份集,可以做多次不完全恢复么? [/B]

你说的不错,但问题是你已经resetlog打开过了,incarnation已经不一样了,所以要用原来的备份必须设置到那个incarnation才行
list incarnation;
reset database to incarnation n;
然后再做restore,按照这个办法再试试看
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
最初由 bluemoon0083 发布
[B]
你说的不错,但问题是你已经resetlog打开过了,incarnation已经不一样了,所以要用原来的备份必须设置到那个incarnation才行
list incarnation;
reset database to incarnation n;
然后再做restore,按照这个办法再试试看 [/B]

这个应该是基于recovery catalog 的设置吧,我是用controlfile 的,好像不可以。
RMAN> run
2> {allocate channel c1 type disk;
3> set until time '2007-08-27 23:18:09';
4> restore database;
5> recover database;
6> sql 'alter database open resetlogs';
7> release channel c1;
8> }
released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=13 devtype=DISK
executing command: SET until clause
Starting restore at 2007-08-27 23:29:15
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\ORCL\CWMLITE01.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\ORCL\DRSYS01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
restoring datafile 00006 to D:\ORACLE\ORADATA\ORCL\INDX01.DBF
restoring datafile 00007 to D:\ORACLE\ORADATA\ORCL\ODM01.DBF
restoring datafile 00008 to D:\ORACLE\ORADATA\ORCL\TOOLS01.DBF
restoring datafile 00009 to D:\ORACLE\ORADATA\ORCL\USERS01.DBF
restoring datafile 00010 to D:\ORACLE\ORADATA\ORCL\XDB01.DBF
restoring datafile 00011 to D:\ORACLE\ORADATA\ORCL\DEMO01.DBF
channel c1: restored backup piece 1
piece handle=D:\BACKUP_FULL.BAK tag=TAG20070827T230819 params=NULL
channel c1: restore complete
Finished restore at 2007-08-27 23:35:56
Starting recover at 2007-08-27 23:35:56
starting media recovery
archive log thread 1 sequence 7 is already on disk as file D:\ORACLE\ORADATA\
L\REDO03.LOG
archive log filename=D:\ORACLE\ORADATA\ORCL\REDO03.LOG thread=1 sequence=7
media recovery complete
Finished recover at 2007-08-27 23:36:14
sql statement: alter database open resetlogs
released channel: c1
RMAN> list incarnation;

List of Database Incarnations
DB KeyInc Key DB NameDB ID
CUR Reset SCNReset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1153880493 NO87693752007-08-27 00:08:56
2 2 ORCL 1153880493 YES 88996042007-08-27 23:36:15
RMAN> reset database to incarnation 1;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of reset command at 08/27/2007 23:41:24
RMAN-06002: command not allowed when not connected to a recovery catalog
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
你不能用 已经做过alter database open reset logs 的 controlfile 了。 你要把所有备份的 datafile , control file 都重新 复制过来才可以。 或者 重建 controlfile
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
控制文件改成旧的控制文件,再做一次不完全恢复
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
最初由 ysjxjf 发布
[B]你不能用 已经做过alter database open reset logs 的 controlfile 了。 你要把所有备份的 datafile , control file 都重新 复制过来才可以。 或者 重建 controlfile [/B]

楼主的库应该是9i吧,看了下文档和10g这方面还是有区别的
9i
Restrictions and Usage Notes
Execute RESET DATABASE only at the RMAN prompt.
You must be connected to the target database and a recovery catalog.
You cannot specify TO INCARNATION unless the database is started NOMOUNT. If
you mount a control file from an incarnation after the desired incarnation, then
RESET DATABASE TO INCARNATION fails because of a control file mismatch. If
you mount the control file from the desired incarnation and then run RESET DATABASE TO INCARNATION, then the connection to the target database and
recovery catalog fails due to an incarnation mismatch.
10g
Restrictions and Usage Notes
■ Execute RESET DATABASE only at the RMAN prompt.
■ You must be connected to the target database.
■A recovery catalog connection is optional.[/COLOR] Unlike in catalog mode, RESET
DATABASE in nocatalog mode changes the incarnation only for the current RMAN
session.
■ If RMAN is connected NOCATALOG, then you can only specify TO INCARNATION if
the database is mounted and the control file contains a record of the prior
incarnation. If you do not run RESET DATABASE, RMAN recovers to the last
incarnation recorded in the control file.
■ If RMAN is connected in CATALOG mode, then you can specify TO INCARNATION
when the database is mounted. If database is mounted, however, then the control
file must have a record of the prior incarnation.
就像ysjxjf所说的应该要用老的控制文件才可以或者重建,实在不行的话就用dbms_backup_restore包吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行