oracle 10g rman备份与恢复之五(二)
查看控制文件是否恢复
[root@redhat wolf]# ls
control01.ctl control03.ctl redo03.log temp01.dbf
control01.ctl.bak redo01.log sysaux01.dbf undotbs01.dbf
control02.ctl redo02.log system01.dbf users01.dbf
打开数据库到mount状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
恢复数据库
RMAN> recover database;
Starting recover at 21-4月 -13
Starting implicit crosscheck backup at 21-4月 -13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 2 objects
Finished implicit crosscheck backup at 21-4月 -13
Starting implicit crosscheck copy at 21-4月 -13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 21-4月 -13
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
File Name: /oracle/ora10g/flash_recovery_area/WOLF/backupset/2013_04_21/o1_mf_ncsnf_TAG20130421T095042_8q7vtb8b_.bkp
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 2 is already on disk as file /oracle/ora10g/oradata/wolf/redo01.log
archive log filename=/oracle/ora10g/oradata/wolf/redo01.log thread=1 sequence=2
media recovery complete, elapsed time: 00:00:07
Finished recover at 21-4月 -13
启动数据库
RMAN> alter database open resetlogs;
database opened
sqlplus登录,查看数据库是否正常
[oracle@redhat ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期日 4月 21 10:46:37 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from dual;
D
-
X
=====================================================================================
日志文件的恢复
redolog file 丢失
shutdown immediate
startup mount
alter database resetlogs
==========================================================================================
全库备份(包括控制文件,参数文件,数据文件等)
RMAN> backup database plus archivelog delete input;
Starting backup at 22-4月 -13
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=134 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=7 recid=1 stamp=789518526
input archive log thread=1 sequence=8 recid=2 stamp=789537831
input archive log thread=1 sequence=9 recid=3 stamp=789537832
input archive log thread=1 sequence=15 recid=4 stamp=790907119
input archive log thread=1 sequence=16 recid=5 stamp=790907334
input archive log thread=1 sequence=17 recid=6 stamp=790907455
input archive log thread=1 sequence=18 recid=7 stamp=812676920
input archive log thread=1 sequence=19 recid=8 stamp=812681195
input archive log thread=1 sequence=20 recid=9 stamp=812682116
input archive log thread=1 sequence=21 recid=10 stamp=812950223
input archive log thread=1 sequence=22 recid=11 stamp=813103853
input archive log thread=1 sequence=23 recid=12 stamp=813402380
channel ORA_DISK_1: starting piece 1 at 22-4月 -13
channel ORA_DISK_1: finished piece 1 at 22-4月 -13
piece handle=/opt/app/oracle/flash_recovery_area/WOLF/b