The Largest Online Resource for Oracle Articles, Oracle Tips, Oracle Scripts & Oracle Tools!!


Enter your Email:
 
Navigate at FreeMegaZone Home      Articles      Tools      Jobs      Games      Support      Submit Content      Advertise

Advertise at FreeMegaZone

Give tremendous boost to your business by advertising at FreeMegaZone. Contact webmaster@freemegazone.com

 
Rating: *****                                             Rate this article:    

Author: Yuri van Buren

Page: 1 2 3 4

Oracle 11g enables you to default values of gather_database_stats with set_global_prefs, set_database_prefs, set_schema_prefs, set_table_prefs in the dbms_stats package. Oracle 11g also enables you to separate statistic gathering from statistic publishing. The benefit of separating statistic gathering from statistic publishing is that you can control when new statistics are published. Oracle By Example (OBE) scripts have made the life of database administrators easy by speeding up the testing of this powerful 11g feature.

Importing custemers_obe.dmp File:

First of all you need to import custemers_obe.dmp file under the SH Schema.

imp sh/sh file= customers_obe.dmp log=imp.log full=y

SQL> connect sh/sh

Setting STALE_PERCENT:

STALE_PERCENT determines the percentage of rows in a table that have to change before the statistics on that table are deemed stale and should be re-gathered. You can check the default settings of STALE_PERCENT by running below command

select dbms_stats.get_prefs ('STALE_PERCENT', ‘SH', ‘MY_STALE_PERCENT_TABLE') stale_percent from dual;

You can change the default setting for the database STALE_PERCENT by running below command.

execute dbms_stats.set_global_prefs ('STALE_PERCENT', ‘13');

Oracle 11g enables you to change STALE_PERCENT parameter on a table by table basis. For example you can run below command to set the STALE_PERCENT for the MY_STALE_PERCENT_TABLE table to 55%.

execute dbms_stats.set_table_prefs ('SH', ‘MY_STALE_PERCENT_TABLE', ‘STALE_PERCENT', ‘55');

In order to reset this parameter first you need to delete the table preference set on MY_STALE_PERCENT_TABLE so that the table has the global default value.

execute dbms_stats.delete_table_prefs ('SH', ‘MY_STALE_PERCENT_TABLE', ‘STALE_PERCENT');

select dbms_stats.get_prefs ('STALE_PERCENT', ‘SH', ‘MY_STALE_PERCENT_TABLE') stale_percent from dual;

Then reconnect as system or sysdba to reset the global defaults. Set the preference value to null and that restores the factory default value.

SQL> execute dbms_stats.set_global_prefs('STALE_PERCENT', null);

SQL> conn sh/sh
SQL> select dbms_stats.get_prefs ('STALE_PERCENT', ‘SH', ‘MY_STALE_PERCENT_TABLE')
stale_percent from dual;
Continued...

Page: 1 2 3 4

 More Database Articles
   Database Security: Step by step guideline
   Great Tips on Table Recovery with RMAN Backup!!
   A Guideline for Oracle Instantiation with RMAN!
   Exciting Oracle 11g features you should not miss to know!!
   Oracle Tips for Monitoring Oracle Import Speed!!


 

 
HOME      ABOUT US      SUPPORT      SITE MAP      PRIVACY POLICY      TERMS OF USE      SUBMIT CONTENT      ADVERTISE
Copyright © 2007 - 2010 Oriole Intellect Inc. All rights reserved.

The name Oracle is a trademark of Oracle Corporation. Any other names used on this website may be trademarks of their respective owners