Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







ORA-30678 too many open connections tips

Expert Oracle Database Tips by Donald BurlesonAugust 18, 2015

Question:  I am using the utl_tcp package of Oracle to connect to remote server. As per my architecture, I am opening multiple connections TCP in the same Oracle session, and I hit a limitation of 16 connections with this package, getting this ORA-30678 error.

ORA-30678 too many open connections

How to I establish additional connections?

Answer: The documentation says this on the ORA-30678 error, noting that you have hit a hard limit of 16 connections:

ORA-30678 too many open connections
Cause:  An attempt to open a connection failed because too many are already open by this session. The number of allowed connections varies as some may be in use through other components which share the same pool of allowed connections.
Action:  Retry after closing some other connection. The number of connections supported is currently not adjustable.

The utl_tcp package has a set limit of 16 per session. You can't change it so you'll need to change the design of your application. As shown in this great article, be sure to always call an explicit quit using utl_smtp.quit().

It appears that the utl_tcp package has a hard limit of 16 concurrent connections, but connections come-and-go quickly. 

To avoid the ORA-30678 error you need to close some connections and you can include 'utl_tcp.close_all_connections' at the entry point to avoid this error.

Paulo Portugal notes:

If you are facing ORA-30678 errors when using UTL_TCP or UTL_SMTP packages :

ORA-30678: too many open connections
ORA-06512: at "SYS.UTL_TCP", line 28

You really need to close your connections after working with then as they are not closed automatically.  Here is a simple example of both UTL_TCP and UTL_SMTP packages, or you can close all connections using utl_tcp.close_all_connections as mentioned before.:

--TCP example
my_conn utl_tcp.connection;


--Open connection
my_conn := utl_tcp.open_connection(
remote_host => '',
remote_port => 80,
charset => 'AL16UTF16');

-- Explicitly close the connection oppened
utl_tcp.close_connection(c => my_conn);

when others then
raise_application_error (-20002,'An error has occurred.');


--SMTP example
my_conn utl_smtp.connection;

-- open smtp connection
my_conn := utl_smtp.open_connection(
host => '',
port => 25);

-- Explicitly close the connection oppened
utl_smtp.quit(c => my_conn);

when others then
raise_application_error (-20002,'An error has occurred.');


Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.



Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster