同系统oracle rman异机数据库移植,oracle rman备份和恢复详解(五)
100% 38MB 469.8KB/s 01:22
db_full_0ond8mo9_1_1.bkp 100% 13MB 528.1KB/s 00:25
db_full_0pnd8mob_1_1.bkp 100% 663MB 264.7KB/s 42:45
db_full_0qnd8mob_1_1.bkp 100% 419MB 661.8KB/s 10:48
db_full_0rnd8mq4_1_1.bkp 100% 9568KB 3.1MB/s 00:03
db_full_0snd8mqs_1_1.bkp 100% 96KB 96.0KB/s 00:01
db_full_0tnd8mro_1_1.bkp 100% 8192 8.0KB/s 00:00 www.2cto.com
spfile20120611.bak 100% 96KB 96.0KB/s 00:00
三、开始恢复过程
1)数据库启动到nomount
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Jun 11 10:13:09 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> set dbid=1290854593 --这个dbdi是从源数据库记过来的,可是select dbdi from v$DATABASE找到
executing command: SET DBID
RMAN> startup nomount
Oracle instance started
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
2)首先恢复参数文件
RMAN> restore spfile from '/u01/backup/spfile20120611.bak';
Starting restore at 11-JUN-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/backup/spfile20120611.bak
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 11-JUN-12
3)其次恢复控制文件
要先把数据库强制启动到nomount状态,意思是使刚才恢复的spfile生效,如下:
RMAN> startup nomount force;
Oracle instance started
Total System Global Area 539848704 bytes
Fixed Size 1337748 bytes
Variable Size 406849132 bytes
Database Buffers 125829120 bytes
Redo Buffers 5832704 bytes
RMAN> restore controlfile from '/u01/backup/controlfile20120611.bak';
Starting restore at 11-JUN-12
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 11-JUN-12
4)把数据库启动到mount状态,
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 11-JUN-12
Starting implicit crosscheck backup at 11-JUN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 27 objects www.2cto.com
Finished implicit crosscheck backup at 11-JUN-12
Starting implicit crosscheck copy at 11-JUN-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 11-JUN-12
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/o