EXPORT ESTADISTICAS
1.- execute dbms_stats.create_stat_table('IECV','STATS');
2.- execute dbms_stats.export_schema_stats('IECV','STATS','"PROD_2012-04-10"');
3.- exp \' / as sysdba\' table=iecv.stats file=stats.dmp
4.- imp \' / as sysdba\' full=y file=stats.dmp
5- Importamos las estadÃsticas desde la tabla STATS al esquema destino
EXECUTE DBMS_STATS.IMPORT_SCHEMA_STATS('IECV','STATS','"PROD_2012-04-10"');
6.- ANALYZE TABLE DELETE STATISTICS;
EXEC DBMS_STATS.DELETE_INDEX_STATS('IECV','IECV_OBSERVACION_CRUCE_OBCR');
EXEC DBMS_STATS.DELETE_TABLE_STATS('IECV','IECV_OBSERVACION_CRUCE_OBCR');
select index_owner, index_name, partition_name, last_analyzed, global_stats
from dba_ind_partitions
where index_owner = 'IECV'
order by index_owner, index_name, partition_name
/
spool estadisticas.log
BEGIN
SYS.DBMS_STATS.GATHER_TABLE_STATS (
OwnName => 'IECV'
,TabName => 'IECV_OBSERVACION_CRUCE_OBCR'
,Estimate_Percent => SYS.DBMS_STATS.AUTO_SAMPLE_SIZE
,Degree => 4
,Cascade => TRUE
,No_Invalidate => FALSE);
END;
/
No hay comentarios.:
Publicar un comentario