EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS(OWNNAME=>'USERNAME'),收集用户下所有表,索引的统计信息。
SYS@J>EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS(OWNNAME=>'EDMADMIN')
PL/SQL procedure successfully completed.
SYS@J>conn edmadmin/J*****
Connected.
EDMADMIN@JLEDM01>SELECT sum(num_rows) FROM user_tables;
SUM(NUM_ROWS)
-------------
598951038
DMADMIN@J>select sum(num_rows) from user_indexes;
SUM(NUM_ROWS)
-------------
771129407
SYS@J>EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS(OWNNAME=>'EDMADMIN')
PL/SQL procedure successfully completed.
SYS@J>conn edmadmin/J*****
Connected.
EDMADMIN@JLEDM01>SELECT sum(num_rows) FROM user_tables;
SUM(NUM_ROWS)
-------------
598951038
DMADMIN@J>select sum(num_rows) from user_indexes;
SUM(NUM_ROWS)
-------------
771129407
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/196700/viewspace-1279517/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/196700/viewspace-1279517/