现场有一个同步误差,内容如下面:

   java.sql.BatchUpdateException: ORA-24777: 不同意使用不可移植的数据库链路
   at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10317)
   at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:216)
   at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:210)

   1.了解了一下功能,大致例如以下:
      有A、B两个数据库,在A数据库上建了一个dblink。在XA的JDBC驱动下,通过dblink就会出现这样的错误。

   2.此错误有些生僻,直接查metalink见附录。

两种解决方式供选择:

    a. Configure the database to allow the use of shared servers

ALTER SYSTEM SET DISPATCHERS="(PROTOCOL=TCP)" scope=both;

ALTER SYSTEM SET SHARED_SERVERS = 10 scope=both;

    b. Define the database link being utilised as a shared database link
     CREATE SHARED DATABASE LINK dblink_name
    [CONNECT TO username IDENTIFIED BY password]|[CONNECT TO CURRENT_USER]
    AUTHENTICATED BY schema_name IDENTIFIED BY password
     [USING 'service_name'];

   3.现场调整
      先用a方案在B数据库上调整了,用b方案在A数据库上做了调整。測试不行。再用a方案在A数据库上调整了。測试还是不行。

   4.到现场发现问题
      发现同义词不正确,就是没实用到这个shared的dblink。艹,这太让人郁闷了,调了半天,没实用到。

  
   我觉得的结论是:仅仅要把A库中的dblink改为shared的方式就能够了。

     

Using Database Links in Oracle XA Applications

Oracle XA applications can access other Oracle Database instances through database links with these restrictions:

  • They must use the shared server configuration.

    The transaction processing monitors (TPMs) use shared servers to open the connection to an Oracle Database A. Then the operating system network connection required for the database link is opened by the dispatcher instead of a dedicated server process. This
    allows different services or threads to operate on the transaction.

    If this restriction is not satisfied, then when you use database links within an XA transaction, it creates an operating system network connection between the dedicated server process and the other Oracle Database B. Because this network connection cannot be
    moved from one dedicated server process to another, you cannot detach from this dedicated server process of database A. Then when you access the database B through a database link, you receive an ORA-24777 error.

  • The other database being accessed must be another Oracle Database.

If these restrictions are satisfied, Oracle Database allows such links and propagates the transaction protocol (prepare, rollback, and commit) to the other Oracle Database instances.

If using the shared server configuration is not possible, then access the remote database through the Pro*C/C++ application by using EXECSQL AT syntax.

The init.ora parameter OPEN_LINKS_PER_INSTANCE specifies
the number of open database link connections that can be migrated. Thesedblink connections
are used by XA transactions so that the connections are cached after a transaction is committed. Another transaction can use the database link connection if the user who created the connection also created the transaction. This parameter is different from
the init.ora parameter OPEN_LINKS,
which specifies the maximum number of concurrent open connections (including database links) to remote databases in one session. The OPEN_LINKS parameter
does not apply to XA applications.

ORA-24777 reported when using a database link from within an XA coordinated transaction
(文档 ID 1506756.1)
转究竟部

In this Document

Symptoms
  Cause
  Solution

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

APPLIES TO:

Oracle Server - Enterprise Edition - Version 10.2.0.5 to 11.2.0.3 [Release 10.2 to 11.2]

Information in this document applies to any platform.

SYMPTOMS

ORA-24777 reported by a JDBC/XA application when utilising a database link between two Oracle databases.

CAUSE

An ORA-24777 is a warning that you are trying to utilise a database link within an XA coordinated transaction and the connection to the source database which is trying to use the database link has been made through a dedicated
server connection.



This is not allowed and this is documented in following entry



As per http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_xa.htm#ADFNS809



in the following section 'Using Database Links in Oracle XA Applications'.

SOLUTION

Two options



1. Configure the database to allow the use of shared servers and then let the application use these as per the following documentation



http://docs.oracle.com/cd/E11882_01/server.112/e25494/manproc003.htm#ADMIN00502



or establish whether the Java application needs to start an XA transaction.

OR



2. Define the database link being utilised as a shared database link, i.e,

CREATE SHARED DATABASE LINK ..

as per

http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5005.htm#SQLRF01205

版权声明:本文博主原创文章。博客,未经同意不得转载。

比ORA-24777: 我不使用不可移植数据库链接更郁闷的事情达成一致的更多相关文章

  1. tnsnames.ora配置注意(连接新的数据库)

    文件地址D:\app\think\product\11.2.0\instantclient_11_2\network\admin\tnsnames.ora# tnsnames.ora Network ...

  2. 不用配置tnsnames.ora,直接通过PL/SQL访问远程数据库

  3. Oracle Ora 错误解决方案合集

    注:本文来源于 < Oracle学习笔记 --- Oracle ORA错误解决方案 > ORA-00001: 违反唯一约束条件 (.)错误说明:当在唯一索引所对应的列上键入重复值时,会触发 ...

  4. Oracle 错误总结及问题解决 ORA

    参考地址 ORA-00001: 违反唯一约束条件 (.)错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常.ORA-00017: 请求会话以设置跟踪事件ORA-00018: 超出最大会话数O ...

  5. Oracle ORA

    ORA-00001: 违反唯一约束条件 (.) 错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常. ORA-00017: 请求会话以设置跟踪事件 ORA-00018: 超出最大会话数 OR ...

  6. ORA 各种oraclesql错误

    ORA-00001: 违反唯一约束条件 (.) ORA-00017: 请求会话以设置跟踪事件 ORA-00018: 超出最大会话数 ORA-00019: 超出最大会话许可数 ORA-00020: 超出 ...

  7. oracle的sqlnet.ora,tnsnames.ora,listener.ora三个配置文件

    总结: 1 .三个配置文件都是放在$ORACLE_HOME\network\admin目录下. 2 .sqlnet.ora确定解析方式 3 .listener.ora上设SID_NAME,通常用于JD ...

  8. mysql数据库移植

    在mysql数据库移植的时候,把自己电脑上mysql中data目录的一些重要文件复制到其他电脑上,先备份一下其他电脑上的mysql的data目录,然后替换! 例如我的mysql默认的数据库文件位置:  ...

  9. (五)u-boot2013.01.01 for TQ210:《移植前的准备及u-boot初编译》

    移植前的准备 移植前,要做的事情是搭建开发环境以及对U-boot源码的获取.首先说一下开发环境: 1.此次U-boot移植的硬件平台是天嵌的TQ210开发板: CPU:板载核心是S5PV210(Cor ...

随机推荐

  1. 打开 chm 帮助文件显示空白及解决方法

    有个很奇葩的解决方法:把 chm 文件用压缩软件压缩,然后用压缩软打开此压缩包,直接双击压缩包里面的 chm 文件 这虽然解决了问题,但是这不科学…… 分析:直接打开压缩包里面的文件,压缩包的文件是临 ...

  2. jquery处理页面元素

    处理父级页面中的元素 $(parent.document).find('#hidSendPerson').val(val);$(parent.document).find('#btnGo').clic ...

  3. 网页信息抓取进阶 支持Js生成数据 Jsoup的不足之处

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/23866427 今天又遇到一个网页数据抓取的任务,给大家分享下. 说道网页信息抓取 ...

  4. RH033读书笔记(3)-Lab 4 Browsing the Filesystem

    Lab 4 Browsing the Filesystem Sequence 1: Directory and File Organization 1. Log in as user student ...

  5. U菜1G变化8M该解决方案

    我有一个大小1G纽曼U菜,不幸中毒一年前,格式化后你刚刚离开8M该.然后不再格式正确. 尽管只有8M,但始终我觉得扔了可惜.曾经,它已被搁置.昨天突然心血来潮,我们决定尝试.活马医.想不到最后居然被我 ...

  6. WPF技术触屏上的应用系列(四): 3D效果图片播放器(图片立体轮放、图片立体轮播、图片倒影立体滚动)效果实现

    原文:WPF技术触屏上的应用系列(四): 3D效果图片播放器(图片立体轮放.图片立体轮播.图片倒影立体滚动)效果实现 去年某客户单位要做个大屏触屏应用,要对档案资源进行展示之用.客户端是Window7 ...

  7. quick-cocos2d-x endToLua 退出会卡住

    问题: 马上赚钱,退出会出现卡住,然后清理,死界面的情况,百思不得其解,昨天在做push的时候,突然发现.在android里面弹出一个退出对话框,点击确定退出,这时候调用endtolua时,有时也会切 ...

  8. NGUI 3.5教程(四)Atlas和Sprite(制作图片button)

    Atlas是NGUI的图集.我的理解是:Atlas把你的一些零散的图片,合并成一张图.这样做的优点是,能够减少Draw Call.我不了解它的底层运作机制,我猜应该也是再行进DXT之类的纹理压缩,所以 ...

  9. IIS7和IIS7.5备份和还原的方法

    windows2008的iis配置备份和iis6不同,在iis7中没有了6原来的保存配置xml的选项,而采用的是dos命令来进行iis7的备份.以下是win2008上iis7备份的方法. 首先打开CM ...

  10. POJ 2828 Buy Tickets(排队问题,线段树应用)

    POJ 2828 Buy Tickets(排队问题,线段树应用) ACM 题目地址:POJ 2828 Buy Tickets 题意:  排队买票时候插队.  给出一些数对,分别代表某个人的想要插入的位 ...