It turns out that it (Oracle. ManagedDataAccess. Client) and then ORA-12516 troubleshooting

Source: Internet
Author: User
Recently ORA-12516 error frequency, I am also too annoying. However, the root cause cannot be found each time. You can only stop the listener, kill the process, or directly close the client program. Repeat the fault occurrence

Recently ORA-12516 error frequency, I am also too annoying. However, the root cause cannot be found each time. You can only stop the listener, kill the process, or directly close the client program. Repeat the fault occurrence

I have been fighting against ORA-12516 errors recently. In my previous article, the problem was solved temporarily through the kill process, but the problem was not found at all-why is a large number of connections produced by devices? After all, this problem was not solved at the time, and I continued to "torture" for nearly a month. During this period of time, someone was constantly looking for me-the database could not be connected !!! Where is the problem.

We will share with you the solution process and hope to learn from you.

Development Environment
Operating System: Windows Server 2008 R2 Standard
Database: Oracle 10g (10.2.0.4) 64bit

ORA-12516 with frequent Error Reporting, preliminary analysis
Recently ORA-12516 error frequency, I am also too annoying. However, the root cause cannot be found each time. You can only stop the listener, kill the process, or directly close the client program.
Repeat the fault phenomenon: database connection error, prompt "ORA-12516" error -- "ORA-12516: TNS: Listeners can not find matching protocol stack available handle ".

Why is the system architecture always stable?
The default value of the database processes parameter is 150, and the corresponding sessions is 170 ,;
We adopt the C/S architecture, where the number of clients is not large, that is, about 20. Therefore, the number of sessions under normal circumstances is about 40, including 16 internal database connections.
But now, the number of sessions is almost 130 ~ 140, directly cause ORA-12516 error.

The following is a query result:

SQL> set pagesize 150

SQL> set linesize 200

SQL> col username for a10

SQL> col terminal for a20

SQL> col program for a20

SQL> select username, program, terminal, count (*) from v $ session group by rollup (username, program, terminal );

Username program terminal count (*)

------------------------------------------------------------

Content is omitted here
ORACLE. EXE (q000) 1

ORACLE. EXE (q001) DBSERVER 1

ORACLE. EXE (q001) 1

16

SYS sqlplus.exe DBSERVER 1

SYS sqlplus.exe 1

SYS 1

HOEGH HOEGH.exe Client7 1

HOEGH HOEGH.exe CLIENT2 95

HOEGH HOEGH.exe Client3 1

HOEGH HOEGH.exe Client4 2

HOEGH HOEGH.exe CLIENT5 28

HOEGH HOEGH.exe Client6 1

HOEGH HOEGH.exe 128

HOEGH 128

145
We can see that the number of connections between Client 2 and Client 5 is 95 and 28, respectively.

Query the session and try to locate the faulty device.
Query the database connection through select username, program, terminal from v $ sessions; and you can see that the number of sessions of one or two servers reaches 30, and some even exceed 70. After you restart the application of the corresponding device (the application connects to the database), the problem can be quickly mitigated and sometimes ineffective.
The hardware or operating system of the Client device is suspected at first, because the operating systems in these devices are complicated (for convenience of testing in the laboratory ), including 32-bit Windows XP, 32-bit and 64-bit Win7, and 64-bit Win8.

After a long period of observation, we found that the faulty device is not fixed. That is to say, each device may become a faulty device ".

A little confused.

C # Clear the connection pool
After a long period of observation and preliminary analysis, it is concluded that this problem may not be directly related to a specific device, but to the current database disconnection judgment code.

In order to display the database connection status, our applications regularly connect to the database and play a "Heartbeat" role. We suspect that each device is connected to the database so frequently, but these connections are not released, so the number of sessions is increased after a long time, so we added a statement to the Code to clear the connection pool.

However, there is no effect.

In fact, we are skeptical about everything, because we used the same database "Heartbeat" mechanism in the past, and there has been no problem.

Add static listeners
Later on the Internet to check this ORA-12516, many friends mentioned through monitoring to find, solve the problem. I checked the Listener. log listening log of the database server. Good guy, it's over 80 M and the notepad cannot be opened. Finally, use UE to open the listening log, found that the large TNS-12514 inside the error.

Month-2015 16:26:53 * service_update * hoegh * 0

2015 16:26:56 * (CONNECT_DATA = (CID = (PROGRAM =) (HOST =__ jdbc _) (USER =) (SERVICE_NAME = hoegh )) * (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.3.191) (PORT = 50641) * establish * hoegh * 12514

TNS-12514: TNS: The Listener currently cannot identify the Service requested in the connection Descriptor

2015 16:26:58 * (CONNECT_DATA = (CID = (PROGRAM =) (HOST =__ jdbc _) (USER =) (SERVICE_NAME = hoegh )) * (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.3.191) (PORT = 50644) * establish * hoegh * 12514

TNS-12514: TNS: The Listener currently cannot identify the Service requested in the connection Descriptor

2015 16:26:58 * (CONNECT_DATA = (CID = (PROGRAM =) (HOST =__ jdbc _) (USER =) (SERVICE_NAME = hoegh )) * (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.3.191) (PORT = 50645) * establish * hoegh * 12514

TNS-12514: TNS: The Listener currently cannot identify the Service requested in the connection Descriptor

2015 16:26:58 * (CONNECT_DATA = (CID = (PROGRAM =) (HOST =__ jdbc _) (USER =) (SERVICE_NAME = hoegh )) * (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.3.191) (PORT = 50647) * establish * hoegh * 12514

TNS-12514: TNS: The Listener currently cannot identify the Service requested in the connection Descriptor

2015 16:26:58 * (CONNECT_DATA = (CID = (PROGRAM =) (HOST =__ jdbc _) (USER =) (SERVICE_NAME = hoegh )) * (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.3.191) (PORT = 50648) * establish * hoegh * 12514

TNS-12514: TNS: The Listener currently cannot identify the Service requested in the connection Descriptor

Month-2015 16:27:08 * service_update * hoegh * 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.