Search This Blog

Friday, 24 November 2017

Gathering stats

---------------------------------------------------------
Gathering stats
---------------------------------------------------------
Schema statistics:
EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS('<SCHEMA_NAME>',DBMS_STATS.AUTO_SAMPLE_SIZE);

System statistics:
EXEC DBMS_STATS.GATHER_SCHEMA_STATS ('SYS');
EXEC DBMS_STATS.GATHER_DATABASE_STATS (gather_sys=>TRUE);
EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

============================================================================

nohup ./gather_stats_RAJA023P.ksh  >test.log &

[orcldb@dcplnx22502624 sql]$ cat gather_stats_RAJA023P.ksh
sqlplus / as sysdba << eof
set time on timing on echo on;
spool gather_stats_RAJA023P.log
exec dbms_stats.gather_schema_stats(ownname => 'JOBPRO',cascade => TRUE);
spool off
exit
eof
=========================================================================

No comments:

Post a Comment