粗心導致ORA-16020錯誤(fewer destinations available than specified

來源:互聯網
上載者:User

一次在切換歸檔日誌時


sql>alter system switch logfile; 時停了好久都沒反應;


查看確實在歸檔模式下:

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /db/oracle/archiveback
Oldest online log sequence     3
Next log sequence to archive   3
Current log sequence           5



查看有幾組日誌:

SQL> select group#,THREAD#,MEMBERS,STATUS from v$log;

   GROUP#    THREAD#    MEMBERS STATUS
---------- ---------- ---------- ----------------
        1          1          1 INACTIVE
        3          1          1 INACTIVE
        2          1          1 CURRENT


網上資料說“如果資料庫處于歸檔模式下,當執行alter system switch logfile操作後,Oracle接
下來需要進行日誌切換。在進行日誌切換之前,Oracle首先檢查將要切換到的下一個記錄檔是否已歸檔,而你的資料庫是處于歸檔模式但不是自動歸檔,所以Oracle需要等待進行手工歸檔,再進行切換。而在你還沒進行手工歸檔需要歸檔的日誌之前,資料庫實際上已經掛起並等待手工歸檔,所以出現了以上的問題。”先進性手動歸檔:

解決辦法:
1、將末歸檔的日誌手工歸檔:
  SQL>shutdown immediate
  SQL>startup mount
  SQL>alter system archive log all;
  開啟資料庫:
  SQL>alter database open;
2、將資料庫置於自動歸檔狀態:
  SQL>alter system set log_archive_start=true scope=spfile;
  SQL>shutdown immediate
  SQL>startup


安裝步驟我的還是報錯


SQL> alter system archive log all;
alter system archive log all
*
ERROR at line 1:
ORA-16020: fewer destinations available than specified by
LOG_ARCHIVE_MIN_SUCCEED_DEST


網上這篇文章介紹了怎麼解決ora-16020的錯誤”http://hi.baidu.com/aixspace/item/4ccb9a0e8e71b088a3df4332“

而我的還是行不通;


於是進一步檢查歸檔檔案的屬性探索問題所在:

SQL> show parameter archive

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target                   integer     0
log_archive_config                   string
log_archive_dest                     string
log_archive_dest_1                   string    location=/db/oracle/archiveback


[oracle@oracle11g oracle]$ ll
total 40
drwxr-x--- 5 oracle oinstall 4096 Jun 18 16:47 admin
drwxr-xr-x 2 root   root     4096 Jun 19 10:20 archiveback
drwxr-xr-x 2 oracle oinstall 4096 Jun 18 20:16 backup


[root@oracle11g oracle]# chown -R oracle:oinstall archiveback/


SQL> alter system archive log all;   //在此執行手動歸檔成功;

System altered.


SQL> select open_mode,log_mode from v$database;

OPEN_MODE            LOG_MODE
-------------------- ------------
MOUNTED              ARCHIVELOG

SQL> alter database open;

Database altered.


SQL> alter system switch logfile;

System altered.

問題解決,原來是自己修改了歸檔的存放地點,而忘記了修改許可權導致!


[oracle@oracle11g archiveback]$ ll
total 76160
-rw-r----- 1 oracle oinstall 43909120 Jun 19 20:29 1_3_818441304.dbf
-rw-r----- 1 oracle oinstall   512512 Jun 19 20:29 1_4_818441304.dbf
-rw-r----- 1 oracle oinstall 33562624 Jun 19 20:43 1_5_818441304.dbf

本文出自 “賴筆頭” 部落格,請務必保留此出處http://summervast.blog.51cto.com/690507/1225329

相關文章

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.