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

PropertyDescription
Parameter typeInteger
Default value4
ModifiableNo
Range of values0 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

PropertyDescription
Parameter typeInteger
Default value4
ModifiableNo
Range of values0 to 4294967295 (4 GB -1)
Real Application ClustersMultiple 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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
java.sql.SQLException: ORA-01109: 数据库未打开ORA-01109是一个Oracle数据库错误代码,表示数据库无法在当前状态下打开。这个错误通常发生在以下几种情况下: 1. 数据库实例并未启动: 在使用Java连接Oracle数据库时,首先需要确保数据库实例已经启动。如果数据库实例没有运行,则会导致ORA-01109错误。请检查数据库实例是否已经启动,并尝试重新连接。 2. 数据库正在进行恢复操作: 如果数据库正在进行恢复操作,那么在恢复操作完成之前是无法打开数据库的。请等待数据库恢复完成后再进行连接。 3. 数据库文件损坏: 可能由于文件系统错误或其他原因,数据库文件损坏导致无法打开数据库。在这种情况下,可能需要使用Oracle数据库的恢复工具来修复数据库文件。 4. 数据库处于不可恢复的状态: 如果数据库处于不可恢复的状态,那么无法打开数据库。可能需要进行数据库的恢复操作来解决此问题。 解决该问题的方法包括: 1. 确保数据库实例已经启动。 2. 确保数据库没有进行恢复操作,并等待恢复操作完成。 3. 检查数据库文件是否损坏,并通过数据库恢复工具修复损坏的文件。 4. 如果数据库处于不可恢复的状态,可以尝试进行数据库的恢复操作。 总之,ORA-01109错误是表示数据库无法在当前状态下打开的错误。要解决这个问题,需要检查数据库实例状态,修复可能的文件损坏,并确保数据库处于可恢复的状态。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值