Oracle查詢所有 表、視圖、序列等信息查詢
select * from user_views;
select * from user_sequences;
select * from user_triggers;
想查找表的數據條數
試試這個
select t.table_name,t.num_rows from user_tables t
如果沒有值,那就創建個函數
代碼
create or replace function count_rows(table_name in varchar2,
owner in varchar2 default null)
return number
authid current_user
IS
num_rows number;
stmt varchar2(2000);
begin
if owner is null then
stmt := 'select count(*) from "'||table_name||'"';
else
stmt := 'select count(*) from "'||owner||'"."'||table_name||'"';
end if;
execute immediate stmt into num_rows;
return num_rows;
end
再執行查詢
select table_name, count_rows(table_name) nrows from user_tables
posted on 2012-04-19 09:21 歐陽良才 閱讀(2821) 評論(0) 編輯 收藏 所屬分類: ORACLE