1.rman全备数据库,归档日志,设置自动备份控制文件及参数据文件
run {
allocate channel 'dev1' type disk ;
allocate channel 'dev2' type disk ;
allocate channel 'dev3' type disk ;
backup incremental level 0tag 'dbL0' format '/u03/rman_database/%T_dbfull_%u_%p_%c' database skip readonly;
backupcurrent controlfile format '/u03/rman_control/%T_control_%u';
sql 'alter system archive log current' ;
backup filesperset 3 archivelog allformat '/u03/rman_archivelog/%T_arch_%u_%p_%c';
release channel dev1;
release channel dev2;
release channel dev3;
}
备份过程:
.....
.....
put archive log thread=1 sequence=7 recid=96 stamp=664369971
channel dev3: starting piece 1 at 02-SEP-08
channel dev1: starting archive log backupset
channel dev1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=98 stamp=664370241
input archive log thread=1 sequence=2 recid=99 stamp=664370241
input archive log thread=1 sequence=3 recid=100 stamp=664370246
channel dev1: starting piece 1 at 02-SEP-08
channel dev1: finished piece 1 at 02-SEP-08
piece handle=/u03/rman_archivelog/20080902_arch_4ijpiv54_1_1 tag=TAG20080902T111848 comment=NONE
channel dev1: backup set complete, elapsed time: 00:00:02
channel dev2: finished piece 1 at 02-SEP-08
piece handle=/u03/rman_archivelog/20080902_arch_4gjpiv54_1_1 tag=TAG20080902T111848 comment=NONE
channel dev2: backup set complete, elapsed time: 00:00:02
channel dev3: finished piece 1 at 02-SEP-08
piece handle=/u03/rman_archivelog/20080902_arch_4hjpiv54_1_1 tag=TAG20080902T111848 comment=NONE
channel dev3: backup set complete, elapsed time: 00:00:02
channel dev1: starting archive log backupset
channel dev1: specifying archive log(s) in backup set
input archive log thread=1 sequence=4 recid=101 stamp=664370325
input archive log thread=1 sequence=5 recid=102 stamp=664370327
channel dev1: starting piece 1 at 02-SEP-08
channel dev1: finished piece 1 at 02-SEP-08
piece handle=/u03/rman_archivelog/20080902_arch_4jjpiv56_1_1 tag=TAG20080902T111848 comment=NONE
channel dev1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-SEP-08
Starting Control File and SPFILE Autobackup at 02-SEP-08
piece handle=/u03/rman_control/c-1216224761-20080902-09 comment=NONE
Finished Control File and SPFILE Autobackup at 02-SEP-08
released channel: dev1
released channel: dev2
released channel: dev3
RMAN>
2. 11:54:44 SQL>drop tablespace tms including contents and datafiles;
Tablespace dropped.
现在想对数据库进行不完全恢复到2008-09-02 11:54:44 这个时间点.
恢复思路:
3.由于控制文件发生变化,首先还原控制文件
RMAN> startup nomount;
Oracle instance started
Total System Global Area1694498816 bytes
Fixed Size
1219808 bytes
Variable Size
721421088 bytes
Database Buffers
956301312 bytes
Redo Buffers
15556608 bytes
RMAN> restore controlfile from autobackup;
Starting restore at 02-SEP-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: looking for autobackup on day: 20080902
channel ORA_DISK_1: autobackup found: /u03/rman_control/c-1216224761-20080902-0a
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u01/oracle/oradata/autodb/control01.ctl
output filename=/u01/oracle/oradata/autodb/control02.ctl
output filename=/u01/oracle/oradata/autodb/control03.ctl
Finished restore at 02-SEP-08
4.控制文件恢复成功,加载数据库,然后还原数据文件
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 02-SEP-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/oracle/oradata/autodb/tms01.dbf
restoring datafile 00005 to /u01/oracle/oradata/autodb/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /u03/rman_database/20080902_dbfull_4sjpj11e_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u03/rman_database/20080902_dbfull_4sjpj11e_1_1 tag=DBL0
channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oracle/oradata/autodb/system01.dbf
restoring datafile 00008 to /u01/oracle/oradata/autodb/test02.dbf
channel ORA_DISK_1: reading from backup piece /u03/rman_database/20080902_dbfull_4qjpj11e_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u03/rman_database/20080902_dbfull_4qjpj11e_1_1 tag=DBL0
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /u01/oracle/oradata/autodb/sysaux01.dbf
restoring datafile 00004 to /u01/oracle/oradata/autodb/test01.dbf
channel ORA_DISK_1: reading from backup piece /u03/rman_database/20080902_dbfull_4rjpj11e_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u03/rman_database/20080902_dbfull_4rjpj11e_1_1 tag=DBL0
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/02/2008 12:12:45
ORA-19653: cannot switch to older file incarnation
为什么会出现这样的情况,如何解决啊,困了好久了
时间我改过来了,删除表空间的时候,发贴子时忘了修改.
[ 本帖最后由 ah_cx 于 2008-9-2 12:36 编辑 ]
|