Showing posts with label Performance Tuning. Show all posts
Showing posts with label Performance Tuning. Show all posts

Saturday, 7 June 2014

How to copy schema stats from one schema to another schema

Here we will see  how to copy schema statistics from one schema to another. Basically there are two methods for doing this: using DBMS_STATS or using Data Pump This is especially useful when doing large data transfers between either schemas or databases and statistics are needed fast. Remember that data density, row chaining or index cluster factor changed due to the data import and index rebuilds. Method 1: Using DBMS_STATS Extract the statistics First we need to login as schema owner which from which we want to extract...

Sunday, 25 May 2014

Restoring Optimizer Statistics

  In some cases we may find that gathering fresh statistics has led to the optimizer executing sub-optimal execution plans and we would like to restore the statistics as of a date when we had good performance. Here we can  restore table statistics to a previous point in the past by using the DBMS_STATS.RESTORE_TABLE_STATS package. We can check how far back in time we can go to restore statistics. SQL> select DBMS_STATS.GET_STATS_HISTORY_AVAILABILITY  from dual; GET_STATS_HISTORY_AVAILABILITY --------------------------------------------------------------------------- 13-MAR-14 10.51.37.266819000...

Total Pageviews