declare
v_tName varchar(50);
v_sqlanalyze varchar(500);
v_num number;
v_sql varchar(500);
cursor c1 
is
select table_name from user_tables;
begin
open c1;
loop
fetch c1 into v_tName;
if c1%found then

v_sqlanalyze :='analyze table  '||v_tName||'  estimate statistics';
execute immediate v_sqlanalyze;
v_sql := 'select NUM_ROWS  from user_tables where table_name =upper('''||v_tName||''')';

execute immediate v_sql into  v_num;
dbms_output.put_line('表名: '||v_tName||' 行数: '||v_num);
else
exit;
end if;
end loop;
end;

 

相关文章:

  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-02-06
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案