flashback database測試
情景描述:使用者對錶誤進行了truncate操作。(需資料庫不完全恢復)
--檢視測試表及資料
SQL> select * from test;
ID NAME
---------- --------------------
1 yallonking
2 yallonking
3 yallonking
4 oraking
5 oraking
6 afterchange
6 rows selected.
--對錶truncate
SQL> truncate table test;
Table truncated.
-嘗試閃回truncate的表
SQL> flashback table test to before drop;
flashback table test to before drop
*
ERROR at line 1:
ORA-38305: object not in RECYCLE BIN
--檢視當前時間
SQL> select to_char(sysdate,'yyyy/mm/dd hh24:mi:ss') from dual;
TO_CHAR(SYSDATE,'YY
-------------------
2012/04/03 23:40:52
--將資料庫重啟動至mount階段
SQL> conn /as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 422670336 bytes
Fixed Size 1336960 bytes
Variable Size 318769536 bytes
Database Buffers 96468992 bytes
Redo Buffers 6094848 bytes
Database mounted.
--將資料庫閃回至合適時間點
SQL> flashback database to timestamp to_timestamp('2012/04/03 23:35:52','yyyy/mm/dd hh24:mi:ss');
Flashback complete.
SQL> alter database open read only;
Database altered.
--如果沒有返回到正確時間點,需要重複以上操作
SQL> select * from test.test;
no rows selected
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 422670336 bytes
Fixed Size 1336960 bytes
Variable Size 318769536 bytes
Database Buffers 96468992 bytes
Redo Buffers 6094848 bytes
Database mounted.
SQL> flashback database to timestamp to_timestamp('2012/04/03 23:30:52','yyyy/mm/dd hh24:mi:ss');
Flashback complete.
SQL> alter database open read only;
Database altered.
--當發現資料庫已經正確閃回到合適時間點則重新以resetlogs開啟資料庫開始對外服務
SQL> select * from test.test;
ID NAME
---------- --------------------
1 yallonking
2 yallonking
3 yallonking
4 oraking
5 oraking
6 afterchange
6 rows selected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 422670336 bytes
Fixed Size 1336960 bytes
Variable Size 318769536 bytes
Database Buffers 96468992 bytes
Redo Buffers 6094848 bytes
Database mounted.
SQL> alter database open resetlogs;
Database altered.
--檢視相關使用者下的相關表及資料
SQL> conn test/test
Connected.
SQL> select * from test;
ID NAME
---------- --------------------
1 yallonking
2 yallonking
3 yallonking
4 oraking
5 oraking
6 afterchange
6 rows selected.
--建議立即進行資料庫的全備
[oracle@test ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 3 23:47:54 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2055832488)
RMAN> backup database;
Starting backup at 03-APR-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=40 device type=DISK
… …
dqv_.bkp tag=TAG20120403T234819 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:02:19
Finished backup at 03-APR-12
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26143577/viewspace-720308/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 測試flashback databaseDatabase
- 10.2 flashback database 測試!Database
- Flashback DatabaseDatabase
- flashback技術之---flashback databaseDatabase
- flashback database 方法Database
- 配置Flashback DatabaseDatabase
- flashback系列文章三(flashback database)Database
- 關於flashback databaseDatabase
- How to enable the flashback database:Database
- oracle flashback特性(3.2)--Flashback Database操作示例OracleDatabase
- flashback總結一之Flashback_DatabaseDatabase
- Oracle 9I FlashBack 測試Oracle
- 應用oracle flashback--Flashback Database介紹OracleDatabase
- 啟用flashback database 功能Database
- [Flashback]Flashback Database閃回資料庫實驗Database資料庫
- Flashback database與flashback table使用條件區別Database
- 【徵文】應用oracle flashback(3.2)--Flashback Database操作示例OracleDatabase
- Oracle -- flashback database基於ARC+flashback_log還是flashback_logOracleDatabase
- oracle 10g flashback databaseOracle 10gDatabase
- flashback drop/query/table/database/archiveDatabaseHive
- flashback database 結合 data guardDatabase
- Oracle 閃回特性(FLASHBACK DATABASE)OracleDatabase
- 【Flashback】Flashback Database閃回資料庫功能實驗Database資料庫
- flashback database如何選擇需要應用的flashback logDatabase
- 全面學習oracle flashback特性(3.2)--Flashback Database操作示例OracleDatabase
- 【Flashback】啟用Flashback Database閃回資料庫功能Database資料庫
- 【Flashback】Flashback Database閃回資料庫功能實踐Database資料庫
- Impact of Database Recovery and Flashback Database on the TDE Wallet_1327519.1Database
- ORA-38760: This database instance failed to turn on flashback databaseDatabaseAI
- Flashback Database 閃回資料庫Database資料庫
- flashback database的一點總結Database
- Flashback database基礎知識問答Database
- FLASHBACK DATABASE可以恢復刪除的TABLESPACEDatabase
- 使用flashback database 特性時遇到的錯誤Database
- ORA-38760: This database instance failed to turn on flashback database 第三篇DatabaseAI
- ORA-38760: This database instance failed to turn on flashback database 錯誤解決DatabaseAI
- 執行database replay進行升級測試Database
- 閃回資料庫(flashback database)知識分享資料庫Database