oracle 使用sql developer查询多个数据库连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13702271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
query multiple database connections with sql developer
提问by David Kakauridze
I have 2 database in ORACLE SQL DEVELOPER connections, con1 and con2 (with different schemas)
我在 ORACLE SQL DEVELOPER 连接中有 2 个数据库,con1 和 con2(具有不同的模式)
I need to create a view, based on columns from both db's , the method:
我需要创建一个视图,基于来自两个数据库的列,方法:
Create VIEW testviewAS (SELECT col1, col2, col3 FROM con1.table1);
ALTER VIEW AS (SELECT col1, col2, col3 FROM con2.table2);
It doesn't work.
它不起作用。
采纳答案by David Kakauridze
Found this solution
找到了这个解决方案
in the second connection worksheet I access grants on table2 to conection1 one
在第二个连接工作表中,我将 table2 上的授权访问到 conction1 one
GRANT SELECT on table2 to Connection1
and then I create view (on the 1sr connection worksheet):
然后我创建视图(在 1sr 连接工作表上):
Create VIEW testview AS (SELECT col1, col2, col3 FROM con1.table1);
ALTER VIEW AS (SELECT col1, col2, col3 FROM con2.table2);
回答by Gumowy Kaczak
Did you intend to do a union of two tables on different schemas?
您是否打算对不同架构上的两个表进行联合?
Create VIEW testviewAS (
SELECT t1.col1, t1.col2, t1.col3, t2.col1, t2.col2, t2.col3 FROM con1.table1 t1, con2.table2 t2 where t1.col1 = t2.col1
);