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_LINKS
Specifies 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:
Both types of connections close when the session ends. You can also close a database link connection explicitly by issuingALTER SESSION CLOSE DATABASE LINK
Statement.
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_LINKS
Is 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_LINKS
To0
, 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_INSTANCE
Specifies 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_INSTANCE
Is different fromOPEN_LINKS
, Which indicates the number of connections from a session.OPEN_LINKS
Parameter is not applicable to XA applications.