天道酬勤

RDBMS and My Life

Archive for the ‘ORA-12547’ tag

ORA-12547: TNS:lost contact

one comment

这个错误还真没碰到过,记录一下。

背景:原本想在VMware+OEL5.3+ORACLE 11.2(已创建了单实例数据库,32bit)上安装Grid Infrastructure,最终目的就是想使用Oracle Restart,Restart是集成在Grid Infrastructure里面的不能单独安装,可以像在10g里使用SRVCTL来管理数据库,当然单实例也是可以的,且还有另一大好处就是用restart管理的资源譬如instance、listener等在进程异常终止后会自动启动(注:在sqlplus中用命令停止的restart不能再次自动启动)。结果grid是安装成功了,但是在SRVCTL中配置实例、监听信息的时候报错无法配置成功,后来想是不是应该先安装grid再安装Oracle最后再建库(后查阅资料grid是可以在已有库上安装的),说干就干,反正按照自己写的文档ctrl+c、ctrl+v的也快,再加上RHEL不久前发布了5.5,ORACLE在之后的一个多星期也放出了OEL5.5,想着测试一下新版本,从安装OS->修改系统参数、配置Oracle用户环境变量—>安装Oracle软件一切顺利,哪知DBCA到最后一步出现:

ORA-12547: TNS:lost contact

好家伙,半道杀出个程咬金,最初以因xmanager出问题了,由于建库的脚本刚刚已经创建,心想用CRT手工建库得了,往往越想快点看得结果却越看不到结果:

[oracle@ora11.2 ~]$ sqlplus ‘/as sysdba’

SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 18 09:24:31 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

ERROR:
ORA-12547: TNS:lost contact

Enter user-name:

兄弟,咋的了,装了无数次系统还从未遇到这种情况啊,什么原因引起的还真不知道,唉,先google一下,说可能是libaio-0.3.106、binutils相关包没有安装,打开Oracle在线文档一个一个检查,可结果是都安装了啊

[root@ora11.2 ~]# uname -a
Linux ora11.2 2.6.18-194.el5 #1 SMP Mon Mar 29 20:06:41 EDT 2010 i686 i686 i386 GNU/Linux
[root@ora11.2 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)

[root@ora11.2 ~]# rpm -q –verify `uname -r | awk -FEL ‘{ printf(“kernel-%s-%sEL\n”,$2,$1); }’ | sed ‘s/–/-/g’`
package kernel-2.6.18-194.el5EL is not installed

不知道为什么说我没有安装kernel,实际上是安装了的

[root@ora11.2 ~]# rpm -qa|grep kernel
kernel-headers-2.6.18-194.el5
kernel-2.6.18-194.el5

不行了,上MOS找找,根据ID 272516.1说的,应该是kernel参数设置问题,这里RedHat给出了一张

Name Description Reasonable Values
SHMMAX Maximum size of shared memory segment (bytes) 250kB + 8.2kB * shared_buffers + 14.2kB * max_connections or infinity
SHMMIN Minimum size of shared memory segment (bytes) 1
SHMALL Total amount of shared memory available (bytes or pages) if bytes, same as SHMMAX; if pages, ceil(SHMMAX/PAGE_SIZE)
SHMSEG Maximum number of shared memory segments per process only 1 segment is needed, but the default is much higher
SHMMNI Maximum number of shared memory segments system-wide like SHMSEG plus room for other applications
SEMMNI Maximum number of semaphore identifiers (that is, sets) >= ceil(max_connections / 16)
SEMMNS Maximum number of semaphores system-wide ceil(max_connections / 16) * 17 + room for other applications
SEMMSL Maximum number of semaphores per set >= 17
SEMMAP Number of entries in semaphore map see text
SEMVMX Maximum value of semaphore >= 255 (The default is often 32767, do not change unless asked to.)

结果反复的检查调整内核参数,二个比较重要的参数:

kernel.shmall = 2097152  共享内存总量,以页为单位,对于32位系统,一页=4k,也就是4096字节,2097152*4k/1024/1024 = 8G 就是说可用共享内存一共8G
kernel.shmmax = 2147483648 (默认536870912,512M)  以字节为单位

检查oracle的环境变量,relink all等一系列操作结果错误依旧没有消除。突然想起在安装64位系统的时候,默认只安装了32位的包,必须手工再次安装相应64位的包,那反过来是不是安装32位是不是也需要64位的某些包(当时确实这样想的,现在觉得有点扯啊),在经历三个多小时的下载时间后强行安装部分64位的包后重启系统,测试,FT。

现在怀疑是OEL与Oracle软件版本兼容的问题,如果有解决过相同问题的朋友还请告之。

-The End-

Written by ochef

April 18th, 2010 at 9:21 pm

Posted in Database

Tagged with