Common query methods in oracle and common methods in oracle
Common query methods in oracle
Query all user information in oracle
Select * from dba_users;
Query only users and passwords
Select username, password from dba_users;
Query current user information
Select * from dba_ustats;
Query view text that users can access
Select * from dba_varrays;
Query the text of all views in the database
Select * from dba_views;
View the default tablespace of the current user
Select username, default_tablespace from user_users
View the role of the current user
Select * from user_role_privs
View the system and table-level permissions of the current user
Select * from user_sys_privs
Select * from user_tab_privs
View All tables under a user
Select * from user_tables
Display User Information (tablespace)
Select default_tablespace, temporary_tablespace from dba_users
Displays the permissions of the current session.
Select * from session_privs
Displays the system permissions of a specified user.
Select * from dba_sys_privs
Show privileged users
Select * from v $ pwfile_users
View tables whose names contain log characters
Select object_name, object_id from user_objects where instr (object_name, 'log')> 0
View the creation time of a table
Select object_name, created from user_objects where object_name = 'zw _ YINGYEZ'
View the size of a table
Select sum (bytes)/(1024*1024) tablesize from user_segments
Where segment_name = 'zw _ yingyez'
View the table in the ORACLE memory Partition
Select table_name, cache from user_tables where instr (cache, 'y')> 0
View the number and category of Indexes
Select index_name, index_type, table_name from user_indexes order by table_name
View indexed fields
Select * from user_ind_columns where table_name = 'cb _ CHAOBIAOSJ201004'
View index size
Select sum (bytes)/(1024*1024) as indexsize from user_segments
Where segment_name = upper ('as _ menuinfo ')
View view information
Select * from user_views
View synonym name
Select * from user_synonyms
View the status of functions and processes
Select object_name, status from user_objects where object_type = 'function'
Select object_name, status from user_objects where object_type = 'Procedure'
View the source code of functions and processes
Select text from all_source where owner = user and name = 'sf _ SPLIT_STRING'
View table fields
Select cname from col where tname = 'zw _ yingyez'
Select column_name from user_tab_columns where table_name = 'zw _ YINGYEZ'
Run the following command to view the oracle version:
Select * from v $ version