利用rman进行异机还原(目录相同)
利用rman进行异机还原(目录相同)利用rman进行异机还原(目录相同)源始库:192.168.201.2目标库:192.168.201.3--192.168.201.2--rman[oracle@db01 ~]$ rman target /Recovery Manager: Release 10.2.0.1.0 - Production on Wed Sep 18 08:52:25 2013Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: ORCL (DBID=1354163930)--dbid--备份数据文件RMAN> backup database format '/u02/backup/dbf_%T_%U.bak';Starting backup at 18-SEP-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=140 devtype=DISKchannel ORA_DISK_1: starting full datafile backupsetchannel ORA_DISK_1: specifying datafile(s) in backupsetinput datafile fno=00001 name=/u02/oradata/orcl/system01.dbfinput datafile fno=00002 name=/u02/oradata/orcl/undotbs01.dbfinput datafile fno=00003 name=/u02/oradata/orcl/sysaux01.dbfinput datafile fno=00005 name=/u02/oradata/orcl/app01.dbfinput datafile fno=00004 name=/u02/oradata/orcl/users01.dbfchannel ORA_DISK_1: starting piece 1 at 18-SEP-13channel ORA_DISK_1: finished piece 1 at 18-SEP-13piece handle=/u02/backup/dbf_20130918_05ok565a_1_1.bak tag=TAG20130918T085402comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:25channel ORA_DISK_1: starting full datafile backupsetchannel ORA_DISK_1: specifying datafile(s) in backupsetincluding current control file in backupsetincluding current SPFILE in backupsetchannel ORA_DISK_1: starting piece 1 at 18-SEP-13channel ORA_DISK_1: finished piece 1 at 18-SEP-13piece handle=/u02/backup/dbf_20130918_06ok567v_1_1.bak tag=TAG20130918T085402comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:03Finished backup at 18-SEP-13--备份归档日志RMAN> backup archivelog all format '/u02/backup/arc_%T_%U.bak' delete input;Starting backup at 18-SEP-13current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting archive log backupsetchannel ORA_DISK_1: specifying archive log(s) in backup setinput archive log thread=1 sequence=33 recid=6 stamp=826448032input archive log thread=1 sequence=34 recid=7 stamp=826448303channel ORA_DISK_1: starting piece 1 at 18-SEP-13channel ORA_DISK_1: finished piece 1 at 18-SEP-13piece handle=/u02/backup/arc_20130918_07ok56dg_1_1.bak tag=TAG20130918T085823comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:02channel ORA_DISK_1: deleting archive log(s)archive log filename=/u02/archivelog/1_33_826383194.dbf recid=6 stamp=826448032archive log filename=/u02/archivelog/1_34_826383194.dbf recid=7 stamp=826448303Finished backup at 18-SEP-13--备份控制文件RMAN> backup current controlfile format '/u02/backup/ctl_%T_%U.bak';Starting backup at 18-SEP-13using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backupsetchannel ORA_DISK_1: specifying datafile(s) in backupsetincluding current control file in backupsetchannel ORA_DISK_1: starting piece 1 at 18-SEP-13channel ORA_DISK_1: finished piece 1 at 18-SEP-13piece handle=/u02/backup/ctl_20130918_08ok56fa_1_1.bak tag=TAG20130918T085922comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 18-SEP-13--192.168.201.3--关闭数据库[oracle@db02 orcl]$ sqlplus /nologSQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 18 07:39:50 2013Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL> conn /as sysdbaConnected.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.--打开数据库到nomount状态SQL> startup nomount;ORACLE instance started.Total System Global Area 734003200 bytesFixed Size 1221564 bytesVariable Size 213912644 bytesDatabase Buffers 515899392 bytesRedo 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 2013Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: orcl (not mounted)--设置dbid(与源库保持一致,如果与源库不同,则会无法恢复,后面再演示)RMAN> set dbid=1354163930executing command: SET DBID--还原控制文件RMAN> restore controlfile from '/u02/backup/ctl_20130918_0cok56kv_1_1.bak';Starting restore at 18-SEP-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=155 devtype=DISKchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:02output filename=/u02/oradata/orcl/control01.ctloutput filename=/u02/oradata/orcl/control02.ctloutput filename=/u02/oradata/orcl/control03.ctlFinished restore at 18-SEP-13--打开数据库到mount状态RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1--还原数据库RMAN> restore database;Starting restore at 18-SEP-13Starting implicit crosscheck backup at 18-SEP-13allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=155 devtype=DISKCrosschecked 11 objectsFinished implicit crosscheck backup at 18-SEP-13Starting implicit crosscheck copy at 18-SEP-13using channel ORA_DISK_1Finished implicit crosscheck copy at 18-SEP-13searching for all files in the recovery areacataloging files...no files catalogedusing channel ORA_DISK_1channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /u02/oradata/orcl/system01.dbfrestoring datafile 00002 to /u02/oradata/orcl/undotbs01.dbfrestoring datafile 00003 to /u02/oradata/orcl/sysaux01.dbfrestoring datafile 00004 to /u02/oradata/orcl/users01.dbfrestoring datafile 00005 to /u02/oradata/orcl/app01.dbfchannel ORA_DISK_1: reading from backup piece /u02/backup/dbf_20130918_09ok56i6_1_1.bakchannel ORA_DISK_1: restored backup piece 1piece handle=/u02/backup/dbf_20130918_09ok56i6_1_1.bak tag=TAG20130918T090054channel ORA_DISK_1: restore complete, elapsed time: 00:00:45Finished restore at 18-SEP-13--恢复数据库RMAN> recover database;Starting recover at 18-SEP-13using channel ORA_DISK_1starting media recoverychannel ORA_DISK_1: starting archive log restore to default destinationchannel ORA_DISK_1: restoring archive logarchive log thread=1 sequence=35channe上一个:复合索引的前导列如何选择
下一个:转发Oracle split函数