国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

使用RMAN進行基于時間點的不完全恢復

2024-07-21 02:32:42
字體:
供稿:網(wǎng)友
上周一個朋友的數(shù)據(jù)庫發(fā)生誤刪除操作,請我?guī)兔M行恢復。
由于備份比較充分,所以只需要通過RMAN進行一個基于時間點(這個時間點需要根據(jù)故障時間進行判定選取)。 首先啟動實例:
[Oracle@stat ~]$ eXPort ORACLE_SID=order
[oracle@stat ~]$ rman target / Recovery Manager: Release 10.2.0.2.0 - PRodUCtion on Thu Sep 14 22:43:50 2006Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database (not started)RMAN> set DBID=1341966532executing command: SET DBIDRMAN> startup nomount;Oracle instance startedTotal System Global Area 2483027968 bytesFixed Size 1262344 bytes
Variable Size 654314744 bytes
Database Buffers 1811939328 bytes
Redo Buffers 15511552 bytes
恢復數(shù)據(jù)文件并加載(mount)數(shù)據(jù)庫:
RMAN> restore controlfile from autobackup; Starting restore at 14-SEP-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=541 devtype=DISKchannel ORA_DISK_1: looking for autobackup on day: 20060914
channel ORA_DISK_1: autobackup found: c-1341966532-20060914-02
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/oradata/controlfile/o1_mf_28spy45z_.ctl
output filename=/oradata/controlfile/o2_mf_28spy45z_.ctl
Finished restore at 14-SEP-06RMAN> alter database mount;database mounted
released channel: ORA_DISK_1
Restore數(shù)據(jù)庫:
RMAN> restore database; Starting restore at 14-SEP-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=541 devtype=DISKchannel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/datafile/o1_mf_system_28spy7kl_.dbf
restoring datafile 00002 to /oradata/datafile/o1_mf_undotbs1_28spykdh_.dbf
restoring datafile 00003 to /oradata/datafile/o1_mf_sysaux_28spyo9s_.dbf
restoring datafile 00004 to /oradata/datafile/o1_mf_users_28spyvm8_.dbf
restoring datafile 00005 to /oradata/datafile/o1_mf_vascms_2c444bhj_.dbf
restoring datafile 00006 to /oradata/datafile/o1_mf_wapgame_2c44gz55_.dbf
restoring datafile 00007 to /oradata/datafile/o1_mf_vascms_2c4kn0b2_.dbf
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/full_ORDER_20060913_169
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_ORDER_20060913_169 tag=order
channel ORA_DISK_1: restore complete, elapsed time: 00:03:06
Finished restore at 14-SEP-06

進行基于時間點的恢復:
RMAN> recover database until time '2006-09-14 19:00:00'
2> ; Starting recover at 14-SEP-06
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/14/2006 22:49:54
ORA-01861: literal does not match format stringRMAN> exit
Recovery Manager complete.
這個錯誤是由于時間日期格式設(shè)置的問題。設(shè)置正確的時間格式,進行基于時間點的不完全恢復:
[oracle@stat ~]$ export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
[oracle@stat ~]$ rman target / Recovery Manager: Release 10.2.0.2.0 - Production on Thu Sep 14 22:50:22 2006Copyright (c) 1982, 2005, Oracle. All rights reserved.connected to target database: order (DBID=1341966532, not open)RMAN> recover database until time '2006-09-14 19:00:00'
2> ;Starting recover at 2006-09-14 22:50:26
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=544 devtype=DISKstarting media recoveryarchive log thread 1 sequence 303 is already on disk as file
/oradata/archive/1_303_592917188.dbf
archive log thread 1 sequence 304 is already on disk as file
/oradata/archive/1_304_592917188.dbf
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=299
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/arch_order_20060913_171
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderarch_order_20060913_171 tag=order
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
archive log filename=/oradata/archive/1_299_592917188.dbf thread=1 sequence=299
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=300
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=301
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=302
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/arch_order_20060914_173
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderarch_order_20060914_173 tag=TAG20060914T033004
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
archive log filename=/oradata/archive/1_300_592917188.dbf thread=1 sequence=300
archive log filename=/oradata/archive/1_301_592917188.dbf thread=1 sequence=301
archive log filename=/oradata/archive/1_302_592917188.dbf thread=1 sequence=302
archive log filename=/oradata/archive/1_303_592917188.dbf thread=1 sequence=303
archive log filename=/oradata/archive/1_304_592917188.dbf thread=1 sequence=304
media recovery complete, elapsed time: 00:00:57
Finished recover at 2006-09-14 22:51:39

Resetlogs打開數(shù)據(jù)庫:
RMAN> alter database open resetlogs; database openedRMAN>
此時可以檢查數(shù)據(jù)的正確性,假如無誤就可以通過exp導出數(shù)據(jù),再imp進生產(chǎn)數(shù)據(jù)庫,完成恢復。在有了充分的備份的前提下,這樣的恢復是非常輕易的。
這個故事再次告訴我們:備份重于一切。-The End-原文地址:http://www.eygle.com/archives/2006/09/rman_until_time_recovery.Html

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 田林县| 大宁县| 宁武县| 北安市| 金塔县| 望都县| 文水县| 江孜县| 新兴县| 新乡县| 永兴县| 潮安县| 澄迈县| 天津市| 宁城县| 鹤峰县| 苍南县| 玉田县| 建平县| 华阴市| 竹溪县| 宽城| 夹江县| 锡林浩特市| 汽车| 白水县| 微山县| 托克逊县| 安塞县| 蓝山县| 泾川县| 南陵县| 崇仁县| 巩义市| 东辽县| 呈贡县| 渝中区| 循化| 利津县| 喜德县| 吉林省|