How to view users, permissions, and tablespaces in Oracle

Source: Internet
Author: User

Oracle view users, user permissions, user tablespaces, user default tablespaces 1. view the relationship between users and default tablespaces. Select username, default_tablespace from dba_users; 2. view the table of the current user: Select table_name from user_tables; 3. view the table names of all users: Select table_name from all_tables; 4. view All table names (including system tables) Select table_name from all_tables; 5. view All Tables: Select * From TAB/dba_tables/dba_objects/cat. The following describes how to query user tablespaces in Oracle. ◆ query user tablespaces in Oracle: select * From user_all_tables ◆ Oracle queries all functions and stored procedures: Select * From user_source ◆ Oracle queries all users: Select * From all_users.select * From dba_users ◆ Oracle views current user connections: select * from V $ session ◆ Oracle view current user permissions: Select * From session_privs ◆ Oracle view User tablespace usage: 1. select. file_id "fileno",. tablespace_name "tablespace_name",. bytes "bytes",. bytes-sum (nvl (B. bytes, 0) "used", sum (nvl (B. bytes, 0) "free", sum (nvl (B. bytes, 0)/. bytes * 100 "% free" from dba_data_files A, dba_free_space B where. file_id = B. file_id (+) group by. tablespace_name,. file_id,. bytes order by. tablespace_name; 1. view All users: Select * From dba_user; select * From all_users; select * From user_users; 2. view user system permissions: Select * From dba_sys_privs; select * From all_sys_privs; select * From user_sys_privs; 3. view user object permissions: Select * From dba_tab_privs; select * From all_tab_privs; select * From user_tab_privs; 4. view All roles: Select * From dba_roles; 5. view User Roles: Select * From dba_role_privs; select * From user_role_privs; 6. view the permissions of a role: Select * From role_sys_privs; select * From role_tab_privs; 7. view All system permissions select * From system_privilege_map; 8. view All object permissions select * From table_privilege_map; the preceding statements show user permissions in Oracle, and select * From syscat in DB2. dbauth or get authorizations to view Sid select * from V $ instance
Obtain the table: Select table_name from user_tables; // select table_name from all_tables for the current user's table; // select table_name from dba_tables for all users; // including the system table select table_name from dba_tables where owner = 'username' user_tables: table_name, tablespace_name, role, and other dba_tables: ower, table_name, tablespace_name, role, and other all_tables: ower, tablespace_name, last_analyzed, and other all_objects: ower, object_na Me, subobject_name, object_id, created, last_ddl_time, timestamp, status, and other table obtaining fields: Select * From user_tab_columns where table_name = 'user table '; select * From all_tab_columns where table_name = 'user table'; select * From region where table_name = 'user table'; user_tab_columns: table_name, column_name, data_type, data_length, data_precision, data_scale, nullable, column_id and other all_tab_columns: ower, table_name, column_nam E, data_type, data_length, data_precision, data_scale, nullable, column_id, etc. values: ower, table_name, column_name, data_type, data_length, data_precision, data_scale, nullable, and column_id: select * From user_tab_comments: table_name, table_type, comments -- corresponding to dba_tab_comments and all_tab_comments, which have more ower columns than user_tab_comments. Obtain field comments: Select * From user_col_comments: table_name, column_name, comments
Related Article

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.