您的位置:首页技术文章
文章详情页

Oracle数据库不完全恢复实例

【字号: 日期:2023-11-19 19:50:26浏览:2作者:猪猪
1、; 环境:操作系统aix5.2,数据库Oracle9.22、; 模拟环境:1)首先使用rman作整个数据库备份2)时间:# dateTue Aug 23 17:35:19 BEIDT 20053)操作:sql>truncate table scott.emp3、; 恢复数据库到2005年8月23日17点35分19秒4、; 数据库到mount状态5、; 设置变量$set nls_date_format=yyyy-mm-dd:hh24:mi:ss6、; 连接到rman$rman target / catalog rman/rman@omsora9RMAN> run {2> set until time='to_date('2005-08-23:17:35:19','yyyy-mm-dd:hh24:mi:ss')';3> restore database;4> recover database;5> }executing command: SET until clauseStarting restore at 23-AUG-05allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=14 devtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid=15 devtype=DISKallocated channel: ORA_DISK_3channel ORA_DISK_3: sid=16 devtype=DISKallocated channel: ORA_DISK_4channel ORA_DISK_4: sid=17 devtype=DISKchannel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00003 to /oradata/hb130000/cwmlite01.dbfrestoring datafile 00010 to /oradata/hb130000/xdb01.dbfrestoring datafile 00012 to /oradata/hb130000/GFB.DBFrestoring datafile 00013 to /oradata/hb130000/CA.dbfrestoring datafile 00017 to /oradata/hb130000/GDSS.dbfchannel ORA_DISK_2: starting datafile backupset restorechannel ORA_DISK_2: specifying datafile(s) to restore from backup setrestoring datafile 00004 to /oradata/hb130000/drsys01.dbfrestoring datafile 00005 to /oradata/hb130000/example01.dbfrestoring datafile 00006 to /oradata/hb130000/indx01.dbfrestoring datafile 00014 to /oradata/hb130000/QUEST.dbfrestoring datafile 00018 to /oradata/hb130000/FPJKDB.dbfchannel ORA_DISK_3: starting datafile backupset restorechannel ORA_DISK_3: specifying datafile(s) to restore from backup setrestoring datafile 00002 to /oradata/hb130000/undotbs01.dbfrestoring datafile 00007 to /oradata/hb130000/odm01.dbfrestoring datafile 00009 to /oradata/hb130000/users01.dbfrestoring datafile 00011 to /oradata/hb130000/YSZX130000002005.DBFrestoring datafile 00015 to /oradata/hb130000/FOGLIGHT.dbfchannel ORA_DISK_4: starting datafile backupset restorechannel ORA_DISK_4: specifying datafile(s) to restore from backup setrestoring datafile 00001 to /oradata/hb130000/system01.dbfrestoring datafile 00008 to /oradata/hb130000/tools01.dbfrestoring datafile 00016 to /oradata/hb130000/gwd.dbfrestoring datafile 00019 to /oradata/hb130000/tgggg.dbfchannel ORA_DISK_2: restored backup piece 1piece handle=/oradata/rmanbackup/df_HB130000_567080235_66_1.bak tag=TAG20050823T 101715 params=NULLchannel ORA_DISK_2: restore completechannel ORA_DISK_3: restored backup piece 1piece handle=/oradata/rmanbackup/df_HB130000_567080235_67_1.bak tag=TAG20050823T101715 params=NULLchannel ORA_DISK_3: restore completechannel ORA_DISK_1: restored backup piece 1piece handle=/oradata/rmanbackup/df_HB130000_567080236_68_1.bak tag=TAG20050823T101715 params=NULLchannel ORA_DISK_1: restore completechannel ORA_DISK_4: restored backup piece 1piece handle=/oradata/rmanbackup/df_HB130000_567080237_69_1.bak tag=TAG20050823T101715 params=NULLchannel ORA_DISK_4: restore completeFinished restore at 23-AUG-05Starting recover at 23-AUG-05using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4starting media recoveryarchive log thread 1 sequence 4 is already on disk as file /oradata/rmanbackup/archive/hb130000_1_4.dbfchannel ORA_DISK_1: starting archive log restore to default destinationchannel ORA_DISK_1: restoring archive logarchive log thread=1 sequence=3channel ORA_DISK_1: restored backup piece 1piece handle=/oradata/rmanbackup/df_HB130000_567080296_72_1.bak tag=TAG20050823T101815 params=NULLchannel ORA_DISK_1: restore completearchive log filename=/oradata/rmanbackup/archive/hb130000_1_3.dbf thread=1 sequence=3media recovery completeFinished recover at 23-AUG-05RMAN>7、; 连接到数据库$sqlplus nologsql>conn / as sysdbaconnectedsql>alter database open resetlogsdatabase altered.8、查询表scott.emp数据得到恢复。
标签: Oracle 数据库