java.sql.SQLException:ORA-24778:无法打开连接

weblogic日志中报:java.sql.SQLException:ORA-24778:无法打开连接。分析功能是有多次对远程表的操作,先查看关于db_link的参数:

SQL> show parameter open_links

NAME                                 TYPE        VALUE

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

open_links                           integer     4

open_links_per_instance              integer     4

修改参数后重启系统:

alter system set open_links=50 scope=spfile;

alter system set open_links_per_instance=255 scope=spfile;

官方文档大致的意思是:

open_links是单个会话打开远程连接的最大数目,包括外部的存储过程,外部的进程(反正就是外部的东西)。默认值是4,最大值是255,当设置为0的时候说明没有分布式事务。

open_links_per_instance是一个实例打开远程连接的最大数目。默认值是4,最大是4294967295,运用于JDBC的XA驱动,而open_links不运用于JDBC的XA驱动。

我认为open_links_per_instance大小设置应该是open_links的几倍,且在刚建立数据库时就应该明确,后期修改重启有点郁闷。

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:

  • 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 issuing an ALTER SESSION CLOSE DATABASE LINK statement.

You should 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, and OPEN_LINKS is set to 2,
time will be lost waiting while one connection is broken and another made. Increase the value if many 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 set OPEN_LINKS to 0, 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 from OPEN_LINKS, which indicates the number of connections from a session. The OPEN_LINKS parameter
is not applicable to XA applications.

时间: 2024-09-29 03:15:44

java.sql.SQLException:ORA-24778:无法打开连接的相关文章

javax.transaction.xa.XAException: java.sql.SQLException: 无法创建 XA 控制连接。(SQL 2000,SQL2005,SQL2008)

javax.transaction.xa.XAException: java.sql.SQLException:无法创建 XA 控制连接.错误: 未能找到存储过程'master..xp_sqljdbc_xa_init'. 配置JTA  SQL Server XADataSource参考:http://technet.microsoft.com/zh-cn/library/aa342335.aspx 来源:http://blog.csdn.net/gjf8510/article/details/1

连接mysql时提示java.sql.SQLException: Access denied for user 'root'@'DESKTOP-N2B2D9A' (using password: YES)

用root连接mysql时提示:访问被拒绝 检查一下mysql server是否开启,发现后台在运行着..  然后查了一下mysql的用户表,发现root只能运行使用本地ip(localhost或者127.0.0.1)进行连接 解决方法:新开一个权限GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'jeffw' WITH GRANT OPTION; 然后查询一下:select * from user; 新开的root的已经开启权限,

MySQL java连接被拒绝:java.sql.SQLException: Access denied for user 'root'@'****' (using password: YES)

java.sql.SQLException: Access denied for user 'root'@'***.**.**.**' (using password: YES) MySQL服务器部署在Linux上,错误中被我隐掉的是我的公网IP. 这是由于"IP为***.**.**.**,名字为root"的用户 没有权限访问数据库 解决办法: 通过Navicat连接数据库,执行下面内容: grant all privileges on *.* to [email protected]

java连接sqlserver2008报错 java.sql.SQLException: 对象名 '表名' 无效.

注意:c3p0的数据库配置方式为: <named-config name="sqlsvr"> <property name="driverClass">net.sourceforge.jtds.jdbc.Driver</property> <property name="jdbcUrl">jdbc:jtds:sqlserver://localhost:1433/WaterNet_DaFeng<

今天线上系统碰到个怪问题DBCP数据连接异常,java.sql.SQLException: Already closed.

java.sql.SQLException: Already closed. at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:84) ~[commons-dbcp-1.2.2.jar:1.2.2] at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.jav

java.sql.SQLException: 关闭的连接 解决办法

程序如果长时间不进行数据库操作,那么数据源中的 Connection 很可能已经断开.其原因有可能是防火墙,或者连接的数据库设置的超时时间.这里使用的是 C3P0 连接 oracle 数据库,引起的异常信息为: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.Transac

Caused by: java.sql.SQLException: Access denied for user &#39;root&#39;@&#39;192.168.6.131&#39; (using password: YES),远程连接数据库,连接不上解决方案

进入 mysql   ; use mysql; 然后 执行 GRANT ALL PRIVILEGES ON *.* TO [email protected]"你.的.端.口" IDENTIFIED BY "你的密码" WITH GRANT OPTION; FLUSH PRIVILEGES; 然后成功 Caused by: java.sql.SQLException: Access denied for user 'root'@'192.168.6.131' (usi

连接mysql报错java.sql.SQLException: The server time zone value &#39;?й???????&#39; is unrecognized...解决方法

报错内容: java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time

hibernate java.sql.SQLException

异常:java.sql.SQLException oracle.net.ns.NetException java.net.ConnectException 提示:The Network Adapter could not establish the connection 提示:网络适配器无法建立连接 这个错误一般使因为服务没有打开导致的