Introduction to Oracle 11g user permission query, oracle11g

Source: Internet
Author: User

Introduction to Oracle 11g user permission query, oracle11g

/** (Oracle 11g) User Permissions **/

-- Role and system Permissions

Select a. grantee,

A. granted_role,

To_char (replace (wm_concat (B. privilege), '|') privilege,

A. admin_option,

A. default_role

From dba_role_privs

Left join role_sys_privs B

On a. GRANTED_ROLE = B. ROLE

Where a. grantee = 'sbni'

Group by a. grantee, a. granted_role, a. admin_option, a. default_role

Union all

Select grantee, ''granted_role, privilege, admin_option, ''default_role

From dba_sys_privs

Where grantee = 'sbni'; -- Object permission

Select GRANTEE,

OWNER,

TABLE_NAME,

GRANTOR,

To_char (wm_concat (PRIVILEGE )),

GRANTABLE,

HIERARCHY

From dba_tab_privs

Where grantee = 'sbni'

Group by GRANTEE, OWNER, TABLE_NAME, GRANTOR, GRANTABLE, HIERARCHY; -- Summary: Role permissions, system permissions, User Permissions

Select a. grantee,

A. granted_role as "granted_role ---- table_name ",

To_char (replace (wm_concat (B. privilege), '|') privilege,

'Admin _ option: '| a. admin_option as "option ",

'Default _ role: '| a. default_role as "default_role ---- hierarchy"

From dba_role_privs

Left join role_sys_privs B

On a. granted_role = B. role

Where a. grantee = 'sbni'

Group by a. grantee, a. granted_role, a. admin_option, a. default_role

Union all

Select grantee,

''Granted_role,

Privilege,

'Admin _ option: '| admin_option as "option ",

''Ulult_role

From dba_sys_privs

Where grantee = 'sbni'

Union all

Select grantee,

Owner | '.' | table_name as "table_name ",

-- Grantor,

To_char (wm_concat (privilege) as "privilege ",

'Grant _ option: '| grantable as "option ",

'Hierarchy: '| hierarchy

From dba_tab_privs

Where grantee = 'sbni'

Group by grantee, owner, table_name, grantor, grantable, hierarchy;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.