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

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值