1.
select TABLE_NAME, CC.num_rows, CC.last_analyzed
2.
from tabs CC
经过查询资料发现,
从
tabs
表中获取的数据不是非常准确,
在
tabs
表中存在一
个字段
last_analyzed
,有最后分析的日期,好像都不是最新,可能导致数据不
是非常准确,可以通过在
command
下面执行
EXEC
dbms_stats.gather_table_stats('
【空间名称】
','
【
tablename
】
',cascade=>true);
,可以刷新
tabs
表中的
num_rows
列,以及最后更新时间
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Connected as rep_hea
SQL> EXEC dbms_stats.gather_table_stats('
【
username
】
','
【
tablename
】
',cascade=>true);
--
单个表统计数据的统计数据更新
PL/SQL procedure successfully completed
SQL> EXEC dbms_stats.gather_schema_stats('
【
username
】
',estimate_percent=>100,cascade=> TRUE);
--
更新整个用户所有表的统计数据更新
Java
代码