flashbackup闪回数据库
生活随笔
收集整理的這篇文章主要介紹了
flashbackup闪回数据库
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
某時間刪除了一個表
SQL> delete test1;50000 rows deleted.1、關(guān)閉數(shù)據(jù)庫,啟動到mount狀態(tài)(abort數(shù)據(jù)庫能快速關(guān)閉,但是可能會丟數(shù)據(jù))
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount;2、基于時間戳閃回數(shù)據(jù)庫(20:55)
SQL> flashback database to timestamp to_timestamp('2015-09-22 20:55:00','yyyy-mm-dd hh24:mi:ss');Flashback complete.
3、以只讀模式打開數(shù)據(jù)庫
SQL> alter database open read only;Database altered.4、查看表是否閃回
SQL>select count(*) from test1;COUNT(*)
----------50000
5、上述說明20:55分數(shù)據(jù)庫是沒有刪除的,而數(shù)據(jù)庫其他的表也有讀寫數(shù)據(jù),所以盡可能的閃回到表被刪除的那個時間的臨界點6、關(guān)閉數(shù)據(jù)庫
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount;7、基于時間戳閃回數(shù)據(jù)庫(20:59)
SQL> flashback database to timestamp to_timestamp('2015-09-22 20:59:00','yyyy-mm-dd hh24:mi:ss');Flashback complete.8、以只讀模式打開數(shù)據(jù)庫
SQL> alter database open read only;Database altered.9、查看表是否存在
SQL> select count(*) from test1;COUNT(*)
----------0
10、重復(fù)執(zhí)行基于時間閃回數(shù)據(jù)庫(20:57)
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount;
SQL> flashback database to timestamp to_timestamp('2015-09-22 20:57:00','yyyy-mm-dd hh24:mi:ss');Flashback complete.
SQL> alter database open read only;11、查看表是否存在
SQL> select count(*) from test1;COUNT(*)
----------5000012、以RESETLOGS模式打開數(shù)據(jù)庫,讓數(shù)據(jù)庫日志重置
SQL> alter database open resetlogs;Database altered.
?
轉(zhuǎn)載于:https://www.cnblogs.com/houzhiqing/p/4833378.html
總結(jié)
以上是生活随笔為你收集整理的flashbackup闪回数据库的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android第二十步摄像
- 下一篇: 环信小程序 Demo源码发布,让你的小程