Sqlplus报错ORA-12547

一、问题现象

Linux Oracle Db11.2.0.4 OGG19.1

操作系统使用OGG用户,启动进程提示无法连接DB,OGG SQLPLUS报错ORA 12547! Oracle用户本地SQLPLUS正常!

 

二、问题处理

2.1 跟踪日志

https://www.cnblogs.com/historynote/p/13394557.html

$strace -f -o /tmp/trace.1.log $ORACLE_HOME/bin/sqlplus / as sysdba

$ tail -500 /tmp/trace.1.log 

13021 times({tms_utime=10, tms_stime=4, tms_cutime=0, tms_cstime=0}) = 430640604
13021 close(3) = 0
13021 close(4) = 0

······

13018 open("/u01/app/oracle/product/11.2.0/dbhome_1//rdbms/mesg/oraus.msb", O_RDONLY) = 10
13018 fcntl(10, F_SETFD, FD_CLOEXEC) = 0
13018 lseek(10, 0, SEEK_SET) = 0
13018 read(10, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256
13018 lseek(10, 512, SEEK_SET) = 512
13018 read(10, "f\31\2603gJ>h\265z\342\207C\226]\310m\374\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
13018 lseek(10, 1536, SEEK_SET) = 1536
13018 read(10, "q\31|\31\210\31\222\31\234\31\245\31\256\31\302\31\313\31\327\31/\32B\32X\32d\32s\32\207\32"..., 512) = 512
13018 lseek(10, 244736, SEEK_SET) = 244736
13018 read(10, "\r\0\3710\0\0V\0\3720\0\0k\0\3730\0\0\207\0\3740\0\0\245\0\3750\0\0\314\0"..., 512) = 512
13018 close(10) = 0
13018 write(1, "ERROR:\n", 7) = 7
13018 write(1, "ORA-12547: TNS:lost contact\n", 28) = 28
13018 write(1, "\n", 1) = 1
13018 write(1, "\n", 1) = 1

说实话这里的日志参考意义不大,没有看出什么毛病

排除了sqlnet.ora; 环境变量; 文件权限等调用,lib包等问题

 

2.2 MOS 552979.1

SYMPTOMS
Oracle 10.2 has been installed in a new Oracle_Home
Preparing to perform post-upgrade steps
SQLPLUS command fails with following error ...
$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 5 10:04:01 2008 
Copyright (c) 1982, 2005, Oracle. All rights reserved. 
ERROR: 
ORA-12547: TNS:lost contact 
Enter user-name:
CHANGES
CAUSE
The make log shows a problem with config.o ...

Linking OSM Discovery utility (kfod) 
ld +s -G -b -o libsrvm10.sl { LINK OPTIONS } 
/<$ORACLE_HOME>/rdbms/lib/config.o { LINK OPTIONS } 
ld: I/O error, file "/<$ORACLE_HOME>/rdbms 
/lib/config.o": Invalid argument 
Fatal error. 
*** Error exit code 1 

Stop.
On further diagnosis, it found that OH/bin/oracle binary is of zero file size ...

$ ls -ld bin/ora* 
-rwsr-s--x 1 oracle dba 0 Aug 15 2005 bin/oracle 
-rwxr-xr-x 1 oracle dba 0 Jun 22 2005 bin/oracleO 

... and the <$ORACLE_HOME>/rdbms/lib/config.o object file is zero filesize as well ... 
$ cd $ORACLE_HOME/rdbms/lib 
$ ls -l config* 
-rw-r----- 1 oracle dba 255 Jan 18 11:43 config.c 
-rw-r----- 1 oracle dba   0 Jan 18 11:53 config.o
SOLUTION
config.o was not generated during the installation, and it will not be re-compiled if it already exists. Remove the zero-length config.o 
and then re-compile oracle as mentioned below $ cd $ORACLE_HOME/rdbms/lib $ rm config.o $ make -f ins_rdbms.mk config.o ioracle $ ls -l config* -rw-r----- 1 oracle dba 255 Jan 18 11:43 config.c -rw-r--r-- 1 oracle dba 1448 Feb 6 14:56 config.o $ cd $ORACLE HOME/bin $ ls -l oracle* -rwsr-s--x 1 oracle dba 112842648 Feb 6 14:57 oracle -rwsr-s--x 1 oracle dba 0 Aug 15 2005 oracleO Now, the problem should be solved and SQLPLUS should work.

实际环境与MOS并不是完全一致的!MOS有两个文件都为0,编译后config.o文件不为0;
实际情况,config.o文件是非零值, oracle0为0,编译后oracle0文件非0
因为是测试环境,因此尝试编译后有效!但是生产环境建议甚至考虑! 又遇到相同trace跟踪报错的可以考虑进行尝试,另外一个现象是这个测试库使用-R mysql:mysql /修改权限恢复导致本次的问题
and the <$ORACLE_HOME>/rdbms/lib/config.o object file is zero filesize as well

[oracle@t2 bin]$ ls -lrt oracle*
-rwxr-x---. 1 oracle oinstall 0 Aug 24 2013 oracleO
-rwxr-x--x. 1 oracle oinstall 239501456 Mar 27 2020 oracle

 

-rwxr-x--x. 1 oracle oinstall 239501456 Mar 27 2020 oracleO
-rwsr-s--x. 1 oracle oinstall 239501456 Jun 12 13:52 oracle


本次编译过程中,测试库单实例正在运行,DB alert存在告警!建议还是关库执行!

Sat Jun 12 14:01:57 2021
WARNING: Oracle executable binary mismatch detected.
Binary of new process does not match binary which started instance
issue alter system set "_disable_image_check" = true to disable these messages

 

 

Sqlplus报错ORA-12547

上一篇:MySQL | MySQL5.7.* 安装


下一篇:DM8_ODBC配置