----建立测试环境DBLINK:create database link lnk connect to user1 identified by pwd1 using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 172.17.211.114)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SID= REMOTEDB
----建立测试环境DBLINK:
create database link lnk
connect to user1
identified by pwd1
using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 172.17.211.114)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SID= REMOTEDB)))';
--创建物化视图,每隔两天自动同步更新一次;
CREATE MATERIALIZED VIEW DEPARTMENT
REFRESH FORCE
START WITH SYSDATE
NEXT SYSDATE + 2
WITH PRIMARY KEY
AS SELECT * FROM user1.DEPARTMENT@lnk WHERE 1=1; 结果提示:"ORA-01788: 此查询块中要求 CONNECT BY 子句"。

google无法访问,百度搜索太扯蛋,用必应,总算得到线索,解决方案:
在本地库中执行如下语句:
ALTER SYSTEM SET "_ALLOW_LEVEL_WITHOUT_CONNECT_BY"=TRUE SCOPE=BOTH
OK!
助人等于自助! 3w@live.cn
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号