–创建临时表存统计信息表
DBMS_STATS.CREATE_STAT_TABLE('SYSDBA', 'OADB_ALLTB');
–收集用户统计信息
SELECT COUNT (*) FROM STAT$_OADB_ALLTB;;
–收集用户统计信息
DBMS_STATS.GATHER_SCHEMA_STATS('DMTEST',100,TRUE,'FOR ALL COLUMNS SIZE AUTO');
–导出用户统计信息
DECLARE
BEGIN
FOR RS IN (SELECT OWNER,TABLE_NAME FROM DBA_TABLES WHERE OWNER IN ('DMTEST'))
LOOP
DBMS_STATS.EXPORT_TABLE_STATS(RS.OWNER,RS.TABLE_NAME,NULL,'OADB_ALLTB','table stats',true);
END LOOP;
END;
命令:touch stats.ctl
vi stats.ctl
LOAD DATA
INFILE '/opt/gather.txt'
INTO TABLE "SYSDBA"."STAT$_OADB_ALLTB"
FIELDS '|'
[dmdba@localhost stats]$ /dm8/bin/dmfldr sysdba/SYSDBA control='/opt/stats.ctl' lob_directory='/opt' mode='out'
dmfldr V8
269 rows is load out
export success.
269 行数据已导出
用时:49.965(ms)
文章
阅读量
获赞