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

[oracle@rac1 ~]$ 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
[oracle@rac1 ~]$ 

改成

[oracle@rac1 ~]$ 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
[oracle@rac1 ~]$ 

重建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"错误,实例将无法启动。

 

 

 

 

你可能感兴趣的:(Oracle,11G)