[20210722]ORA-38760與flashback database.txt
[20210722]ORA-38760與flashback database.txt
--//有時候在資料庫升級時設定保證儲存點,如果這些flash資訊刪除會導致資料庫無法open,透過測試說明問題.
1.環境:
SYS@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
SYS@book> create restore point 20210722 guarantee flashback database;
create restore point 20210722 guarantee flashback database
*
ERROR at line 1:
ORA-00904: : invalid identifier
--//開始不能使用數字.
SYS@book> create restore point a20210722 guarantee flashback database;
Restore point created.
SYS@book> select flashback_on from v$database;
FLASHBACK_ON
------------------
RESTORE POINT ONLY
SYS@book> show parameter db_recovery_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ----------------------------------
db_recovery_file_dest string /u01/app/oracle/fast_recovery_area
db_recovery_file_dest_size big integer 60G
$ ll /u01/app/oracle/fast_recovery_area/BOOK/flashback
total 102528
-rw-r----- 1 oracle oinstall 52436992 2021-07-22 10:25:35 o1_mf_jhkop8d2_.flb
-rw-r----- 1 oracle oinstall 52436992 2021-07-22 10:24:13 o1_mf_jhkopcj8_.flb
2.測試:
SYS@book> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
--//模擬刪除flashback目錄中的檔案.
$ mv /u01/app/oracle/fast_recovery_area/BOOK/flashback /u01/app/oracle/fast_recovery_area/BOOK/flashback.xxx
`/u01/app/oracle/fast_recovery_area/BOOK/flashback' -> `/u01/app/oracle/fast_recovery_area/BOOK/flashback.xxx'
SYS@book> startup
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
ORA-38760: This database instance failed to turn on flashback database
SYS@book> select flashback_on,open_mode from v$database;
FLASHBACK_ON OPEN_MODE
------------------ --------------------
RESTORE POINT ONLY MOUNTED
SYS@book> alter database flashback off;
Database altered.
SYS@book> select flashback_on,open_mode from v$database;
FLASHBACK_ON OPEN_MODE
------------------ --------------------
RESTORE POINT ONLY MOUNTED
$ mkdir /u01/app/oracle/fast_recovery_area/BOOK/flashback
SYS@book> alter database open ;
alter database open
*
ERROR at line 1:
ORA-38760: This database instance failed to turn on flashback database
SYS@book> select * from v$restore_point ;
select * from v$restore_point
*
ERROR at line 1:
ORA-38701: Flashback database log 1 seq 1 thread 1: "/u01/app/oracle/fast_recovery_area/BOOK/flashback/o1_mf_jhkop8d2_.flb"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
--//噢,檔案已經不在了.
$ touch /u01/app/oracle/fast_recovery_area/BOOK/flashback/o1_mf_jhkop8d2_.flb
SYS@book> select * from v$restore_point ;
select * from v$restore_point
*
ERROR at line 1:
ORA-38701: Flashback database log 1 seq 1 thread 1: "/u01/app/oracle/fast_recovery_area/BOOK/flashback/o1_mf_jhkop8d2_.flb"
ORA-27047: unable to read the header block of file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Linux-x86_64 Error: 25: Inappropriate ioctl for device
Additional information: 1
SYS@book> drop restore point a20210722 ;
Restore point dropped.
SYS@book> alter database open ;
Database altered.
--//OK,問題是我可能根本不不知道保證儲存點的名字,如何操作呢?
3.重複測試:
SYS@book> create restore point b20210722 guarantee flashback database;
Restore point created.
SYS@book> select * from v$restore_point
2 @ prxx
==============================
SCN : 13288778422
DATABASE_INCARNATION# : 1
GUARANTEE_FLASHBACK_DATABASE : YES
STORAGE_SIZE : 52428800
TIME : 2021-07-22 10:38:42.000000000
RESTORE_POINT_TIME :
PRESERVED : YES
NAME : B20210722
PL/SQL procedure successfully completed.
$ ll /u01/app/oracle/fast_recovery_area/BOOK/flashback
total 102528
-rw-r----- 1 oracle oinstall 52436992 2021-07-22 10:38:45 o1_mf_jhkpklfz_.flb
-rw-r----- 1 oracle oinstall 52436992 2021-07-22 10:38:45 o1_mf_jhkpkmpd_.flb
$ rm -f /u01/app/oracle/fast_recovery_area/BOOK/flashback/*.flb
*/
SYS@book> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@book> startup
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
ORA-38760: This database instance failed to turn on flashback database
--//問題再現.
SYS@book> select * from v$restore_point ;
select * from v$restore_point
*
ERROR at line 1:
ORA-38701: Flashback database log 1 seq 1 thread 1: "/u01/app/oracle/fast_recovery_area/BOOK/flashback/o1_mf_jhkpklfz_.flb"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
--//提供兩種方法獲取保證儲存點,使用rman或者轉儲控制檔案.
RMAN> list restore point all;
using target database control file instead of recovery catalog
SCN RSP Time Type Time Name
---------------- ------------------- ---------- ------------------- ----
13288778422 GUARANTEED 2021-07-22 10:38:42 B20210722
--//13288778422 = scn_wrap,scn_base(10): 3,403876534 = scn_wrap,scn_base(16): 0x3,0x1812aab6
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug dump controlf 12
Statement processed.
SYS@book> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_19279.trc
--//開啟/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_19279.trc,可以發現如下資訊.
***************************************************************************
RESTORE POINT RECORDS
***************************************************************************
(size = 212, compat size = 212, section max = 2048, section in-use = 1,
last-recid= 3, old-recno = 0, last-recno = 0)
(extent = 1, blkno = 174, numrecs = 2048)
RESTORE POINT #1:
restore point name: B20210722 guarantee flag: 1 incarnation: 1next record 0
restore point scn: 0x0003.1812aab6 07/22/2021 10:38:42
--//0x0003.1812aab6 = scn(10): 13288778422 = scn(16): 0x31812aab6
RMAN> drop restore point B20210722;
--//昏沒提示的嗎.
RMAN> alter database open ;
database opened
SYS@book> select * from v$restore_point ;
no rows selected
SYS@book> select flashback_on,open_mode from v$database;
FLASHBACK_ON OPEN_MODE
------------------ --------------------
NO READ WRITE
--//OK問題解決.這種情況最常見於資料庫升級,建立保證儲存點要保留一段時間,最後忘記又不小心清除了flashback log的情況.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2782652/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【FLASHBACK】Oracle flashback data archive 介紹OracleHive
- [20181002]DBMS_FLASHBACK與函式.txt函式
- 【Flashback】Flashback Drop閃回刪除功能實驗
- Flashback Query(轉)
- [20230110]sql profile run standby database.txtSQLDatabase
- 【Flashback】Flashback Database閃回資料庫功能實驗Database資料庫
- [20181011]ORA-65086 cannot openclose the pluggable database.txtDatabase
- [20210722]sqlplus下show recycebin的小問題.txtSQL
- ORACLE Flashback Query偽列Oracle
- 2.6.2 Overview of Flashback PDB in a CDBView
- flashback query閃回資料
- Flashback Data Archive原理詳解Hive
- oracle 10g flashback databaseOracle 10gDatabase
- [20210722]資料庫異常關閉的處理.txt資料庫
- Oracle 備份恢復之 FlashbackOracle
- guarantee restore points-Flashback after RMAN restoreREST
- Oracle閃回技術--Flashback Version QueryOracle
- 用flashback恢復儲存過程儲存過程
- [20180424]開啟表空flashback on.txt
- flashback實現資料快速復原
- [20180724]Flashback query和子游標共享.txt
- 基於flashback_scn的expdp匯出
- Flashback Drop閃回刪除功能實踐
- Flashback database必須要有之前的archivelog嗎?DatabaseHive
- 在Oracle DG Standby庫上啟用flashback database功能OracleDatabase
- ORACLE 閃回檢視v$flashback_database_log/statOracleDatabase
- ORA-55507: Encountered mining error during Flashback Transaction Backout. functiError
- C++ 未初始化記憶體出現 flashbackC++記憶體
- Oracle 12.2新特性: PDB級閃回資料庫(Flashback PDB)Oracle資料庫
- 螢幕錄影機(bb flashback pro 4)pjb v4.1.21
- 【FLASHBACK】Oracle閃回及回收站相關語句參考Oracle
- 刪使用者刪表空間的操作還能flashback回來嗎?
- GeminiDB Cassandra介面新特性FLASHBACK釋出:任意時間點秒級閃回
- undefined與null與?. ??UndefinedNull
- Promise與async/await與GeneratorPromiseAI
- for of 與 for in
- 程式與執行緒、同步與非同步、阻塞與非阻塞、併發與並行執行緒非同步並行
- forms元件補充與ModelForm簡單使用與cookie與sessionORM元件CookieSession