1、报错信息:
- ERROR:
- ORA-12547: TNS:lost contact
非oracle用户使用sqlplus username/password 后面不使用tnsname.ora 文件中连接字符串的名称时报错:ORA-12547: TNS:lost contact
3、解决方法:
第一步:查看$ORACLE_HOME/bin/oracle的权限:
- ll $ORACLE_HOME/bin/oracle
- -rwxr-x--x 1 oracle oinstall 239626731 Apr 6 14:22 /oracle/product/11.2.0/bin/oracle
第二步:修改oracle的权限为6751默认权限:
- chmod 6751 $ORACLE_HOME/bin/oracle
- -rwsr-s--x 1 oracle oinstall 239626731 Apr 6 14:22 /oracle/product/11.2.0/bin/oracle
实验模拟:
1、以mth用户登录系统,使用DB 账号mth以下面的方式连接数据库。
- [mth@TaylonMeng ~]$ sqlplus mth/mth
-
- SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 22 22:40:23 2016
-
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
-
- ERROR:
- ORA-12547: TNS:lost contact
- [mth@TaylonMeng ~]$ sqlplus mth/mth@MTH
-
- SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 22 22:43:52 2016
-
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
-
-
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
- SQL>
2、查看$ORACLE_HOME/bin/oracle该执行文件的权限
- [oracle@TaylonMeng ~]$ ll $ORACLE_HOME/bin/oracle
- -rwxr-x--x 1 oracle oinstall 239626731 Mar 16 23:16 /oracle/product/11.2.0/bin/oracle
3、修改 $ORACLE_HOME/bin/oracle的权限为默认的6751.
- [oracle@TaylonMeng ~]$ chmod 6751 /oracle/product/11.2.0/bin/oracle
- [oracle@TaylonMeng ~]$ ll $ORACLE_HOME/bin/oracle
- -rwsr-s--x 1 oracle oinstall 239626731 Mar 16 23:16 /oracle/product/11.2.0/bin/oracle
- SUID 权限仅对二进制程序(binary program)有效;
- 运行者对于该程序需要具有 x 的可运行权限;
- 本权限仅在运行该程序的过程中有效 (run-time);
- 运行者将具有该程序拥有者 (owner) 的权限。
- [mth@TaylonMeng ~]$ sqlplus mth/mth
-
- SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 22 23:07:27 2016
-
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
-
-
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
- SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30776559/viewspace-2120766/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30776559/viewspace-2120766/