~沉%淀~

一切有为法,如梦幻泡影,如露亦如电,应作如是观

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

 


--
查询SCOTT用户中所有表的记录数 declare v_count number; query varchar2(4000); begin for i in (select table_name from all_tables where owner = 'SCOTT' order by 1) loop query := 'select count(*) from "' || i.table_name || '"'; execute immediate query into v_count; dbms_output.put_line(rpad(i.table_name, 35, ' ') || '-----' || v_count); end loop; end;

--查看分区表的行数 declare v_count number; query varchar2(4000); begin for i in (select table_name,partition_name from user_tab_partitions where table_name='DDM_TRANSACTION_LOG' order by 1) loop query := 'select count(*) from ' || i.table_name || ' partition(' || i.partition_name || ')' || ''; execute immediate query into v_count; dbms_output.put_line(rpad(i.partition_name, 35, ' ') || '-----' || v_count); end loop; end;

 

posted on 2021-03-05 09:53  ~沉%淀~  阅读(318)  评论(0编辑  收藏  举报