天天看點

ORA-19905: log_archive_format must contain %s, %t and %r

今天遇到一個小問題:ORA-19905: log_archive_format must contain %s, %t and %r

現在來重制一下當時的情況,并解決。

更改了log_archive_format參數:

SQL> alter system set log_archive_format='arch_%t_%s.dbf' scope=spfile;

System altered.

SQL> 

重新開機資料庫

SQL> startup force

ORA-19905: log_archive_format must contain %s, %t and %r

SQL> select status from v$instance;

select status from v$instance

*

ERROR at line 1:

ORA-01034: ORACLE not available

Process ID: 0

Session ID: 762 Serial number: 5

SQL>

啟動到nomount,失敗,看來是參數檔案的問題了。

SQL> startup mount;

ORA-19905: log_archive_format must contain %s, %t and %r

SQL> startup nomount

ORA-19905: log_archive_format must contain %s, %t and %r

SQL> 

建立pfile

SQL> create pfile='/home/oracle/123.ora' from spfile='/u01/app/oracle/product/11.2.0/db_1/dbs/spfilelypdb1.ora';

File created.

SQL> 

更改pfile

[[email protected] ~]$ vi 123.ora 

。。。。。。。。

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=lypdb1XDB)'

*.log_archive_dest_1='location=/home/oracle/arch/'

*.log_archive_format='arch_%t_%s.dbf'

*.open_cursors=300

*.pga_aggregate_target=373293056

*.processes=1000

[[email protected] ~]$ 

改成

[[email protected] ~]$ vi 123.ora 

。。。。。。。。

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=lypdb1XDB)'

*.log_archive_dest_1='location=/home/oracle/arch/'

*.log_archive_format='arch_%t_%s_%r.dbf'

*.open_cursors=300

*.pga_aggregate_target=373293056

*.processes=1000

[[email protected] ~]$ 

重建spfile參數檔案

SQL> create spfile='/u01/app/oracle/product/11.2.0/db_1/dbs/spfilelypdb1.ora' from pfile='/home/oracle/123.ora';

File created.

SQL> 

啟動資料庫

SQL> startup

ORACLE instance started.

Total System Global Area 2137886720 bytes

Fixed Size                  2254952 bytes

Variable Size             973080472 bytes

Database Buffers         1157627904 bytes

Redo Buffers                4923392 bytes

Database mounted.

Database opened.

SQL> 

總結:

        歸檔日志的檔案名格式有靜态參數log_archive_format确定,但儲存在快速恢複區中歸檔日志格式自有另一套規範。

        log_archive_format的預設值是%t_%s_%r.dbf,%t、%s、%r分别代表日志的線程号(即哪個執行個體産生的日志)、序列号(LGWR寫的第幾個日志)、重設日志号(有時線上日志不得不重新從序列号1開始寫,比如在不完全恢複之後,其目的是為了防止歸檔日志被覆寫)。

       管理者雖然可以修改此參數,但是一定要包含%t、%s和%r,否則,會出現"ORA-19905: log_archive_format must contain %s, %t and %r"錯誤,執行個體将無法啟動。

繼續閱讀