【Flashback】啟用閃回資料庫功能需要在歸檔模式下完成
如果想使用“閃回資料庫”這個功能。則必須在歸檔模式下啟用這個功能。
1.確認閃回資料庫功能未開啟
ora10g@secdb /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 21 21:18:07 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
sys@ora10g> show parameter recovery_file
NAME TYPE VALUE
-------------------------- ------ ------------------------------------
db_recovery_file_dest string /oracle/ora10gR2/flash_recovery_area
db_recovery_file_dest_size big integer 20G
sys@ora10g> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
2.在資料庫MOUNTED狀態下嘗試啟用閃回資料庫功能
sys@ora10g> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ora10g> startup mount;
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 1219784 bytes
Variable Size 96469816 bytes
Database Buffers 314572800 bytes
Redo Buffers 7168000 bytes
Database mounted.
sys@ora10g> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38707: Media recovery is not enabled.
這裡的“ORA-38706”和“ORA-38707”錯誤暗示的內容便是:你的資料庫沒有執行在歸檔模式下。
3.啟用資料庫到歸檔模式
為處理上面的報錯資訊,需要將資料庫調整為歸檔模式。
sys@ora10g> alter database archivelog;
Database altered.
sys@ora10g> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 18
Next log sequence to archive 20
Current log sequence 20
4.再次嘗試啟用閃回資料庫功能
sys@ora10g> alter database flashback on;
Database altered.
sys@ora10g> alter database open;
Database altered.
sys@ora10g> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
到此閃回資料庫功能便順利地開啟。
5.閃回資料庫檔案
存放在db_recovery_file_dest引數對應的目錄下。
ora10g@secdb /oracle/ora10gR2/flash_recovery_area/ORA10G/flashback$ ls -l | wc -l
124
其中儲存了很多以OMF方式管理的閃迴檔案,例如“o1_mf_6ytmhn54_.flb”等。
6.小結
閃回資料庫功能畢竟是一個比較高階的恢復技術。相對其他閃回技術自然需要更多的要求。這裡額外的要求便是需要資料庫執行在歸檔模式下。對於一般的生產系統,這個要求不為過。
Good luck.
secooler
11.06.21
-- The End --
1.確認閃回資料庫功能未開啟
ora10g@secdb /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 21 21:18:07 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
sys@ora10g> show parameter recovery_file
NAME TYPE VALUE
-------------------------- ------ ------------------------------------
db_recovery_file_dest string /oracle/ora10gR2/flash_recovery_area
db_recovery_file_dest_size big integer 20G
sys@ora10g> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
2.在資料庫MOUNTED狀態下嘗試啟用閃回資料庫功能
sys@ora10g> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ora10g> startup mount;
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 1219784 bytes
Variable Size 96469816 bytes
Database Buffers 314572800 bytes
Redo Buffers 7168000 bytes
Database mounted.
sys@ora10g> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38707: Media recovery is not enabled.
這裡的“ORA-38706”和“ORA-38707”錯誤暗示的內容便是:你的資料庫沒有執行在歸檔模式下。
3.啟用資料庫到歸檔模式
為處理上面的報錯資訊,需要將資料庫調整為歸檔模式。
sys@ora10g> alter database archivelog;
Database altered.
sys@ora10g> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 18
Next log sequence to archive 20
Current log sequence 20
4.再次嘗試啟用閃回資料庫功能
sys@ora10g> alter database flashback on;
Database altered.
sys@ora10g> alter database open;
Database altered.
sys@ora10g> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
到此閃回資料庫功能便順利地開啟。
5.閃回資料庫檔案
存放在db_recovery_file_dest引數對應的目錄下。
ora10g@secdb /oracle/ora10gR2/flash_recovery_area/ORA10G/flashback$ ls -l | wc -l
124
其中儲存了很多以OMF方式管理的閃迴檔案,例如“o1_mf_6ytmhn54_.flb”等。
6.小結
閃回資料庫功能畢竟是一個比較高階的恢復技術。相對其他閃回技術自然需要更多的要求。這裡額外的要求便是需要資料庫執行在歸檔模式下。對於一般的生產系統,這個要求不為過。
Good luck.
secooler
11.06.21
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-700615/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【Flashback】Flashback Database閃回資料庫功能實驗Database資料庫
- flashback query閃回資料
- 【Flashback】Flashback Drop閃回刪除功能實驗
- Oracle 12.2新特性: PDB級閃回資料庫(Flashback PDB)Oracle資料庫
- Flashback Drop閃回刪除功能實踐
- Oracle資料庫歸檔模式的開啟和關閉Oracle資料庫模式
- RAC開啟資料庫歸檔資料庫
- 在Oracle DG Standby庫上啟用flashback database功能OracleDatabase
- Oracle資料庫閃回Oracle資料庫
- 【Oracle 12c資料庫支援閃回庫功能】實驗Oracle資料庫
- Oracle閃回技術--Flashback Version QueryOracle
- Oracle閃回技術 為Oracle閃回配置資料庫Oracle資料庫
- 對歸檔模式下CLEAR 未歸檔日誌後恢復資料庫的一點看法模式資料庫
- Orcale利用閃回功能恢復資料
- Oracle資料庫歸檔模式的切換ELOracle資料庫模式
- Oracle 閃回資料庫測試Oracle資料庫
- 詳解oracle資料庫閃回Oracle資料庫
- dg_閃回資料庫實驗資料庫
- ORACLE 閃回檢視v$flashback_database_log/statOracleDatabase
- Oracle資料庫閃回區空間不足Oracle資料庫
- SQL資料庫怎麼進行資料歸檔和歸檔管理?SQL資料庫
- rac使用預設閃回區歸檔空間滿
- 【FLASHBACK】Oracle閃回及回收站相關語句參考Oracle
- Oracle閃回功能恢復偶然丟失的資料(轉)Oracle
- 資料庫回檔解決方案資料庫
- Polardb-O資料庫歸檔配置資料庫
- 觀察者模式,無需多執行緒完成資料監聽模式執行緒
- oracle 11g開啟歸檔模式及修改歸檔目錄Oracle模式
- Sybase或SQLServer資料庫分批歸檔方案SQLServer資料庫
- 騰訊基於全時態資料庫技術的資料閃回資料庫
- my2sql資料閃回SQL
- GeminiDB Cassandra介面新特性FLASHBACK釋出:任意時間點秒級閃回
- rac歸檔模式/非歸檔模式下檔案建至本地儲存修復方法-ORA-01157模式
- 達夢資料庫歸檔方式及其配置方法資料庫
- oracle資料庫歸檔日誌量陡增分析Oracle資料庫
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- 物件代理資料庫:大資料時代下的應需之作物件資料庫大資料
- Oracle閃回技術 概覽 應用程式開發功能Oracle
- 開啟mysql 資料庫審計功能。MySql資料庫