利用rman进行异机还原(目录相同)(二)

2014-11-24 16:26:28 · 作者: · 浏览: 2
1
Finished backup at 18-SEP-13
--192.168.201.3
--关闭 数据库
[oracle@db02 orcl]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 18 07:39:50 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
--打开数据库到nomount状态
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 734003200 bytes
Fixed Size 1221564 bytes
Variable Size 213912644 bytes
Database Buffers 515899392 bytes
Redo Buffers 2969600 bytes
--rman
[oracle@db02 bdump]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Sep 18 09:02:02 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: orcl (not mounted)
--设置dbid(与源库保持一致,如果与源库不同,则会无法恢复,后面再演示)
RMAN> set dbid=1354163930
executing command: SET DBID
--还原控制文件
RMAN> restore controlfile from '/u02/backup/ctl_20130918_0cok56kv_1_1.bak';
Starting restore at 18-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/u02/oradata/orcl/control01.ctl
output filename=/u02/oradata/orcl/control02.ctl
output filename=/u02/oradata/orcl/control03.ctl
Finished restore at 18-SEP-13
--打开数据库到mount状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
--还原数据库
RMAN> restore database;
Starting restore at 18-SEP-13
Starting implicit crosscheck backup at 18-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
Crosschecked 11 objects
Finished implicit crosscheck backup at 18-SEP-13
Starting implicit crosscheck copy at 18-SEP-13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 18-SEP-13
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 00001 to /u02/oradata/orcl/system01.dbf
restoring datafile 00002 to /u02/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /u02/oradata/orcl/sysaux01.dbf
restoring datafile 00004 to /u02/oradata/orcl/users01.dbf
restoring datafile 00005 to /u02/oradata/orcl/app01.dbf
channel ORA_DISK_1: reading from backup piece /u02/backup/dbf_20130918_09ok56i6_1_1.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/u02/backup/dbf_20130918_09ok56i6_1_1.bak tag=TAG20130918T090054
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 18-SEP-13
--恢复数据库
RMAN> recover database;
Starting recover at 18-SEP-13
using channel ORA_DISK_1
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=35
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=36
channel ORA_DISK_1: reading from backup piece /u02/backup/