Java. SQL. SQLException: ORA-24778: Unable to open the connection,

Source: Internet
Author: User

Java. SQL. SQLException: ORA-24778: Unable to open the connection,

Weblogic log reported: java. SQL. SQLException: ORA-24778: Unable to open the connection. The analysis function is used to perform multiple operations on a remote table. First, view the db_link parameters:

SQL> show parameter open_links
NAME TYPE VALUE
------------------------------------------------------
Open_links integer 4
Open_links_per_instance integer 4

Modify the parameters and restart the system:

Alter system set open_links = 50 scope = spfile;
Alter system set open_links_per_instance = 255 scope = spfile;

The official documents roughly mean:

Open_links is the maximum number of remote connections opened by a single session, including external stored procedures and external processes (external things ). The default value is 4 and the maximum value is 255. If it is set to 0, there is no distributed transaction.

Open_links_per_instance is the maximum number of remote connections opened by an instance. The default value is 4 and the maximum value is 4294967295. It is used in the XA driver of JDBC, while open_links does not run in the XA driver of JDBC.

I think the size setting of open_links_per_instance should be several times that of open_links. It should be clear when the database was just created, and it will be a bit depressing to modify and restart later.

OPEN_LINKS
Property Description
Parameter type Integer
Default value 4
Modifiable No
Range of values 0 to 255

OPEN_LINKSSpecifies the maximum number of concurrent open connections to remote databases in one session. These connections include database links, as well as external procedures and cartridges, each of which uses a separate process.

Oracle counts one open link for the following:

  • For each user that references a public or private database link

  • For each external procedure or cartridge connection when it is executed for the first time

Both types of connections close when the session ends. You can also close a database link connection explicitly by issuingALTER SESSION CLOSE DATABASE LINKStatement.

You shoshould set this parameter to allow for the external procedure and cartridge connections expected during the session plus the number of databases referred to in typical distributed transactions (that is, a single SQL statement that references multiple databases), so that all the databases can be open to execute the statement. for example, if queries alternately access databases A, B, and C, andOPEN_LINKSIs set2, Time will be lost waiting while one connection is broken and another made. Increase the value if your different databases are accessed over time.

This parameter refers only to connections used for distributed transactions. Direct connections to a remote database specified as an application connects are not counted.

If you setOPEN_LINKSTo0, Then no distributed transactions are allowed.

OPEN_LINKS_PER_INSTANCE
Property Description
Parameter type Integer
Default value 4
Modifiable No
Range of values 0 to 4294967295 (4 GB-1)
Real Application Clusters Multiple instances can have different values.

OPEN_LINKS_PER_INSTANCESpecifies the maximum number of migratable open connections globally for each database instance. XA transactions use migratable open connections so that the connections are cached after a transaction is committed. another transaction can use the connection, provided the user who created the connection is the same as the user who owns the transaction.

OPEN_LINKS_PER_INSTANCEIs different fromOPEN_LINKS, Which indicates the number of connections from a session.OPEN_LINKSParameter is not applicable to XA applications.

Related Article

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.