建立控制檔案副本出現錯誤ORA-00205: error in identifying control file

路途中的人2012發表於2016-02-02
測試環境:OEL6.5+Oracle 11g R2

    
在做多路複用控制檔案的實驗時,建立控制檔案總是會報錯誤:ORA-00205: error in identifying control file, check alert log for more info

下面是當時的操作過程:

點選(此處)摺疊或開啟

  1. SYS@ORCL> show parameter control_files;

  2. NAME                 TYPE     VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. control_files             string     /u01/app/oracle/oradata/ORCL/c
  5.                          ontrol01.ctl, /u01/app/oracle/
  6.                          fast_recovery_area/ORCL/contro
  7.                          l02.ctl
  8. SYS@ORCL> shutdown immediate;
  9. Database closed.
  10. Database dismounted.
  11. ORACLE instance shut down.
  12. SYS@ORCL> ! cp /u01/app/oracle/oradata/ORCL/control01.ctl /home/oracle/control03.ctl

  13. SYS@ORCL> startup nomount;
  14. ORACLE instance started.

  15. Total System Global Area 1653518336 bytes
  16. Fixed Size         2253784 bytes
  17. Variable Size         1006636072 bytes
  18. Database Buffers     637534208 bytes
  19. Redo Buffers         7094272 bytes
  20. SYS@ORCL> alter system set control_files='/u01/app/oracle/oradata/ORCL/control01.ctl,/u01/app/oracle/fast_recovery_area/ORCL/control02.ctl /home/oracle/control03.ctl' scope=spfile;

  21. System altered.

  22. SYS@ORCL> startup force;
  23. ORACLE instance started.

  24. Total System Global Area 1653518336 bytes
  25. Fixed Size         2253784 bytes
  26. Variable Size         1006636072 bytes
  27. Database Buffers     637534208 bytes
  28. Redo Buffers         7094272 bytes
  29. ORA-00205: error in identifying control file, check alert log for more info

    看上去似乎沒有錯誤,於是開始檢視alert日誌,在日誌中看到的內容如下:

點選(此處)摺疊或開啟

  1. Mon Feb 01 23:44:54 2016
  2. ALTER DATABASE MOUNT
  3. ORA-00210: cannot open the specified control file
  4. ORA-00202: control file: '/u01/app/oracle/oradata/ORCL/control01.ctl,/u01/app/oracle/fast_recovery_area/ORCL/control02.ctl /home/oracle/control03.ctl'
  5. ORA-27037: unable to obtain file status
  6. Linux-x86_64 Error: 2: No such file or directory
  7. Additional information: 3
  8. ORA-205 signalled during: ALTER DATABASE MOUNT...
    根據提示來看是說檔案或路徑不存在,而且是在資料庫從nomount階段啟動到mount階段的過程中遇到了檔案或路徑不存在的錯誤,而從nomount轉換到mount階段,是例項根據引數檔案中的control_files來定位控制檔案的,這樣一來可以定位錯誤就在下面的語句當中:

點選(此處)摺疊或開啟

  1. SYS@ORCL> alter system set control_files='/u01/app/oracle/oradata/ORCL/control01.ctl,/u01/app/oracle/fast_recovery_area/ORCL/control02.ctl /home/oracle/control03.ctl' scope=spfile;

    可是上面明明提示這據SQL更改成功了,為什麼會出錯呢?思來想去可能問題出在後面的引數值的格式上,於是將這句SQL改為:

點選(此處)摺疊或開啟

  1. SYS@ORCL> alter system set control_files='/u01/app/oracle/oradata/ORCL/control01.ctl','/u01/app/oracle/fast_recovery_area/ORCL/control02.ctl','/home/oracle/control03.ctl' scope=spfile;

  2. System altered.

  3. SYS@ORCL> startup force;
  4. ORACLE instance started.

  5. Total System Global Area 1653518336 bytes
  6. Fixed Size         2253784 bytes
  7. Variable Size         1006636072 bytes
  8. Database Buffers     637534208 bytes
  9. Redo Buffers         7094272 bytes
  10. Database mounted.
  11. Database opened.
  12. SYS@ORCL> show parameter control_files;

  13. NAME                 TYPE     VALUE
  14. ------------------------------------ ----------- ------------------------------
  15. control_files             string     /u01/app/oracle/oradata/ORCL/c
  16.                          ontrol01.ctl, /u01/app/oracle/
  17.                          fast_recovery_area/ORCL/contro
  18.                          l02.ctl, /home/oracle/control0
  19.                          3.ctl
    果然是格式的問題,那麼將單引號改為雙引號會怎樣?

點選(此處)摺疊或開啟

  1. SYS@ORCL> alter system set control_files="/u01/app/oracle/oradata/ORCL/control01.ctl","/u01/app/oracle/fast_recovery_area/ORCL/control02.ctl","/home/oracle/control03.ctl" scope=spfile;

  2. System altered.

  3. SYS@ORCL> startup force;
  4. ORACLE instance started.

  5. Total System Global Area 1653518336 bytes
  6. Fixed Size         2253784 bytes
  7. Variable Size         1006636072 bytes
  8. Database Buffers     637534208 bytes
  9. Redo Buffers         7094272 bytes
  10. Database mounted.
  11. Database opened.
  12. SYS@ORCL> show parameter control_files;

  13. NAME                 TYPE     VALUE
  14. ------------------------------------ ----------- ------------------------------
  15. control_files             string     /u01/app/oracle/oradata/ORCL/c
  16.                          ontrol01.ctl, /u01/app/oracle/
  17.                          fast_recovery_area/ORCL/contro
  18.                          l02.ctl, /home/oracle/control0
  19.                          3.ctl

    也能成功,在此處的control_files引數是單引號和雙引號之間沒有區別。那麼把失敗的情況換成雙引號結果會怎樣?

點選(此處)摺疊或開啟

  1. SYS@ORCL> alter system set control_files="/u01/app/oracle/oradata/ORCL/control01.ctl,/u01/app/oracle/fast_recovery_area/ORCL/control02.ctl /home/oracle/control03.ctl" scope=spfile;

  2. System altered.

  3. SYS@ORCL> startup force;
  4. ORACLE instance started.

  5. Total System Global Area 1653518336 bytes
  6. Fixed Size         2253784 bytes
  7. Variable Size         1006636072 bytes
  8. Database Buffers     637534208 bytes
  9. Redo Buffers         7094272 bytes
  10. ORA-00205: error in identifying control file, check alert log for more info

    同樣還是失敗,也就是說,在修改此引數時,一個單/雙引號裡的內容均會被認為是一個完整的路徑,要想指定多個路徑,必須以單/雙引號分別指定路徑,路徑之間以逗號隔開,當然,全部是西文字元。



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29067253/viewspace-1985416/,如需轉載,請註明出處,否則將追究法律責任。

相關文章