Oracle Query Table

Source: Internet
Author: User

--View User system permissions
SELECT * from Dba_sys_privs;
SELECT * from User_sys_privs;
--View User object permissions
SELECT * from Dba_tab_privs;
SELECT * from All_tab_privs;
SELECT * from User_tab_privs;

SELECT * from Dba_roles; --View all roles
--View the roles owned by the user:
SELECT * from Dba_role_privs;
SELECT * from User_role_privs;
--View the permissions that the role has
SELECT * from Role_sys_privs;
SELECT * from Role_tab_privs;

SELECT * from System_privilege_map; --View all system permissions
SELECT * from Table_privilege_map; --View All object permissions
--Query all the table names under all current users
SELECT * from tab;
SELECT * from Dba_tables;
SELECT * from Dba_objects;
SELECT * from Cat;
--View user-created tables
SELECT * from user_tables;--the current user's table
SELECT * from all_tables;--table for all users
SELECT * from dba_tables;--includes system tables
SELECT * FROM user_indexes;--querying table indexes for all users

--lookup table's primary key
Select cu.* from User_cons_columns cu, user_constraints au
where cu.constraint_name = Au.constraint_name
and Au.constraint_type = ' P ' and au.table_name = table to query

--lookup table's Uniqueness Index
Select column_name from User_cons_columns cu, user_constraints au
where cu.constraint_name = Au.constraint_name
and Au.constraint_type = ' U ' and au.table_name = table to query

--lookup table's foreign key
SELECT * FROM user_constraints C
where C.constraint_type = ' R ' and c.table_name = table to query
--Find the column name of the FOREIGN KEY constraint
SELECT * from User_cons_columns cl where cl.constraint_name = FOREIGN key Name
--Query the column name of the key referencing the table
SELECT * from User_cons_columns cl where cl.constraint_name = foreign key reference table key name
--Querying all columns of a table and their properties
Select t.*,c.comments from User_tab_columns t,user_col_comments C
where t.table_name = c.table_name and t.column_name = C.column_name
and t.table_name = table to query

Oracle Query Table

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.