关于ORA-02070:database xxx does not support operator USERENV in this context解决
分布式系统中用的最多的是Database Link了,今天用数据库链路的时候出现了一个问题:
在update远程数据库中的表的时候出现如下错误:
比如执行这样的语句时:
UPDATE procedure_run_byshell_log_list@db_link a
SET (a.sid, a.serial#) =
(SELECT i.sid, i.serial#
FROM v$session i
WHERE i.sid IN (SELECT ii.sid FROM v$mystat ii WHERE rownum = 1));
SET (a.sid, a.serial#) =
(SELECT i.sid, i.serial#
FROM v$session i
WHERE i.sid IN (SELECT ii.sid FROM v$mystat ii WHERE rownum = 1));
This is a Bug(Bug ID:774807)
SQL command "insert into t1@db_link select * from t1"
always worked in 7.3.4, but the statement now fails on any version of Oracle8
解决方法:可以先将数据插入到临时表或者保存到变量中再插入或update到远程数据库中: