ITPub博客

首页 > Linux操作系统 > Linux操作系统 > restore controlfile

restore controlfile

原创 Linux操作系统 作者:laojiu9 时间:2009-06-25 16:20:05 0 删除 编辑

restore controlfile from autobackup

这种控制文件的的恢复的方法是在rman配置了autobackup的时候使用,在使用该命令的时候,oracle会到备份的目录下为你自动找到备份文件.

若是autobackup为off,oracle不会在你备份的时候,为你自动备份控制文件,这样是不提倡的,那你应该手动的备份控制文件,

如果所有的数据文件,日志文件,控制文件丢失,需要你手工的恢复控制文件,在执行恢复:

restore controlfile to 'xxxxxx(还原的控制文件的路径)'   from 'xxxxxxxxx(备份路径)'

下面在的例子是在备份的时候没有设置控制文件的自动备份,然后把数据文件,日志文件,控制文件删除

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>rman target sys/sys@rman

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jun 25 16:07:02 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)


RMAN> startup nomount

Oracle instance started

Total System Global Area     289406976 bytes

Fixed Size                     1248576 bytes
Variable Size                 88081088 bytes
Database Buffers             192937984 bytes
Redo Buffers                   7139328 bytes

RMAN> restore controlfile to 'D:\oracle\oradata\rman\CONTROL01.CTL' from 'c:\bak

2> \20090624_RMAN_80_1.CTL';
(其他的可以拷贝了,修改一下名字就行了)

Starting restore at 25-JUN-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 25-JUN-09

RMAN> alter database mount
2> ;

database mounted
released channel: ORA_DISK_1

RMAN> restore database
2> ;

Starting restore at 25-JUN-09
Starting implicit crosscheck backup at 25-JUN-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 79 objects
Finished implicit crosscheck backup at 25-JUN-09

Starting implicit crosscheck copy at 25-JUN-09
using channel ORA_DISK_1
Finished implicit crosscheck copy at 25-JUN-09

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to D:\ORACLE\ORADATA\RMAN\SYSAUX01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_43_1.LEV0
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_43_1.LEV0 tag=DBL0
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to D:\ORACLE\ORADATA\RMAN\UNDOTBS01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\RMAN\EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_44_1.LEV0
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_44_1.LEV0 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 00001 to D:\ORACLE\ORADATA\RMAN\SYSTEM01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_42_1.LEV0
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_42_1.LEV0 tag=DBL0
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to D:\ORACLE\ORADATA\RMAN\USERS01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_77_1.USERS
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_77_1.USERS tag=TSUSERS
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 25-JUN-09


RMAN> recover database
2> ;

Starting recover at 25-JUN-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: D:\ORACLE\ORADATA\RMAN\SYSTEM01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_50_1.LEV1
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_50_1.LEV1 tag=DBL1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: D:\ORACLE\ORADATA\RMAN\UNDOTBS01.DBF
destination for restore of datafile 00003: D:\ORACLE\ORADATA\RMAN\SYSAUX01.DBF
destination for restore of datafile 00005: D:\ORACLE\ORADATA\RMAN\EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_51_1.LEV1
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_51_1.LEV1 tag=DBL1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: D:\ORACLE\ORADATA\RMAN\SYSTEM01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_57_1.LEV2
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_57_1.LEV2 tag=DBL2
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: D:\ORACLE\ORADATA\RMAN\UNDOTBS01.DBF
destination for restore of datafile 00003: D:\ORACLE\ORADATA\RMAN\SYSAUX01.DBF
destination for restore of datafile 00005: D:\ORACLE\ORADATA\RMAN\EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_58_1.LEV2
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_58_1.LEV2 tag=DBL2
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: D:\ORACLE\ORADATA\RMAN\SYSTEM01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_70_1.LEV2
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_70_1.LEV2 tag=DBL2
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: D:\ORACLE\ORADATA\RMAN\UNDOTBS01.DBF
destination for restore of datafile 00003: D:\ORACLE\ORADATA\RMAN\SYSAUX01.DBF
destination for restore of datafile 00005: D:\ORACLE\ORADATA\RMAN\EXAMPLE01.DBF
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_71_1.LEV2
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_71_1.LEV2 tag=DBL2
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03

starting media recovery

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=25
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_74_1.ARCH
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_74_1.ARCH tag=TAG20090624T160447
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=C:\ARCHIVE\ARC00025_0690389201.001 thread=1 sequence=25
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=26
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_75_1.ARCH
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_75_1.ARCH tag=TAG20090624T160447
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archive log filename=C:\ARCHIVE\ARC00026_0690389201.001 thread=1 sequence=26
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=27
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=28
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_78_1.ARCH
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_78_1.ARCH tag=TAG20090624T162459
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=C:\ARCHIVE\ARC00027_0690389201.001 thread=1 sequence=27
archive log filename=C:\ARCHIVE\ARC00028_0690389201.001 thread=1 sequence=28
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=29
channel ORA_DISK_1: reading from backup piece C:\BAK\20090624_RMAN_79_1.ARCH
channel ORA_DISK_1: restored backup piece 1
piece handle=C:\BAK\20090624_RMAN_79_1.ARCH tag=TAG20090624T162459
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=C:\ARCHIVE\ARC00029_0690389201.001 thread=1 sequence=29
unable to find archive log
archive log thread=1 sequence=30
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/25/2009 16:14:38
RMAN-06054: media recovery requesting unknown log: thread 1 seq 30 lowscn 601815


RMAN> alter database open resetlogs;

database opened

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11782778/viewspace-607550/,如需转载,请注明出处,否则将追究法律责任。

上一篇: set dbid=XXXXXXX
下一篇: 坏块
请登录后发表评论 登录
全部评论

注册时间:2008-08-17

  • 博文量
    30
  • 访问量
    66581