Oracle View Current User information

Source: Internet
Author: User

Oracle View Current User information

First, view the current user information:

1. View the current user-owned Role Permissions information: SELECT * from Role_sys_privs;

2. View the details of the current User: SELECT * from User_users;

3. View the current user's role information: SELECT * from User_role_privs;

Summary: The data dictionary view in Oracle is divided into 3 categories, with prefixes distinguished by: User,all and DBA,

Many data dictionary views contain similar information.

User_*: Information about the object that the user owns, that is, the object information that the user creates.

All_*: Information about the objects that the user can access, that is, the information that the user creates for the object, plus the other user-created object but the user has permission to access the information.

Dba_*: Information about an object in the entire database.

Other:

View the relationship between the user and the default tablespace.
Select Username,default_tablespace from Dba_users;

1. View table structure: DESC table name

2. View the table for the current user:

  1. Select table_name
    1.  From
        1. User_tables;

      3. View the table names for all users:

      1. Select table_name
        1.  From
            1. All_tables;

          4. View all table names (including system tables)

          1. Select table_name
            1.  From
                1. All_tables;

              5. View all the tables:

                1. SELECT * from Tab/dba_tables/dba_objects/cat;

              The following describes the Oracle query user table space

              Oracle Query User Table space: 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 View Current User connection: SELECT * from V$session

              Oracle View Current User rights: SELECT * FROM Session_privs

              Oracle View User table space usage:
                1. Select a.file_id "Fileno", A.tablespace_name
                2. "Tablespace_name",
                3. A.bytes "bytes", A.bytes-sum (NVL (b.bytes,0)) "used",
                4. Sum (NVL (b.bytes,0)) "Free",
                5. Sum (NVL (b.bytes,0))/a.bytes*100 "%free"
                6. From Dba_data_files A, dba_free_space b
                7. where a.file_id = B. file_id (+)
                8. Group BY A.tablespace_name,
                9. A.file_id,a.bytes ORDER by A.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 the roles owned by the user:

              SELECT * from Dba_role_privs;

              SELECT * from User_role_privs;
              6. View the permissions that the role has:
              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 above is to view the user rights in Oracle,

              In the DB2:

              SELECT * FROM Syscat.dbauth

              Or

              Get authorizations
              View SIDs

              SELECT * FROM V$instance

Oracle View Current User information

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.