在一文中,我曾经提到过,很多时候使用隐含参数后 resetlogs 打开数据库, 我们可能会由于 SCN 不一致而遭遇到 ORA-00600 2662 号错误,这里给出一个完整的例子及解决过程。
当然模拟 2662 错误需要技巧,本文并不会涉及这个内容。
通过正常方式启动数据库时,从 alert 文件中,我们可以看到 ora-00600 2662 号错误。
- Sun Dec 11 18 : 02 : 25 2005 Errors in file / opt //admin/conner/udump/conner_ora_13349.trc:
- ORA - 00600 : internal error code,
- arguments: [2662],
- [0],
- [547743994],
- [0],
- [898092653],
- [8388617],
- [],
- [] Sun Dec 11 18 : 02 : 27 2005 Errors in file / opt / oracle / admin / conner / udump / conner_ora_13349.trc: ORA - 00600 : internal error code,
- arguments: [2662],
- [0],
- [547743994],
- [0],
- [898092653],
- [8388617],
- [],
- [] Sun Dec 11 18 : 02 : 27 2005 Error 600 happened during db open,
- shutting down database USER: terminating instance due to error 600
此时我们可以通过 Oracle 的来调整 SCN:
增进 SCN 有两种常用方法:
1. 通过 immediate trace name 方式 (在数据库 Open 状态下)
2. 通过 10015 事件 (在数据库无法打开,mount 状态下)
注: level 1 为增进 SCN 10 亿 (1 billion) (1024*1024*1024), 通常 Level 1 已经足够。也可以根据实际情况适当调整。
本例由于数据库无法打开,只能使用的二种方法。
- [oracle@jumper dbs]$ sqlplus "/ as sysdba"
- SQL*Plus: Release 9.2.0.4.0 - Production on Sun Dec 11 18:26:18 2005
- Copyright(c) 1982,
- 2002,
- Oracle Corporation. All rights reserved.
- Connected to an idle instance.
- SQL> startup mount pfile=initconner.ora
- ORACLE instance started.
- Total System Global Area 97588504 bytes
- Fixed Size 451864 bytes
- Variable Size 33554432 bytes
- Database Buffers 62914560 bytes
- Redo Buffers 667648 bytes
- Database mounted.
- SQL> alter session set events '10015 trace name adjust_scn level 10';
- Session altered.
- SQL> alter database open;
- Database altered.
注意, 由于我使用了 10015 事件,使得 SCN 增进了 10 billion,稍后我们可以验证。
- [oracle@jumper dbs]$ sqlplus "/ as sysdba"
- SQL*Plus: Release 9.2.0.4.0 - Production on Sun Dec 11 18:26:18 2005
- Copyright(c) 1982,
- 2002,
- Oracle Corporation. All rights reserved.
- Connected to an idle instance.
- SQL> startup mount pfile=initconner.ora
- ORACLE instance started.
- Total System Global Area 97588504 bytes
- Fixed Size 451864 bytes
- Variable Size 33554432 bytes
- Database Buffers 62914560 bytes
- Redo Buffers 667648 bytes
- Database mounted.
- SQL> alter session set events '10015 trace name adjust_scn level 10';
- Session altered.
- SQL> alter database open;
- Database altered.
此时数据库可以打开,从 alert 文件中我们可以看到如下提示:
- Sun Dec 11 18:27:04 2005
- SMON: enabling cache recovery
- Sun Dec 11 18:27:05 2005
- Debugging event used to advance scn to 10737418240
SCN 被增进了 10 billion, 即 10 * (1024*1024*1024) = 10737418240, 正好是日志里记录的数量。
来源: http://www.linuxidc.com/Linux/2017-02/141074.htm