ORA-38760: This database instance failed to turn on flashback database

昨晚學習ORACLE用HR用戶執行:create table reg_copy as select * from regions;居然一片空白沒有任何反應,不想強行退出,於是用ORACLE用戶來終止會話的方式來處理,先後用了三種方式:

第一種:select sid,serial# from v$session where username='HR';

         然後用:ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE

第二種:ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' IMMEDIATE

第三種:用以下命令查到系統級別的進程號,然後殺掉。

SET LINESIZE 100
COLUMN spid FORMAT A10
COLUMN username FORMAT A10
COLUMN program FORMAT A45
 
SELECT s.inst_id,
       s.sid,
       s.serial#,
       p.spid,
       s.username,
       s.program
FROM   gv$session s
       JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE  s.type != 'BACKGROUND';

結果今天起來起動數據庫就有如下提示了:

SQL> startup
ORACLE instance started.
Total System Global Area 1536602112 bytes
Fixed Size            2213616 bytes
Variable Size          956303632 bytes
Database Buffers      570425344 bytes
Redo Buffers            7659520 bytes
Database mounted.
ORA-38760: This database instance failed to turn on flashback database

不知跟昨天的事有沒有關係,先記錄下來。晚些做實現進一步驗證。先記錄處理此故障的步驟。

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1536602112 bytes
Fixed Size            2213616 bytes
Variable Size          956303632 bytes
Database Buffers      570425344 bytes
Redo Buffers            7659520 bytes
Database mounted.
ORA-38760: This database instance failed to turn on flashback database


SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38713: Flashback Database logging is already turned on.


SQL> alter database flashback off;

Database altered.

SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38714: Instance recovery required.


SQL> alter database flashback off;

Database altered.

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1536602112 bytes
Fixed Size            2213616 bytes
Variable Size          956303632 bytes
Database Buffers      570425344 bytes
Redo Buffers            7659520 bytes
Database mounted.
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38714: Instance recovery required.

SQL>  select FLASHBACK_ON from v$database;

FLASHBACK_ON
------------------
RESTORE POINT ONLY

SQL> alter database force logging;

Database altered.

SQL> alter database flashback off;

Database altered.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-38760: This database instance failed to turn on flashback database


SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1536602112 bytes
Fixed Size            2213616 bytes
Variable Size          956303632 bytes
Database Buffers      570425344 bytes
Redo Buffers            7659520 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-38760: This database instance failed to turn on flashback database


SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38714: Instance recovery required.

SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-38760: This database instance failed to turn on flashback database

參考大牛的文章,說是跟還原點有關係。
SQL> col name for a30
SQL> /

NAME                   TO_CHAR(TIME,'YYYY/ GUA
------------------------------ ------------------- ---
B1                   2016/06/06 23:03:58 YES

SQL> alter database flashback off;

Database altered.

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
RESTORE POINT ONLY

SQL> drop restore point b1;

Restore point dropped.

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38714: Instance recovery required.


SQL> recover database;
Media recovery complete.
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38714: Instance recovery required.


SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required


SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1536602112 bytes
Fixed Size            2213616 bytes
Variable Size          956303632 bytes
Database Buffers      570425344 bytes
Redo Buffers            7659520 bytes
Database mounted.
SQL> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38714: Instance recovery required.


SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-00264: no recovery required

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> alter database open;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1536602112 bytes
Fixed Size            2213616 bytes
Variable Size          956303632 bytes
Database Buffers      570425344 bytes
Redo Buffers            7659520 bytes
Database mounted.
Database opened.
SQL> select flashback_on,log_mode from v$database;

FLASHBACK_ON       LOG_MODE
------------------ ------------
NO           ARCHIVELOG

SQL> alter database flashback on;

Database altered.
SQL> select flashback_on,log_mode from v$database;

FLASHBACK_ON       LOG_MODE
------------------ ------------
YES           ARCHIVELOG

結論:

應該是由於數據庫非一致性關閉導致的38760錯誤,如果重啓flashback都報錯38714,就刪除還原點後,再重啓數據庫,可以正常啓動了。以後還是正常關機保險。

參考:http://blog.csdn.net/aaron8219/article/details/10129503

http://blog.chinaunix.net/uid-22948773-id-2821820.html


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章