取 Oracle Schema信息
獲取表名
select TABLE_NAME from sys.user_tables;
獲取視圖名字
select VIEW_NAME from sys.user_views;
獲取表別名
select a.synonym_name,b.owner,b.object_name
from sys.user_synonyms a, sys.all_objects b
where a.table_owner=b.owner
????? and a.table_name=b.object_name
????? and OBJECT_TYPE='TABLE';
?????
獲取視圖別名?????
select a.synonym_name,b.owner,b.object_name
from sys.all_synonyms a,sys.all_objects b
where a.owner='PMBF'
????? and a.table_owner=b.owner
????? and a.table_name=b.object_name
????? and OBJECT_TYPE='VIEW';
?????
獲取字段信息
select COLUMN_NAME,DATA_TYPE,DATA_LENGTH,DATA_PRECISION,DATA_SCALE,NULLABLE
from sys.all_tab_columns
where owner='DWH'
????? and TABLE_NAME='EMPLOYEES'
order by column_id;
?????
獲取外鍵與主鍵信息
select b.owner,b.table_name,b.constraint_type,a.column_name
from? sys.all_constraints b,sys.all_cons_columns a
where b.constraint_type in ('R','P')
????? and b.owner=a.owner
????? and a.constraint_name=b.constraint_name
????? and a.owner='PMBF';
?????
獲取存儲過程
select OBJECT_NAME,PROCEDURE_NAME
from? sys.user_procedures;
獲取參數列表
select OBJECT_NAME,PACKAGE_NAME,ARGUMENT_NAME,DATA_TYPE,IN_OUT
from sys.user_arguments
order by OBJECT_NAME,PACKAGE_NAME,sequence;
轉載于:https://www.cnblogs.com/nanshouyong326/archive/2009/07/29/1534078.html
總結
以上是生活随笔為你收集整理的取 Oracle Schema信息的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PNGEncoder生成透明png图片
- 下一篇: VS2005水晶报表发布