转载时请务必以超链接形式标明文章 原始出处和作者信息及本版权声明。
链接:http://www.dbasky.net/archives/2009/03/tns-12514.html
今天安装了oralce 11g,一切都很顺利的完成了安装,然后启动oralce的监听。
centos-> lsnrctl startLSNRCTL for Linux: Version 11.1.0.6.0 - Production on 16-FEB-2009 13:24:48
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /opt/oracle/product/11.0.13//bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.233)(PORT=1521)))
System parameter file is /opt/oracle/product/11.0.13/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/centos/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.233)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Start Date 16-FEB-2009 13:24:49
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/11.0.13/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/centos/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.233)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "nuage" has 1 instance(s).
Instance "nuage", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
登录本机数据库进行管理:
centos-> sqlplus " /as sysdba"SQL*Plus: Release 11.1.0.6.0 - Production on Mon Feb 16 13:25:29 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> startup
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
以上步骤都没有问题,接下来通过工具PLSQL
Developer来管理数据库,大致配置下客户端的tnsnames.ora即可。假设tnsnames.ora配置完成,
现在问题出现了,当我们通过PLSQL
Developer连接时出现了错误ORA-12514: TNS:
监听进程不能解析在连接描述符中。根据我的经验可以判断是listener.ora配置错误造成的,于是就去看listener的日志信息。
centos-> tail -f /opt/oracle/diag/tnslsnr/centos/listener/alert/log.xml
</msg>
<msg time='2009-02-16T12:59:22.834+08:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='centos'
host_addr='192.168.1.233'>
<txt>TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
</txt>
</msg>
原因:listener没设置好(很奇怪用configuration manager
新增的listener不能用)
手动修改了listener.ora之後就好了.listener.ora的内容如下:
# listener.ora Network Configuration File: /opt/oracle/product/11.0.13/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME=nuage)
(ORACLE_HOME = /opt/oracle/product/11.0.13/)
(SID_NAME=nuage))
(SID_DESC=
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/11.0.13/)
(PROGRAM = extproc)
)
)LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.233)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
顺便记录下tnsnames.ora的内容:
# tnsnames.ora Network Configuration File: /opt/oracle/product/11.0.13/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.LISTENER_NUAGE =
(ADDRESS = (PROTOCOL = TCP)(HOST = centos)(PORT = 1521))
NUAGE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = centos)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nuage)
)
)
发表评论