首先进行适当授权:
|
然后建立DB Link:
|
在此之后我们可以尝试使用DB Link进行远程和本地执行:
SQL> set serveroutput on
SQL> set feedback off
SQL> declare
2 r_gname varchar2(40);
3 l_gname varchar2(40);
4 begin
5 execute immediate
6 'select GLOBAL_NAME from global_name@hsbill' into r_gname;
7 dbms_output.put_line('gname of remote:'||r_gname);
8 select GLOBAL_NAME into l_gname from global_name;
9 dbms_output.put_line('gname of locald:'||l_gname);
10 end;
11 /
gname of remote:HSBILL.HURRAY.COM.CN
gname of locald:EYGLE
远程Package或Function调用也可以随之实现:
|
新闻热点
疑难解答