v檢視的授權

tonyzhou_cn發表於2012-11-08

例子:
查詢v$mystat說明沒有查詢許可權
@>connect
Connected.
user scott3 identified by "1";

User created.

create session to scott3;

Grant succeeded.

create view to scott3;

Grant succeeded.


Connected.
view my_stat as select * from v$mystat;
create view my_stat as select * from v$mystat
                                     *
ERROR at line 1:
ORA-00942: table or view does not exist


v$mystat;
ERROR:
ORA-04043: object "SYS"."V_$MYSTAT" does not exist

2、
select on v_$mystat to scott3;

Grant succeeded.


3、
v$mystat;
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
SID                                                NUMBER
STATISTIC#                                         NUMBER
VALUE                                              NUMBER

view my_stat as select * from v$mystat;

View created.

* from user_sys_privs;

USERNAME                       PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
SCOTT3                         CREATE VIEW                              NO
SCOTT3                         CREATE SESSION                           NO

* from user_tab_privs_recd;

OWNER                          TABLE_NAME
------------------------------ ------------------------------
GRANTOR                        PRIVILEGE                                GRA HIE
------------------------------ ---------------------------------------- --- ---
SYS                            V_$MYSTAT
SYS                            SELECT                                   NO  NO


* from user_role_privs;

no rows selected

 

 

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

相關文章