Oracle几个基础配置问题:ORA-12154: TNS: 无法解析指定的连接标识符、ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务、ORA-12516 TNS监听程序找不到符合协议堆栈要求的可用处理程序
Posted on 2016-05-18 16:28 召冠 阅读(29975) 评论(0) 编辑 收藏 举报问题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;