oracle TNS问题 ORA-12154: TNS:could not resolve the connect identifier specified
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle TNS问题 ORA-12154: TNS:could not resolve the connect identifier specified相关的知识,希望对你有一定的参考价值。
listener.ora文件
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbs91.example.com)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
tnsnames.ora文件
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
CATDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbs91.example.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = catdb)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbs91.example.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.example.com)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
操作系统验证能登录sqlplus / as sydba
sqlplus sys/oracle@orcl as sysdba 不行
服务器与客户端同一台机
1、问题 ORA-12154: TNS:could not resolve the connect identifier specified ,即无法解析指定的连接,这说明缺少了一个环境变量,TNS_ADMIN 。
2、找到PLSQL中的oracle home(主目录)和OCI library(oci.dll地址)配置。
3、核对完上述问题后如发现问题仍旧没有解决,查看tnsnames.ora文件,查看数据库配置信息前面是否有空格。
4、查看环境变量的设置是否正确,在环境变量path中添加oracle客户端的安装路径。
参考技术A tns could not resolve the connect identifier specified意思是:TNS无法解决连接标指定识符的问题。可以添加环境变量,或者重新连接来解决问题。详细解释:
resolve 英[rɪˈzɒlv] 美[rɪˈzɑ:lv]
vt. 决心; 决定;
vt. 使消释; 使分解,使解体; (指委员会或集会) 表决; 消退(炎症等);
vi. 分解; 下决定;
[例句]We must find a way to resolve these problems before it's too late.
我们必须及时找到解决这些问题的方法。
identifier 英[aɪˈdentɪfaɪə(r)]
n. 识别符; 检验人,标识符; 鉴别器; 编号;
[例句]Another common mistake is to confuse a prefix with an identifier.
另一种常见的错误是混淆了前缀和标识符。
specified 英['spesɪfaɪd] 美['spesɪfaɪd]
v. 指定( specify的过去式和过去分词 ); 详述; 提出…的条件; 使具有特性;
[例句]They specified a spacious entrance hall.
他们专门指定要一个宽敞的大门厅。 参考技术B 应该是环境变量出错,几天前我也是一直报这个错,后来找身边弄好了的拷了一个
path==
D:\oracle\product\10.2.0\db_1\bin;D:\oracle\product\10.2.0\client_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\
由于我是oracle初学者,不能给你太多的帮助,谅解下 参考技术C XP系统下面安装了oracle11g 数据库以及PLSQL Developer7.0的数据库客户端
当我连接到远程服务器上面的oracle9数据库时,先是出现“could not load E:\app\Administrator\product\11.2.0\client_1\oci.dll”等一系列问题,
E:\app正是我oracle11g的安装目录,根据提示我查看了E:\app\Administrator\product\11.2.0目录下不存在client_1目录,
于是我又安装了一个10.0oracle客户端,再从该客户端的安装路径找到一个client_1目录将其拷贝到E:\app\Administrator\product\11.2.0目录下面,
本以为一切OK了,没想到出现了新的错误提示“could not resolve the connect identifier specified”,于是我添加环境变量后问题解决解决。
TNS_ADMIN ->> E:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN 参考技术D listener.ora文件
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
最后一行改成
(SID_NAME = orcl)
lsnrctl status 看一下监听状态,重启一下追问
试过了,侦听器正常的
追答ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbs91.example.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.example.com)
)
(SERVICE_NAME = orcl.example.com) 改成 (SERVICE_NAME = orcl)试试
把lsnrctl service 结果放上来看看
Oracle几个基础配置问题:ORA-12154: TNS: 无法解析指定的连接标识符ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务ORA-12516 TNS监听程序找(代
转载地址:http://www.cnblogs.com/zhaoguan_wang/p/5505701.html
问题1:ORA-12154: TNS: 无法解析指定的连接标识符
在一台服务器上部署了Oracle客户端,使用IP/SID的方式访问,老是报ORA-12154错误,而使用tnsnames访问却没有问题,对比了我本机的配置并查阅了一下资料,Easy Connect Naming Method这个东西是Oracle 10g推出的,需要在sqlnet.ora文件中添加EZCONNECT,如下:
# sqlnet.ora Network Configuration File: C:\\app\\Administrator\\product\\11.2.0\\client_1\\network\\admin\\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
问题2:ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
1、通过重启服务的方式启动数据库和监听服务,再次连接仍无法连接服务器。
2、考虑检查监听listener.ora文件的配置
监听配置文件listener.ora中可以不必指定监听的服务名(安装Oracle10g后也是没有指定的)。正常情况下一般只要数据库启动,客户端连接数据库也没有什么问题,但是有时重复启动关闭也会出现ORA-12514错误。
既然listener.ora中没有指定监听,我们可以在listener.ora文件中指定监听的实例名,这样该问题应该可以连接。
# listener.ora Network Configuration File: D:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\NETWORK\\ADMIN\\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\\app\\Administrator\\product\\11.2.0\\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\bin\\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = ora11r2)
(SID_NAME = ora11r2)
) )
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\\app\\Administrator
对应的正确配置截图如下:
问题3:ORA-12516 TNS监听程序找不到符合协议堆栈要求的可用处理程序
近期客户在正常使用系统过程中,经常遇到报错:监听程序找不到符合协议堆栈要求的可用处理程序,但是间隔几秒后又恢复正常
1、查看一下数据库现有的进程数,是否已经达到或接近参数processes的阈值:
select t1.*, t2.CurrentValue
from (select t.NAME, t.VALUE
from v$parameter t
where t.name in (‘processes‘, ‘sessions‘)
) t1
join (
select ‘processes‘ as name, count(1) as CurrentValue from v$process
union all
select ‘sessions‘ as name, count(1) as CurrentValue from v$session
) t2 on t1.name = t2.name
2、修改oracle的process和session值,加大他们最大连接数,修改完后重启Oracle服务:
SQL> alter system set processes=1000 scope=spfile;
SQL> alter system set sessions=1200 scope=spfile;
3、重启数据库,使更改生效
SQL> shutdown immediate;
SQL> startup;
SQL> show parameter processes;
以上是关于oracle TNS问题 ORA-12154: TNS:could not resolve the connect identifier specified的主要内容,如果未能解决你的问题,请参考以下文章
如何解决ORA-12154:TNS:无法解析指定的连接标识符
使用 Oracle,突然收到 ORA-12154 TNS: could not resolve message
Oracle几个基础配置问题:ORA-12154: TNS: 无法解析指定的连接标识符ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务ORA-12516 TNS监听程序找(代