常用Oracle查询语句(object, source, table, column, etc)

a) How to know table Owner

select * from all_tables t where t.table_name = 'XXXX';

(select * from user_tables t where t.table_name = 'XXXX';)

 

b) How to use source fragment to find source name

select * from user_source t where lower(t.text) like '%xxx%';

select * from all_source t where lower(t.text) like '%xxx%';

 

Note: user_source: name, type(PACKAGE,PACKAGE BODY), line, text:varchar2(4000)

 

c) How to find object information

select * from user_objects;

select * from all_objects;

 

d) How to find constrains

select * from user_constraints;

 

e) Column, etc

select * from user_tab_cols; --get each column properties 

select * from user_col_comments t where   lower(column_name) LIKE '%xxx%';

 

f) How to check Oracle version

select * from v$version;

 

 

 

 

你可能感兴趣的:(oracle)