BEGIN SYS.DBMS_SCHEDULER.CREATE_JOB ( job_name => 'GATHERSTATS' ,start_date => TO_TIMESTAMP_TZ('2009/05/13 12:17:57.508450 +02:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm') ,repeat_interval => 'FREQ=HOURLY;' ,end_date => NULL ,job_class => 'DEFAULT_JOB_CLASS' ,job_type => 'PLSQL_BLOCK' ,job_action => ' begin dbms_stats.gather_table_stats( ownname=> ''TBR'', tabname=> ''LOGONS'' , estimate_percent=> DBMS_STATS.AUTO_SAMPLE_SIZE, cascade=> DBMS_STATS.AUTO_CASCADE, degree=> null, no_invalidate=> DBMS_STATS.AUTO_INVALIDATE, granularity=> ''AUTO'', method_opt=> ''FOR ALL COLUMNS SIZE AUTO''); comments=>'your comment here' END; /
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
Saturday, October 19, 2013
How to use the dbms_scheduler package to collect intermittent statistics on volatile tables
In the following example I am using the dbms_scheduler package to analyze certain volatile tables every hour:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment