ORA-12547: TNS:lost contact+oracle 开启监听失败

1、ORA-12547: TNS:lost contact

[root@dbserver /]# sqlplus sys/xiniu123 as sysdba                        

SQL*Plus: Release 12.2.0.1.0 Production on Sat Aug 26 12:55:34 2017

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

ERROR:
ORA-12547: TNS:lost contact


Enter user-name: 
ERROR:
ORA-12547: TNS:lost contact


Enter user-name: 
ERROR:
ORA-12547: TNS:lost contact

原因权限不够
确认$ORACLE_HOME/bin/oracle文件权限是否有问题

最初的权限
[root@dbserver /]#  ll $ORACLE_HOME/bin/oracle  
-rwxr-x--x. 1 oracle dba 407988851 Aug  1 12:50 /usr/oracle/product/bin/oracle

修改后正确的权限
[root@dbserver /]# chmod 6751 $ORACLE_HOME/bin/oracle  
[root@dbserver /]# ll $ORACLE_HOME/bin/oracle  
-rwsr-s--x. 1 oracle dba 407988851 Aug  1 12:50 /usr/oracle/product/bin/oracle

以上就可以解决了ORA-12547: TNS:lost contact问题了

2、oracle 开启监听失败

[root@dbserver bin]# lsnrctl start 

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 26-AUG-2017 10:49:54

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Starting /usr/oracle/product/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
NL-00280: error creating log stream /usr/oracle/product/network/log/listener.log
 NL-00278: cannot open log file
  SNL-00016: snlfohd: error opening file
   Linux Error: 13: Permission denied

Listener failed to start. See the error message(s) above...

做了1上面的授权操作这个问题没了,但是有引入新的问题

[oracle@dbserver trace]$ lsnrctl start

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 26-AUG-2017 13:28:31

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Starting /usr/oracle/product/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /usr/oracle/product/network/admin/listener.ora
Log messages written to /usr/oracle/product/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=196.160.1.211)(PORT=1521)))
TNS-01155: Incorrectly specified SID_LIST_LISTENER parameter in LISTENER.ORA
 NL-00303: syntax error in NV string

Listener failed to start. See the error message(s) above...

我做了如下操作,没有找到为什么监听失败的原因,但是已经可以连接了
步骤1
listener.ora
将**xxx**的内容删除

            **SID_LIST_LISTENER =  
               (SID_LIST =  
                    (SID_DESC =  
                      (SID_NAME = CLRExtProc)  
                      (ORACLE_HOME = /usr/oracle/product)  
                       (PROGRAM = extproc)  
                       (ENVS = "EXTPROC_DLLS=ONLY:/usr/oracle/product")  
                    )  
                )  
            (SID_DESC =
                (GLOBAL_DBNAME = ORCL)
                (ORACLE_HOME = /usr/oracle/product)
                (SID_NAME = ORCL)
            )**
LISTENER =
  (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = 196.160.1.211)(PORT = 1521))
        )
    )

ADR_BASE_LISTENER = /usr/oracle/product

步骤2 启动监听

[oracle@dbserver trace]$ lsnrctl start

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 26-AUG-2017 13:28:31

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Starting /usr/oracle/product/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /usr/oracle/product/network/admin/listener.ora
Log messages written to /usr/oracle/product/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=196.160.1.211)(PORT=1521)))
TNS-01155: Incorrectly specified SID_LIST_LISTENER parameter in LISTENER.ORA
 NL-00303: syntax error in NV string

Listener failed to start. See the error message(s) above...

[oracle@dbserver trace]$ lsnrctl start

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 26-AUG-2017 14:00:19

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Starting /usr/oracle/product/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /usr/oracle/product/network/admin/listener.ora
Log messages written to /usr/oracle/product/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=196.160.1.211)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                26-AUG-2017 14:00:19
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /usr/oracle/product/network/admin/listener.ora
Listener Log File         /usr/oracle/product/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=196.160.1.211)(PORT=1521)))
The listener supports no services
The command completed successfully

步骤3 将步骤1删除的内容重新添加上
listener.ora

**SID_LIST_LISTENER =  
               (SID_LIST =  
                    (SID_DESC =  
                      (SID_NAME = CLRExtProc)  
                      (ORACLE_HOME = /usr/oracle/product)  
                       (PROGRAM = extproc)  
                       (ENVS = "EXTPROC_DLLS=ONLY:/usr/oracle/product")  
                    )  
                )  
            (SID_DESC =
                (GLOBAL_DBNAME = ORCL)
                (ORACLE_HOME = /usr/oracle/product)
                (SID_NAME = ORCL)
            )**

步骤4 关闭数据库shutdown abort
步骤5打开数据库startup
以上就解决问题了

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值