ORACLE 非歸檔模式下REDO日誌丟失修複

來源:互聯網
上載者:User

標籤:oracel 日誌恢複

第一步:全備datafile,controlfile,spfile/pfile

第二步:恢複日誌。(原冷備的日誌沒有用,千萬不要用!)

SQL> select member from v$logfile;                        /ora/app/oracle/oradata/orcl/redo03.log/ora/app/oracle/oradata/orcl/redo02.log/ora/app/oracle/oradata/orcl/redo01.logSQL> archive log list;Database log mode              No Archive ModeAutomatic archival             Disabled       Archive destination            USE_DB_RECOVERY_FILE_DESTOldest online log sequence     10                       Current log sequence           12                       SQL> ho rm $ORACLE_BASE/oradata/orcl/redo*.log   --類比記錄檔丟失。       SQL> ho ls $ORACLE_BASE/oradata/orcl/redo*.logls: cannot access /ora/app/oracle/oradata/orcl/redo*.log: No such file or directorySQL> startup forceORACLE instance started.Total System Global Area 1536602112 bytesFixed Size                  2213616 bytesVariable Size             956303632 bytesDatabase Buffers          570425344 bytesRedo Buffers                7659520 bytesDatabase mounted.                        ORA-00313: open failed for members of log group 3 of thread 1ORA-00312: online log 3 thread 1: ‘/ora/app/oracle/oradata/orcl/redo03.log‘ORA-27037: unable to obtain file status                                    Linux-x86_64 Error: 2: No such file or directory                           Additional information: 3  SQL> alter database open resetlogs;        --第一步alter database open resetlogs      *                                  ERROR at line 1:                   ORA-01139: RESETLOGS option only valid after an incomplete database recoverySQL> recover database using backup controlfile; --第二步ORA-00279: change 1384991 generated at 05/22/2016 20:05:08 needed for thread 1ORA-00289: suggestion : /ora/app/oracle/flash_recovery_area/ORCL/archivelog/2016_05_22/o1_mf_1_12_%u_.arcORA-00280: change 1384991 for thread 1 is in sequence #12                                                Specify log: {<RET>=suggested | filename | AUTO | CANCEL}                          --注意:非歸檔,什麼也不做,直接斷行符號。ORA-00308: cannot open archived log ‘/ora/app/oracle/flash_recovery_area/ORCL/archivelog/2016_05_22/o1_mf_1_12_%u_.arc‘ORA-27037: unable to obtain file status                                                                                Linux-x86_64 Error: 2: No such file or directory                                                                       Additional information: 3   SQL> alter database open resetlogs;          --第三步alter database open resetlogs      *                                  ERROR at line 1:                   ORA-01113: file 1 needs media recoveryORA-01110: data file 1: ‘/ora/app/oracle/oradata/orcl/system01.dbf‘SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;System altered.                            --第四步,使用隱藏參數,不做一致性檢查啟動資料庫。SQL> startup force mount;                   --第五步,重啟到MOUNT狀態下。ORACLE instance started. Total System Global Area 1536602112 bytesFixed Size                  2213616 bytesVariable Size             956303632 bytesDatabase Buffers          570425344 bytesRedo Buffers                7659520 bytesDatabase mounted.                        SQL> alter database open;                    --第六步alter database open                      *                                        ERROR at line 1:                         ORA-01589: must use RESETLOGS or NORESETLOGS option for database openSQL> alter database open resetlogs;          --第七步,一般情況下會正常恢複。ERROR:                             ORA-03114: not connected to ORACLE                                             alter database open resetlogs*                            ERROR at line 1:             ORA-01092: ORACLE instance terminated. Disconnection forcedORA-00600: internal error code, arguments: [2662], [0], [1384999], [0], [1385016], [4194432], [], [], [], [], [], []Process ID: 28621                                                                                                   Session ID: 125 Serial number: 5                                                                                                                               --由於隱藏參數導致的600錯誤。SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options                 [[email protected] ~]$ sqlplus / as sysdba                                                          SQL*Plus: Release 11.2.0.1.0 Production on Sun May 22 22:56:21 2016Copyright (c) 1982, 2009, Oracle.  All rights reserved.Connected to an idle instance.SQL> select status from v$instance;        --檢查狀態,資料庫關閉了。select status from v$instance*ERROR at line 1:ORA-01034: ORACLE not availableProcess ID: 0Session ID: 0 Serial number: 0SQL> startup mount;                           --再次啟動ORACLE instance started.Total System Global Area 1536602112 bytesFixed Size                  2213616 bytesVariable Size             956303632 bytesDatabase Buffers          570425344 bytesRedo Buffers                7659520 bytesDatabase mounted.SQL> alter database open;Database altered.                               --啟動成功。SQL> ho ls $ORACLE_BASE/oradata/orcl/red*         --記錄檔自動產生/ora/app/oracle/oradata/orcl/redo01.log  /ora/app/oracle/oradata/orcl/redo02.log  /ora/app/oracle/oradata/orcl/redo03.logSQL> alter system reset "_allow_resetlogs_corruption" scope=spfile sid=‘*‘;System altered.                                --第八步,還原隱藏參數值。SQL> startup force                              --第九步,重啟資料庫,使參數生效。


ORACLE 非歸檔模式下REDO日誌丟失修複

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.