[20170703]ora-12516 ora-12514 rac.txt

[20170703]ora-12516 ora-12514 rac.txt

--//生产系统出现问题.rac环境,版本11.2.0.4.OS版本 oracle linux 5.9 for 64.设计一些安全问题,我仅仅提供解决方案:

1.问题:
--//监听提示如下:
29-JUN-2017 22:05:47 *
(CONNECT_DATA=(SERVICE_NAME=aaahis)(CID=(PROGRAM=D:\laji\laji\laji.EXE)(HOST=ZLFL20170518)(USER=Administrator)))
* (ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xxx.xxx)(PORT=53974)) * establish * aaahis * 12516
TNS-12516: TNS:listener could not find available handler with matching protocol stack

$ oerr ora 12516
12516, 00000, "TNS:listener could not find available handler with matching protocol stack"
// *Cause: None of the known and available service handlers for the given
// SERVICE_NAME support the client's protocol stack: transport, session,
// and presentation protocols.
// *Action: Check to make sure that the service handlers (e.g. dispatchers)
// for the given SERVICE_NAME are registered with the listener, are accepting
// connections, and that they are properly configured to support the desired
// protocols.

--//说明一下:出现问题前,网络出现问题,出现环路.不知道是否与这个问题有关.

--//检查发现有1个服务运行在另外的实例上.

2.解决ora-12516:

$  ./dba_crs | grep .svc | grep zzzz
ora.zzzz.aaa430.svc                           ONLINE     ONLINE on dm01dbadm01
ora.zzzz.aaaemr.svc                           ONLINE     ONLINE on dm01dbadm02
ora.zzzz.aaahis.svc                           ONLINE     ONLINE on dm01dbadm02
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ora.zzzz.oims.svc                             ONLINE     ONLINE on dm01dbadm02

$  srvctl status service -d zzzz
Service aaa430 is running on instance(s) zzzz1
Service aaaemr is running on instance(s) zzzz2
Service aaahis is running on instance(s) zzzz2
Service oims is running on instance(s) zzzz2

--//估计出现异常,aaahis服务漂移到实例2上了.修改回来.

$  srvctl relocate  service -d zzzz -s aaahis -i zzzz2 -t zzzz1

$ srvctl status service -d zzzz
Service aaa430 is running on instance(s) zzzz1
Service aaaemr is running on instance(s) zzzz2
Service aaahis is running on instance(s) zzzz1
Service oims is running on instance(s) zzzz2

--//依旧不行,不过错误变成了ora-12514:

3.解决ora-12514:

30-JUN-2017 17:44:21 *
(CONNECT_DATA=(SERVICE_NAME=aaa430)(CID=(PROGRAM=D:\wamp\bin\apache\apache2.4.4\bin\httpd.exe)(HOST=DELL86)(USER=SYSTEM)))
* (ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xxx.xx)(PORT=1642)) * establish * aaa430 * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor

$ oerr ora 12514
12514, 00000, "TNS:listener does not currently know of service requested in connect descriptor"
// *Cause:  The listener received a request to establish a connection to a
// database or other service. The connect descriptor received by the listener
// specified a service name for a service (usually a database service)
// that either has not yet dynamically registered with the listener or has
// not been statically configured for the listener.  This may be a temporary
// condition such as after the listener has started, but before the database
// instance has registered with the listener.
// *Action:
//  - Wait a moment and try to connect a second time.
//  - Check which services are currently known by the listener by executing:
//    lsnrctl services <listener name>
//  - Check that the SERVICE_NAME parameter in the connect descriptor of the
//    net service name used specifies a service known by the listener.
//  - If an easy connect naming connect identifier was used, check that
//    the service name specified is a service known by the listener.
//  - Check for an event in the listener.log file.

$  srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

$  srvctl config scan
SCAN name: dm01-scan, Network: 1/192.168.100.0/255.255.255.0/bondeth0
SCAN VIP name: scan1, IP: /dm01-scan/192.168.100.108
SCAN VIP name: scan2, IP: /dm01-scan/192.168.100.109
SCAN VIP name: scan3, IP: /dm01-scan/192.168.100.107

--//手工执行:sqlplus xxxx/xxxx@dm01-scan/aaahis ,发现一些机器报ora-12514错误,一些机器从来都不报这个错误.
--//我在client执行 $ nslookup dm01-scan,可以发现出现的3个scan Ip出现的位置是轮询的.
--//思考:既然都出现在LISTENER_SCAN1这个监听上(对应IP=192.168.100.108),使用如下连接:

sqlplus xxxx/xxxx@192.168.100.108/aaahis
SQL*Plus: Release 11.2.0.4.0 Production on Fri Jun 30 10:50:19 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
--//问题再现.而使用aaaemr服务,无论任何scan IP都不会报错.

--//问题依旧.既然问题出现在连接192.168.100.108主机2(实例2)上,同事建议在实例2认为加入该服务看看.
--//先暂时这样看看.
SYS@zzzz2> ALTER SYSTEM SET service_names='oims','aaaemr','zzzz','aaa430','aaahis'  SCOPE=MEMORY SID='zzzz2';
System altered.

--//注:aaa430 服务也存在这个问题,也一起加上.再执行如上测试:
--//sqlplus xxxx/xxxx@192.168.100.108/aaahis
--//问题消失!! 很明显这样仅仅是权益之计,根本没有解决问题.服务aaa430,aaahis设置是实例1优先.

--//google查询ora-12514 rac,发现如下链接:
--//https://www.dba-resources.com/oracle/intermittent-ora-12514-error-connecting-to-scan-listeners/
--//http://blog.itpub.net/17252115/viewspace-1101967/
--//里面提到了bug 13066936.与里面的情况非常符合:

After SCAN VIP and SCAN listener failover, instance does not register with the SCAN listener. It might happen for only 1
of the scan listener. Client connection gets intermittent ORA-12514 TNS:listener does not currently know of service
requested in connect descriptor.

Cause:

1. Unpublished Bug 12659561  after scan listener failover, database instance might not register to the scan listener
   (refer Note 12659561.8), fixed in 11.2.0.3.2, merge patch 13354057 for 11.2.0.2 available for certain platform.
2. Unpublished Bug 13066936  Instance does not register services when scan fails over (refer Note 13066936.8)

Solution:

1) For both above bugs, the workaround is to unregister and register remote listener on the database instance which does
   not register to a SCAN listener with following steps.

show parameter remote_listener
alter system set remote_listener='';
alter system register;
alter system set remote_listener=':';
alter system register;

2) Other points to check if service is not registered with SCAN listener:
a. remote_listener and local_listener is defined correctly
b. EZCONNECT is defined in sqlnet.ora, eg: NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
c. SCAN name is defined in /etc/hosts or DNS and whether there is any mismatch if it is defined in both places
d. nslookup should display SCAN VIP in round-robin fashion
e. do not set SECURE_REGITER_ in listener.ora if the class of secure transports (COST) is not configured.

--//按照链接的介绍11.2.0.4版本已经解决了这个问题.不知道为什么.按照介绍执行如下:

--//原来执行的:
--//ALTER SYSTEM SET service_names='oims','aaaemr','zzzz','aaa430','aaahis'  SCOPE=MEMORY SID='zzzz2';

--//还原:
--//ALTER SYSTEM SET service_names='aaa430','zzzz','aaahis' SCOPE=MEMORY SID='zzzz1';
--//ALTER SYSTEM SET service_names='oims','aaaemr','zzzz'   SCOPE=MEMORY SID='zzzz2';

col remote_val new_value remote_val
select value remote_val from v$parameter where name='remote_listener';
alter system set remote_listener='';
alter system register;
--//host sleep 1
alter system set remote_listener='&remote_val';
alter system register;

4.测试:
--//执行前面的sql语句.测试OK,问题解决!!

时间: 2024-10-23 20:13:40

[20170703]ora-12516 ora-12514 rac.txt的相关文章

ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)

        不论是单实例还是RAC,对于非缺省端口下(1521)的监听器,pmon进程不会将service/instance注册到监听器,即不会实现动态注册.与单实例相同,RAC非缺省端口的监听器也是通过设置参数local_listener来达到目的.除此之外,还可以对实例进行远程注册,以达到负载均衡的目的.这是通过一个参数remote_listener来实现.   有关Oracle 网络配置相关基础以及概念性的问题请参考:      配置ORACLE 客户端连接到数据库   配置非默认端口

ORACLE RAC 监听配置 (listener.ora tnsnames.ora)

    Oracle RAC 监听器的配置与单实例稍有不同,但原理和实现方法基本上是相同的.在Oracle中 tns进程用于为指定网络地址上的一个或多个Oracle 实例提供服务注册,并响应来自客户端对该服务提出的连接请求.一旦连接请求到达,并派生出一个服务器进程建立服务器与用户端之间的连接(专有服务器dedicated server)或转发服务请求(共享服务器模式shared server).如果监听器知道多于一个实例提供所请求的服务,则可能会根据客户端与服务器端相关配置将请求定位到较低负载的

[20150924]tnsnames.ora是否可以带斜线.txt

[20150924]tnsnames.ora是否可以带斜线.txt --10g开始oracle支持ezconnect简单连接方式建立与数据库的连接. d:\tools\sqltemp>sqlplus scott/xxxxxx@192.168.100.40:1521/test.com SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 24 08:32:43 2015 Copyright (c) 1982, 2013, Oracle.  All r

[20170703]SQL语句分析执行过程.txt

[20170703]SQL语句分析执行过程.txt --//正常sql select语句执行需要这些过程,create cursor,parse,execute and fetch. --//dml估计缺少fetch步骤.参考vage的书写的例子,原书的例子存在问题,理解如下脚本对于sql语句如何执行很有益处. --//当然正常的编程很少有人这样写代码的. DECLARE    mcur     NUMBER;    mstat    NUMBER;    v_name   VARCHAR2 (

[20170703]pivot与order by字段.txt

[20170703]pivot与order by字段.txt --//11G开始支持pivot,上午写一个脚本,来自链接http://blog.itpub.net/267265/viewspace-1063539/ --//做了一点点改写. select * from ( WITH pivot_stats      AS (SELECT owner,                 object_name,                 statistic_name,             

[20160203]sequence与rac.txt

[20160203]sequence与rac.txt --前几天跟别人聊天提到对方管理的系统使用了大量的sequence,几乎每个表都以一个sequence作为主键. --我们的系统也是相似的情况,但是我们开发使用一个表来保存这些信息,这样导致另外的问题,会出现阻塞的情况. --sequence在rac中问题可能会放大,如果cache很小,并且使用order属性,会导致内联流量上升,并且出现row lock. --而且这些字段一般都要作为主键,或者讲这些字段一般会存在索引,这样导致另外的问题:

listener.ora,tnsnames.ora中一个空格的威力

最近几天被网络监听配置搞得焦头烂额,有时候配置没问题,有时候就出莫名其妙的问题,今天专门花时间总结了一下,希望对大家有所帮助. listener.ora,tnsnames.ora有时候没有netca,netmgr这样的图形工具来创建的时候,只能手工来做,手工做的时候会有一些格式的问题,多加一个空格,或者少一个空格,就会有不同的结果. 案例一 下面是一个监听的基本配置,我故意在前面多加了一个空格(黄色标记所示).  LISTE1=   (DESCRIPTION=     (ADDRESS_LIST

oracle的sqlnet.ora , tnsnames.ora , Listener.ora 文件的作用(转)

oracle网络配置三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora ,都是放在$ORACLE_HOME/network/admin目录下.1. sqlnet.ora-----作用类似于linux或者其他unix的nsswitch.conf文件,通过这个文件来决定怎么样找一个连接中出现的连接字符串.例如我们客户端输入sqlplus sys/oracle@orcl假如我的sqlnet.ora是下面这个样子SQLNET.AUTHENTICATION_SERVIC

[20141229]配置tnsnames.ora使用rsp文件

[20141229]配置tnsnames.ora使用rsp文件.txt --大部分配置tnsnames.ora,特别是服务器都是直接编辑,使用copy & paste. --我个人特别讨厌copy & paste 使用vim出现阶梯显示的情况,特别讨厌,我多次跟我同事在copy & paste设置:set paste来避免这种情况. --但是就是不改,按照他们的道理这样做是能正常访问的. --如果能看看我以前写的 http://blog.itpub.net/267265/views