flashback database 方法
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Jan 23 23:30:17 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
----------------------------------------------
設定連個引數:
db_recovery_file_dest
db_recovery_file_dest_size
---------------------------------------------
SQL> startup mount
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 2082496 bytes
Variable Size 125831488 bytes
Database Buffers 37748736 bytes
Redo Buffers 6303744 bytes
Database mounted.
SQL> alter database flashback on;
Database altered.
SQL> alter database open;
Database altered.
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
SQL> create table test as select * from dba_extents;
Table created.
SQL>
SQL> select sysdate from dual;
SYSDATE
---------
23-JAN-10
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
Session altered.
SQL> select sysdate from dual;
SYSDATE
-------------------
2010-01-23 23:33:34
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
667414
SQL> drop table test purge;
Table dropped.
SQL> select * from test;
select * from test
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount exclusive
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 2082496 bytes
Variable Size 125831488 bytes
Database Buffers 37748736 bytes
Redo Buffers 6303744 bytes
Database mounted.
SQL> flashback database to timestamp to_timestamp('2010-01-23 23:33:34','yyyy-mm-dd hh24:mi:ss');
Flashback complete.
SQL> alter database open read only;
Database altered.
SQL> select count(*) from test;
COUNT(*)
----------
3397
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 2082496 bytes
Variable Size 125831488 bytes
Database Buffers 37748736 bytes
Redo Buffers 6303744 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
//一旦resetlogs之後,就再也不能flashback database 到resetlogs之前的狀態了,所以之前用open read only檢查一下是否flashback 成功了。
SQL> alter database open resetlogs;
Database altered.
SQL> select count(*) from test;
COUNT(*)
----------
3397
//透過v$flash_recovery_area_usage檢視可以查到閃回區的使用情況。
//透過v$flashback_database_log檢視可以查到flashback database能恢復到最早的時間和SCN號。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-624629/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Flashback DatabaseDatabase
- flashback技術之---flashback databaseDatabase
- 配置Flashback DatabaseDatabase
- flashback系列文章三(flashback database)Database
- 關於flashback databaseDatabase
- How to enable the flashback database:Database
- 測試flashback databaseDatabase
- flashback database測試Database
- oracle flashback特性(3.2)--Flashback Database操作示例OracleDatabase
- flashback總結一之Flashback_DatabaseDatabase
- 應用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
- 10.2 flashback database 測試!Database
- 【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
- 閃回資料庫(flashback database)知識分享資料庫Database
- Oracle Database 11g閃回技術flashbackOracleDatabase
- Bug 13250486 : ADD STANDBY DATABASE FOR TARGET WITH FLASHBACK ON FAILS WITH ERRDatabaseAI