exec dbms_stats.gather_schema_stats('LIFJ')---LIFJ是schema的名字'死机'是因为schema下面表/索引很多,系统需要时间处理

解决方案 »

  1.   

    现在的问题是
    1.select 'select '''||tname||''',count(*) from '||tname||';' from tab where tabtype='TABLE';
    如何用类似的语句得到正解.该语句的若干''''都是何意义.
    2.set pagesize 999       的意义即资料.
    3.以数据库JOB的方式       是什么意思,有何意义即资料.
    4.exec dbms_stats.gather_schema_stats('LIFJ');   dbms_stats是什么意思,有何意义即资料.
      

  2.   

    利用动态Sql
    create or replace function ROWCOUNT(tabName in string) return integer is
      Result integer;
      str string(200);
    begin
      str := 'SELECT NVL(COUNT(*),0) FROM ' ||tabName;
      EXECUTE IMMEDIATE str into Result ;
      return(Result);
    end ;select t.table_name, RowCount(t.table_name) from user_tables t;