Gather Schema Statistics program generates statistics that quantify the data distribution and storage characteristics of tables, columns, indexes, and partitions.
As a general rule, run Gather Schema Statistics under the following circumstances:
1. After there has been a significant change in data in either content or volume.
2. After importing data.
3. Any time end-users notice deterioration in performance in routine day-to-day business transactions or when running concurrent programs.
4. Run on a regular basis (weekly at a minimum) and anytime after application of patch, conversion, etc.
Type :
- GATHER_INDEX_STATS, Index statistics
- GATHER_TABLE_STATS, Table, column, and index statistics
- GATHER_SCHEMA_STATS,Statistics for all objects in a schema
- GATHER_DICTIONARY_STATS,Statistics for all dictionary objects
- GATHER_DATABASE_STATS,Statistics for all objects in a database
Example :
begin
dbms_stats.gather_schema_stats
(ownname => 'Scott',
estimate_percent => dbms_stats.auto_sample_size E "sample_size",
options => 'GATHER EMPTY'
);
end;
The above call starts the gather_schema_stats for a schema called SCOTT with estimate_percent at default sample size and options gather empty which gathers statistics on objects which currently have no statistics.
You can disable automated statistics collection job using the code below :
EXEC dbms_scheduler.disable(’GATHER_STATS_JOB’);
To re-enable the job:
EXEC dbms_scheduler.enable(’GATHER_STATS_JOB’);
To check if it job running or not
SELECT * FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'GATHER_STATS_JOB';
Thank you
Osama mustafa
Like this:
Like Loading...
Related
Published by Osama Mustafa
Osama considered as one of the leaders in Cloud technology, DevOps and database in the Middle-East. I have more than ten years of experience within the industry. moreover, certfied 4x AWS , 4x Azure and 6x OCI, have also obtained database certifications for multiple providers.
In addition to having experience with Oracle database and Oracle products, such as middle-ware, OID, OAM and OIM, I have gained substantial knowledge with different databases.
Currently, I am architecting and implementing Cloud and DevOps. On top of that, I'm providing solutions for companies that allow them to implement the solutions and to follow the best practices.
View all posts by Osama Mustafa