Oracle Consulting, Oracle Support and Oracle Training by Spyridon N. Kaparelis
osCommerce

Oracle

My Account      
  Oracle Scripts (Search) » Categories » Performance Tuning » Statistics » My Account          
Categories
Free Oracle Support (1)
Administration-> (120)
FlexCube (4)
ORA errors (14)
Oracle Application Server (1)
Oracle APPS DBA-> (38)
Oracle APPS DBA jobs (1)
Oracle Books (18)
Oracle RAC (3)
Oracle Real Cases (29)
Oracle Security (6)
Oracle SQL tricks (32)
Other Oracle sites (3)
Performance Tuning-> (53)
  ASH (3)
  AWR (3)
  Disk I/O (4)
  Hit ratios (3)
  How to start (1)
  Indexes (10)
  Oracle Wait Interface (20)
  Parallel processing (2)
  Statistics (7)
Site info
About Spyridon N. Kaparelis
Privacy Notice & Disclaimer
Buy Oracle APPS DBA Books
Ask for Free Oracle Support
Transfer partition statistics to another partition

Summary
It is very often to have a partitioned table and want to calculate or estimate the statistics for the partitions. Partitions usually holds millions of records, so calculating or estimating statistics its a bit time consuming effort. But if the partitions approximately have the same number of records then there is no need to calculate statistics for every partition.

One good idea is to calculate statistics for one partition and then to "copy" them to the other partitions.

How to export statistics from one partition and import them to another
In the example will use the table AX.AX_SLE_LINES which is partitioned (PART001, PART002, PART003, ...) and want the partition PART002 to have the same statistics as PART001

First you have to setup a table to hold the exported partition statistics

BEGIN
DBMS_STATS.CREATE_STAT_TABLE(ownname=>'AX', stattab=>'AX_SLE_LINES_STATS', tblspace=>'USERS');
END;
Second you have to export partition PART001 statistics to the table AX_SLE_LINES_STATS.
BEGIN 
DBMS_STATS.EXPORT_TABLE_STATS( 'AX', 'AX_SLE_LINES','PART001','AX_SLE_LINES_STATS','MY_AX_SLE_LINES_PART001',FALSE,'AX');
END;
Third you have to import the statistics to the partition PART002
BEGIN
DBMS_STATS.IMPORT_TABLE_STATS( 'AX', 'AX_SLE_LINES','PART002','AX_SLE_LINES_STATS','MY_AX_SLE_LINES_PART001',FALSE, 'AX');
END;
But if you query the dictionary you will notice that the statistics of the partition PART002 still is empty

Tip: You have to update the table that holds the statistics with the following value
UPDATE AX.AX_SLE_LINES_STATS SET C2='PART002';
COMMIT;
Import the statistics again!
BEGIN
DBMS_STATS.IMPORT_TABLE_STATS( 'AX', 'AX_SLE_LINES','PART002','AX_SLE_LINES_STATS','MY_AX_SLE_LINES_PART001',FALSE, 'AX');
END;

Added by Spyridon N. Kaparelis at Wednesday 26 November, 2008
Notifications more
NotificationsNotify me of updates to Transfer partition statistics to another partition
Tell A Friend
 
Reviews more
Write ReviewWrite review for the script
Read Latest Oracle News
Search at the site
 
Press Enter to search

Advanced Search
Search Error Messages

Oracle8i
Oracle9i
Oracle10g
Oracle11g
Search Oracle Docs

Metalink
Oracle8i
Oracle9i
Oracle10g
Oracle11g


osCommerce
Oracle APPS DBA Kaparelis | Oracle RAC | Oracle PLSQL | Oracle Tips | Oracle Consulting | Oracle Metalink | Oracle Support Oracle Training | Oracle Certification | Oracle Articles | Oracle DBA | Oracle Magazine | Oracle User Groups Oracle 7.3 Oracle 8 Oracle 8i Oracle9i Oracle10g Oracle11g EBS E-Business Suite 11.5.10 Oracle Apps Tuning Oracle SGA tuning sql tracing oracle session oracle errros ORA error ORA-600 Ora-00600 oracle jobs dba jobs apps dba jobs oracle experts oracle guru oracle oracle real application cluster oracle index oracle optimazation query oracle explain plan query optimization oracle I/O oracle memory tuning oracle xstress test oracle education oracle university oracle certification OCP OCA oracle support contracts oracle monitoring RAC interconnect developer oracle forms reports oracle application server Rman spyros dba oracle backup Veritas recovery catalog rcvcat oracle Σπυρίδων Καπαρέλης Ora-00600:[] Sp???d?? ?. ?apa????? oracle monitor daily operations free oracle support free consulting oracle seminars oracle arhitecture Unix linux HP-UX AIX Sun Solaris Windows TAR Service Request Metalink oracle disaster recovery oracle Data Guard Oracle Database Administrator Oracle Services low cost oracle support oracle patches upgrades apps dba spyros patch upgrade oracle opatch OUI export import oracle data pump ADDM ASM oracle OAS PGA shared pool ?p?st????? Oracle Application Server 10g consultans Oracle ERP CRM Apache WebUtil oracle 10g 11g 12g New Features Oracle courses development Oracle News forums Oracle Technical Docs FAQ Oracle Professionals Oracle DataCenter Data Center IT Oracle prices oracle software pricelist oracle carriers Oracle RDBMS Oracle Σπύρος Καπαρέλης Oracle Fusion Spiros Kaparelis oracle Spyros Kaparelis