DBLink问题

shenleng 2003-03-12 04:08:45
我用sqlplus在服务器上建了个DBLink连接到其它的数据库,然后用这个连接将本地服务器的某个表的数据插入到远方的其它数据库中,我用sqlplus能够将数据插入到远方数据库,而我写到程序中时,在插入时出现了“ORA-02041: 客户数据库未开始一个事务处理”错误,我又在程序中起了个事务然后执行插入操作,还是出现上边的错误。请教各位专家,这是怎么回事?怎么解决?
...全文
37 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xunx 2003-04-21
  • 打赏
  • 举报
回复
楼上的老兄:请问同一个库中的两个用户之间能用DBLink吗?
xunx 2003-04-21
  • 打赏
  • 举报
回复
^_^
shenleng 2003-03-13
  • 打赏
  • 举报
回复
在下反过来试了试也是出现同样的错误
bzszp 2003-03-13
  • 打赏
  • 举报
回复
因为linkserver2是从dbserver1到dbserver2的数据库连接,
如果需要从dbserver2访问dbserver1,需要创建从dbserver2到dbserver1的数据库连接
czhai 2003-03-13
  • 打赏
  • 举报
回复
再建个链接试试!
shenleng 2003-03-12
  • 打赏
  • 举报
回复
为什么反之不行
supershb 2003-03-12
  • 打赏
  • 举报
回复
两数据库:dbserver1 dbserver2
在dbserver1有linkserver2.
连到dbserver1,则dbserver2的数据可以通过linkserver2插入到dbserver1.
反之则不行。
ropriest 2003-03-12
  • 打赏
  • 举报
回复
ORA-02041: client database did not begin a transaction
Cause: An update occurred at a coordinated database without the coordinator beginning a distributed transaction. This may happen if a stored procedure commits and then performs updates, and the stored procedure is invoked remotely. It could also happen if an external transaction monitor violates the XA protocol.
Action: If the cause is the former, check that any commit is not followed by an update.
ropriest 2003-03-12
  • 打赏
  • 举报
回复
如果:dblinks用sql*net而不是用odbc,必须通过一个客户端使用一个dblink(如sql*plus)连接到db。
用odbc:重新设置你的dsn,选择Disable MTS support选项。(如果没有,就需要更新odbc驱动)

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧