Какая таблица словаря Oracle содержит информацию о привилегиях таблицы? - PullRequest
0 голосов
/ 27 мая 2020

Например, когда я go открываю свойства таблицы в sql разработчике, я вижу, каким пользователям (владельцам) был предоставлен доступ к этой таблице.

Если я хочу использовать запрос, чтобы найти всю эту информацию для группы таблиц и посмотреть, какие пользователи имеют к ним доступ, какую Oracle таблицу словаря данных я могу использовать?

Ответы [ 2 ]

0 голосов
/ 27 мая 2020

Хорошая особенность словаря состоит в том, что вы можете выбирать из него буквально. Например (это своего рода нечитаемый , потому что я установил столбцы по размеру экрана; GUI для этого лучше):

SQL> select table_name, comments
  2  from dictionary
  3  where lower(comments) like '%grant%';

TABLE_NAME           COMMENTS
-------------------- ------------------------------------------------------------
ALL_COL_PRIVS        Grants on columns for which the user is the grantor, grantee
                     , owner,
                      or an enabled role or PUBLIC is the grantee

ALL_COL_PRIVS_MADE   Grants on columns for which the user is owner or grantor
ALL_COL_PRIVS_RECD   Grants on columns for which the user, PUBLIC or enabled role
                      is the grantee

ALL_TAB_PRIVS        Grants on objects for which the user is the grantor, grantee
                     , owner,
                      or an enabled role or PUBLIC is the grantee

ALL_TAB_PRIVS_MADE   User's grants and grants on user's objects
ALL_TAB_PRIVS_RECD   Grants on objects for which the user, PUBLIC or enabled role
                      is the grantee

USER_AUDIT_STATEMENT Audit trail records concerning  grant, revoke, audit, noaudi
                     t and alter system

USER_COL_PRIVS       Grants on columns for which the user is the owner, grantor o
                     r grantee

USER_COL_PRIVS_MADE  All grants on columns of objects owned by the user
USER_COL_PRIVS_RECD  Grants on columns for which the user is the grantee
USER_ROLE_PRIVS      Roles granted to current user
USER_SYS_PRIVS       System privileges granted to current user
USER_TAB_PRIVS       Grants on objects for which the user is the owner, grantor o
                     r grantee

USER_TAB_PRIVS_MADE  All grants on objects owned by the user
USER_TAB_PRIVS_RECD  Grants on objects for which the user is the grantee
COLUMN_PRIVILEGES    Grants on columns for which the user is the grantor, grantee
                     , owner, or
                      an enabled role or PUBLIC is the grantee

ROLE_ROLE_PRIVS      Roles which are granted to roles
ROLE_SYS_PRIVS       System privileges granted to roles
ROLE_TAB_PRIVS       Table privileges granted to roles
TABLE_PRIVILEGES     Grants on objects for which the user is the grantor, grantee
                     , owner,
                      or an enabled role or PUBLIC is the grantee


20 rows selected.

SQL>
0 голосов
/ 27 мая 2020

Это будет DBA_TAB_PRIVS для всех объектов или USER_TAB_PRIVS для объектов, владельцем, праводателем или правопреемником которых является текущий пользователь.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...