TNS-12531 How to

Oracle数据库监听无法正常启动,在log文件中产生大量的错误信息。

28-NOV-2006 14:39:55 * 12531
TNS-12531: TNS:cannot allocate memory
28-NOV-2006 14:39:55 * 12531
TNS-12531: TNS:cannot allocate memory

OERR的解释是:

TNS-12531 TNS:cannot allocate memory
Cause: Sufficient memory could not be allocated to perform the desired activity.
Action: Either free some resource for TNS, or add more memory to the machine. For further details, turn on tracing and re-execute the operation.

实际上,可用内存肯定是足够的,最后发现原因居然是hosts文件中缺少主机定义。

配置监听我们使用的是netstat -in检查网卡绑定的IP地址,然后将IP写入listener.ora文件。
通常netstat -in中显示的IP地址在/etc/hosts文件中都会有配置,而偏偏这次没有,于是oracle的监听程序在启动的时候在hosts文件中检查不到listener.ora中配置的主机,所以无法正常启动。

另外,如果/etc/hosts中设置的IP和主机名称对应中没有本机hostname命令显示的主机名,也同样会报这个错误。

解决方法:
在/etc/hosts中配置正确的IP地址和主机名称

Leave a Reply

Your email address will not be published. Required fields are marked *