第六步,用rman恢复数据库
[Oracle@bogon admin]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Oct 25 23:23:59 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB (not mounted)
RMAN> set dbid=1587060738; (备份数据了时的DBID)
executing command: SET DBID
RMAN>
RMAN> restore controlfile from '/u01/app/dbback/config_c-1587060738-20131026-01';
Starting restore at 25-OCT-13
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
output file name=/u01/app/oracle/oradata/db/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/db/control02.ctl
Finished restore at 25-OCT-13
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database from tag='full_gpodb_data';
Starting restore at 25-OCT-13
Starting implicit crosscheck backup at 25-OCT-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 25-OCT-13
Starting implicit crosscheck copy at 25-OCT-13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 25-OCT-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 backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/db/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/db/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/db/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/db/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/db/anfei01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/db/DB/datafile/o1_mf_dbs_91x4vt9f_.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/db/dbt.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/dbback/full_09onbkhv_1_1
channel ORA_DISK_1: piece handle=/u01/app/dbback/full_09onbkhv_1_1 tag=FULL_GPODB_DATA
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:28
Finished restore at 25-OCT-13
RMAN> recover database;
Starting recover at 25-OCT-13
using channel ORA_DISK_1
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=22
channel ORA_DISK_1: reading from backup piece /u01/app/dbback/full_0aonbkl1_1_1
channel ORA_DISK_1: piece handle=/u01/app/dbback/full_0aonbkl1_1_1 tag=TAG20131026T052657
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/archiv/1_22_823244933.dbf thread=1 sequence=22
unable to find archived log
archived log thread=1 sequence=23
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/25/2013 23:32:41
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 23 and starting SCN of 1146472
RMAN> alter database open resetlogs;
database opened
RMAN> exit
数据库迁移完成
Recovery Manager complete.
oracle@bogon ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Fri Oct 25 23:14:56 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/db/system01.dbf
/u01/app/oracle/oradata/db/sysaux01.dbf
/u01/app/oracle/oradata/db/undotbs01.dbf
/u01/app/oracle/oradata/db/users01.dbf
/u01/app/oracle/oradata/db/anfei01.dbf
/u01/app/oracle/oradata/db/DB/datafile/o1_mf_dbs_96o3mf4d_.dbf
/u01/app/oracle/oradata/db/dbt.dbf
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
