我正在研究適用於Oracle的應用程序。對於某種邏輯,我需要使用指定模式從給定數據庫用戶獲取表的列表。就我而言,我有一個已經授予給定模式訪問權限的用戶。所以,當我的代碼使用給定的憑據創建連接並嘗試從下面的查詢中獲取表時,它的返回表列表。需要授予哪個權限才能訪問sys.dba_systems
SELECT * FROM dba_objects where owner ='schema' and object_type = 'TABLE'
上面的查詢與用戶有授予的所有權限 ,但是當我做了有限許可的嘗試,它拋出錯誤味精工作。
ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
對於二級用戶,從我們的代碼是創建連接已經通過下面的查詢
create user johnsmith identified by Passw0rd;;
grant connect to johnsmith ;
grant select any table to johnsmith ;
grant UPDATE any table to johnsmith ;
grant DELETE any table to johnsmith ;
grant INSERT any table to johnsmith ;
我應該授予用戶權限哪家有以下系統表的訪問權限授予.. 。?
- DBA_OBJECTS
- USER_CONSTRAINTS
- USER_CONS_COLUMNS
- USER_TABLES
- all_tab_cols 並且還允許訪問dbms_metadata.get_dependent_ddl()方法