Oracle同義詞 kingsql作品

kingsql發表於2013-03-15

SYS@hzh> create view t as select * from dba_users;

View created.

SYS@hzh> create public synonym ttt for t;

Synonym created.

SH@hzh> select * from t;

select * from t

*

ERROR at line 1:

ORA-00942: table or view does not exist

SH@hzh> select * from sys.t;

select * from sys.t

*

ERROR at line 1:

ORA-00942: table or view does not exist

SH@hzh> select * from ttt;

select * from ttt

*

ERROR at line 1:

ORA-00942: table or view does not exist

------------------------------------------------------------------------

①快照

SYS@hzh> grant all on t to public;

Grant succeeded.

SH@hzh> select * from t;

select * from t

*

ERROR at line 1:

ORA-00942: table or view does not exist

SH@hzh> select count(*) from sys.t

2 ;

COUNT(*)

----------

11

SH@hzh> select count(*) from ttt;

COUNT(*)

----------

11

------------------------------------------------------------------------------------------------------

②快照

SYS@hzh> grant all on ttt to public;

Grant succeeded.

SH@hzh> select * from t;

select * from t

*

ERROR at line 1:

ORA-00942: table or view does not exist

SH@hzh> select count(*) from sys.t;

COUNT(*)

----------

11

SH@hzh> select count(*) from ttt;

COUNT(*)

----------

11

 

--kingsql作品

轉載請註明出處

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28389881/viewspace-756276/,如需轉載,請註明出處,否則將追究法律責任。

相關文章