使用隱含參數類比Oracle資料庫伺服器掉,重做日誌丟失開啟資料庫

來源:互聯網
上載者:User

類比伺服器突然掉電,資料庫丟失,事務無法完成復原故障的恢複
資料庫的狀態如下:
SQL> select instance_name,status from v$instance;
INSTANCE_NAME    STATUS
---------------- ------------
marven           OPEN
非歸檔模式:
SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/Oracle/product/10.2.0/db_1/dbs/arch
Oldest online log sequence     25
Current log sequence           27

SQL> set linesize 150 pagesize 300
SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
         1          1         25   52428800          1 NO  CURRENT                 384492 29-JAN-12
         2          1         23   52428800          1 NO  INACTIVE                371795 29-JAN-12
         3          1         24   52428800          1 NO  INACTIVE                377698 29-JAN-12
採用shutdown abort類比突然掉電,資料庫關閉的情形,此時資料庫可以正常啟動到MOUNT狀態
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2084296 bytes
Variable Size             385876536 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14692352 bytes
Database mounted.
此時日誌狀態如下:
SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
         1          1         25   52428800          1 NO  ACTIVE                  384492 29-JAN-12
         3          1         27   52428800          1 NO  CURRENT                 391086 29-JAN-12
         2          1         26   52428800          1 NO  ACTIVE                  389733 29-JAN-12
刪除所有的重做記錄檔:
SQL>!rm /u01/app/oracle/oradata/marven/redo*.log
SQL> shutdown abort
ORACLE instance shut down.

SQL>startup nomount

Total System Global Area 1610612736 bytes
Fixed Size                  2084296 bytes
Variable Size             385876536 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14692352 bytes
SQL> alter database mount;

Database altered.

在開啟資料庫時發現無法正常開啟
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/marven/redo01.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
試圖通過resetlog開啟資料庫發現是行不通的:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery

spfile參數檔案的目錄如下:
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/10.2.0
                                                /db_1/dbs/spfilemarven.ora

  • 1
  • 2
  • 3
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.