oerr是oracle数据库中非常重要的错误查询工具,在实际工作和问题处理中,熟练使用oerr错误查询工具对oracle问题的定位和解决,有非常重要的帮助作用。
我前段时间遇到一个非常少见的错误 ora-56729 ,当时采用其他方法处理了,事后模拟错误问题,并尝试使用oerr工具进行问题定位,对问题的帮助和处理有更加快捷的作用。
oerr默认在$ORACLE_HOME/bin 目录下,如果不熟悉可以使用下面的步骤找到oerr工具并进行错误定位,
oerr工具的定位:
$ whereis oerr
oerr:
$ find /u01 -name oerr
/u01/app/oracle/product/11.2.0/dbhome_1/bin/oerr
/u01/app/agent11g/bin/oerr
find: /u01/lost+found: Permission denied
oerr工具的使用示例:
$ cd /u01/app/oracle/product/11.2.0/dbhome_1/
$ cd bin
$ oerr -h
Usage: oerr facility error
Facility is identified by the prefix string in the error message.
For example, if you get ORA-7300, "ora" is the facility and "7300"
is the error. So you should type "oerr ora 7300".
If you get LCD-111, type "oerr lcd 111", and so on.
$
$ oerr ora 56729
56729, 00000, "Failed to bind the database instance to processor group %s"
// *Cause: Binding the database instance to the processor group specified by
// the PROCESSOR_GROUP_NAME parameter failed.
// *Action: Set the PROCESSOR_GROUP_NAME to a valid, configured processor
// group and restart the database instance.
ora-56729错误问题再现:
$ p1
$ s
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 2 20:42:49 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SYS @PROD1>startup
ORACLE instance started.
Total System Global Area 941600768 bytes
Fixed Size 1348860 bytes
Variable Size 549456644 bytes
Database Buffers 385875968 bytes
Redo Buffers 4919296 bytes
Database mounted.
Database opened.
SYS @PROD1>
SYS @PROD1>
SYS @PROD1>show parameter process
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 1
cell_offload_processing boolean TRUE
db_writer_processes integer 1
gcs_server_processes integer 0
global_txn_processes integer 1
job_queue_processes integer 1000
log_archive_max_processes integer 4
processes integer 150
processor_group_name string
SYS @PROD1>
SYS @PROD1>alter system set processor_group_name=18;
alter system set processor_group_name=18
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SYS @PROD1>alter system set processor_group_name=18 scope=spfile;
System altered.
SYS @PROD1>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS @PROD1>
SYS @PROD1>startup
ORA-56729: Failed to bind the database instance to processor group 18;
Additional Information: cpuset not found in /proc/mounts at skgsnmvpgs:3
SYS @PROD1>
到这个地方会发现执行startup的时候,直接报错,不能正常启动实例;观察alert日志,会发现没有任何新的信息,连oracle启动nomount阶段会启动进程分配内存的记录都没有。
ora 56729问题解决方法:
使用oerr工具确认错误产生原因和解决方法:
$ oerr ora 56729
56729, 00000, "Failed to bind the database instance to processor group %s"
// *Cause: Binding the database instance to the processor group specified by
// the PROCESSOR_GROUP_NAME parameter failed.
// *Action: Set the PROCESSOR_GROUP_NAME to a valid, configured processor
// group and restart the database instance.
通过oerr可知,ora-56729错误是由于一个进程组相关参数设置不当,造成数据库无法正常启动的,于是采用下面的步骤进行问题确认和解决。
SYS @PROD1>
SYS @PROD1>create pfile from spfile;
File created.
SYS @PROD1>host cat /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPROD1.ora |grep process
*.log_archive_max_processes=4
*.processes=150
*.processor_group_name=‘18‘
在pfile中注释掉 processor_group_name一行的参数配置;
SYS @PROD1>
SYS @PROD1>host cat /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPROD1.ora |grep process
*.log_archive_max_processes=4
*.processes=150
SYS @PROD1>
SYS @PROD1>create spfile from pfile;
File created.
SYS @PROD1>startup
ORACLE instance started.
Total System Global Area 941600768 bytes
Fixed Size 1348860 bytes
Variable Size 549456644 bytes
Database Buffers 385875968 bytes
Redo Buffers 4919296 bytes
Database mounted.
Database opened.
SYS @PROD1>
SYS @PROD1>show parameter process
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 1
cell_offload_processing boolean TRUE
db_writer_processes integer 1
gcs_server_processes integer 0
global_txn_processes integer 1
job_queue_processes integer 1000
log_archive_max_processes integer 4
processes integer 150
processor_group_name string
SYS @PROD1>
总结:
通过上面的错误问题的定位和处理,可以看到oerr工具对oracle错误产生原因和解决方法的重要启发作用,在实际工作中用好这个工具,将对dba的工作有非常大的帮助。
本文出自 “yumushui的专栏” 博客,请务必保留此出处http://yumushui.blog.51cto.com/6300893/1674048
原文地址:http://yumushui.blog.51cto.com/6300893/1674048