??????Schema A???е????????
SQL> exec proc('iii');
PL/SQL procedure successfully completed
SQL> select * from a;
COL
----------------------------------------
Iii
SQL> grant execute on proc to b;
Grant succeeded
??????????Schema B??????????????????????
????SQL> conn b/b@sicsdb
????Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
????Connected as b
????SQL> create table a(col varchar2(10));
????Table created
????SQL> create synonym proc for a.proc;
????Synonym created
?????????????????????Schema B?е???洢????proc????????????????????
SQL> conn b/b@sicsdb
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
Connected as b
SQL> exec proc('JJJ');
PL/SQL procedure successfully completed
SQL> select * from a;
COL
----------------------------------------
????Schema B???????a??????????Schema A????????????
????SQL> select * from a.a;
????COL
????--------------------
????JJJ
????Iii
?????????????????????£????Schema???????????洢??????????漰??????????????????Oracle?洢?????е?“?????????”?????????????д洢???????????ζ??????????У???????????????????????????
?????????????????????а??????????????Schema A???????a??
????3??????????
????????????????????????????“?????????”???????????????????иó??????е??????????????е????????????????????????????????
??????????????????????????????????????????????????????????????Schema?е?????????????????????????
SQL> conn a/a@sicsdb
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
Connected as a
SQL>
SQL> create or replace procedure Proc(i_vc_name varchar2) AUTHID CURRENT_USER is
2  begin
3    insert into a values (i_vc_name);
4    commit;
5  end Proc;
6  /
Procedure created