Gathering statistics on partitioned and non-partitioned tables

Hi all,
My DB is 11.1
I find that gathering statistics on partitioned tables are really slow.
TABLE_NAME                       NUM_ROWS     BLOCKS SAMPLE_SIZE LAST_ANALYZED PARTITIONED COMPRESSION
O_FCT_BP1                        112123170     843140    11212317 8/30/2011 3:5            NO                    DISABLED
LEON_123456                      112096060     521984    11209606 8/30/2011 4:2           NO                   ENABLED
O_FCT                           115170000     486556      115170 8/29/2011 6:3            YES        
SQL> SELECT COUNT(*)  FROM user_tab_subpartitions
  2  WHERE table_name =O_FCT'
  3  ;
  COUNT(*)
       112I used the following script:
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname          => user,
                                tabname          => O_FCT',
                                method_opt       => 'for all columns size auto',
                                degree           => 4,
                                estimate_percent =>10,
                                granularity      => 'ALL',
                                cascade          => false);
END;
/It costs 2 mins for the first two tables to gather the statistics respectively, but more than 10 mins for the partitioned table.
The time of collecting statistics accounts for a large part of total batch time.
And most jobs of the batch are full load in which case all partitions and subpartitions will be affected and we can't just gather specified partitions.
Does anyone have some experiences on this subject? Thank you very much.
Best regards,
Leon
Edited by: user12064076 on Aug 30, 2011 1:45 AM

Hi Leon
Why don't you gather stats at partition level? If your partitions data is not going to change after a day (date range partition for ex), you can simply do at partition level
GRANULARITY=>'PARTITION' for partition level and
GRANULARITY=>'SUBPARTITION' for subpartition level
You are gathering global stats every time which you may not require.
Edited by: user12035575 on 30-Aug-2011 01:50

Similar Messages

  • Can we addnew partition and sub partition in the existing table in one shor

    can we addnew partition and sub partition in the existing table in one short

    nav wrote:
    can we addnew partition and sub partition in the existing table in one shortYes,
    You can and below is the example for Range-List partition
    ALTER TABLE <table_name>
       ADD PARTITION <partition_name> VALUES LESS THAN (<value>
          STORAGE (INITIAL 20K NEXT 20K) TABLESPACE <TS name> NOLOGGING
              SUBPARTITION Clause
              SUBPARTITION Clause
              SUBPARTITION Clause
              SUBPARTITION Clause
               );

  • EAR4 - Gathering Statistics, unusable indexes and more

    Hi,
    Some feedback on statistics:
    1. When choosing a table -> Statistics -> gather Statistics, the minimum is to have a CASCADE option (so all the indexes will be analyzed too). I think it should be the deafult! This way there is a chance that the developers will have good statistics...
    As a bonus, an advanced tab with the rest of the options might be nice, when you have time.
    2. When choosing to gather statistics on an index, you should you dbms_stats and not ALTER INDEX... COMPUTE STATISTICS which is a deprecated syntax.
    And about indexes:
    1. When looking at the index tab of a table, unusable indexes should be visibly different - maybe just color the status column. Well, any color-coding can help to gain more infomation very fast (index types and index status). Well, I guess the same goes for disabled triggers, disabled constraints etc...
    2. When right-clicking an index in an index tab of a table, the only option is export, which makes no sense. Could you replace it with the six relevant index options, just like when we right click an index in the side bar (drop, rebuild, rename, make unusable...)
    Well, same goes for the triggers tab of a table - when right-clicking a trigger give us the trigger actions(enable/disable, drop...), not export.
    my two cents,
    Ofir

    When Choose a partitioned table from the tables list (tree view on the left), I have many tabs with details (Columns, data, indexes,etc).
    1. The last tab, SQL, doesn't generate any CREATE TABLE sql at all for the simple partition table I created (10g Release 2 on windows 2000, raptor 4.1, a table with a single partition).
    2. There is no way to see the partitions definitions - for example, the list of partitions and their ranges (or list values). I would like to have another tab for partitioned table with that information (from all_tab_partitions). Also, how can I easily see the type of partitioning and the partition key of the table?
    3. Also in the builtin reports, there is no way to get that data. The only report about partitioned tables that I see is Table -> Organization -> Partitioned -> Partitioned Tables, that only provide owner, table_name, maybe tablespace and logging (blank in my case).. I think:
    a. You should rewrite the report to use dba/all_part_tables - with columns like partitioning_type, subpartitioning_type, partition_count etc.
    b. add a report about the partition key columns per partitioned table from dba_part_key_columns.
    4. When adding an index to a partitioned table, I can't choose local/global index. The index is always created as a global index. For example, can't create bitmap index on partitioned tables because they must be local.
    Ofir

  • Syncable and Non-syncable table

    hi,
    anyone plz explain me what is syncable and non-syncable table??????

    Well, you can have a sync that is bi-directional... syncing down to the device, while the server is receiving uploads from the client. Then you can have a data collection queue, which is basically upload only. Then last is having a read-only publication item (table) where the sync is only a download from the server, no upload.

  • Partition an Non Partition Table in 11.2.0.1

    Hi Friends,
    I am using Oracle 11.2.0.1 Oracle Database.
    I have a table with 10 Million records and it's a Non Partitioned Table.
    1) I would like to partition the table (with partition by range ) without creating new table . I should do it in the existing table itself (not sure DBMS_REDEFINITION is the only option ) (or) can i use alter table ...?
    2) Add one partition which will have data for the unspecified range.
    Please let me know the inputs on the above
    Regards,
    DB

    Hi,
    what is the advantage of using DBMS_REDEFINITION over normal method (create partition table,grant access,insert records)You can't just add a partition in a non-partitioned table. You need to recreate existing table to have it partitioned (you can't just start adding new partitions to existing non-partitioned table). Advantage of dbms_redefinition is that it is online operation to re-create an existing table and and your data always remains available during table recreation
    I would like to know how to copy the object privileges,constraints,indexes from Non Partitioned table (sales) to Partitioned table (sales_part) which i am creating. will >DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS help on this?First you need to tell us what method you are using to partition an existing table? If you are using dbms_redifiniiton, you really don't need to worry about triggers, indexex or constraints at all. Just follow any document which explains how to use dbms_redifinition. Dr. Tim has done a lot of work for dummys like us by writing documents for us. Follow this document.
    http://www.oracle-base.com/articles/misc/partitioning-an-existing-table.php
    If so can i use DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS alone for copying the table dependents alone after i create partition table (or) it should be used along with >DBMS_REDEFINITION.START_REDEF_TABLE only?See above document which i mentioned.
    Salman

  • Create Partitioning to non-partitioning Table

    Dear All,
    I have a table which is non partitioning and it has about 20G data... If I want to partition this table with column say DATE_M,
    Please can anyone suggest the best way to do this.
    Thanks

    So now in the partitioned table he creates one maxvalue partition and does exchange partition 
    That isn't the typical scenario. Typically you make the switch by using partitions for the NEW data and leave the existing data in the base range partition.
    1. Existing app uses an unpartitioned table
    2. New table is partitioned for NEW DATA
    Assume you want monthly partitions (daily works the same). This is already April so there is already some April data.
    So create the partitioned table so the base partition clause includes ALL of the data for April and before:
    create table ipart 
      (time_id date 
      ,cust_id number(4) 
      ,amount_sold number(5)) 
      partition by range(time_id) 
      interval(NUMTOYMINTERVAL(1,'month')) 
      (partition old_data values less than (to_date('01-may-2015','DD-MON-YYYY'))) 
    Now you do the exchange with the unpartitioned table and all the current data goes into that 'OLD_DATA' partition.
    New data for May and the future will have partitions created automatically.
    That approach lets you ease into partitioning without disrupting your current processes at all.
    As time goes by more and more of the data will be in the new monthly partitions. If you need to you can split that base partition
    insert into ipart (time_id) values (sysdate - 90);
    insert into ipart (time_id) values (sysdate - 60);
    insert into ipart (time_id) values (sysdate - 30);
    insert into ipart (time_id) values (sysdate);
    commit;
    alter table ipart split partition old_data
      at (to_date('01-jan-2015', 'DD-MON-YYYY')) into
      (partition old_data, partition JAN_FEB_MAR_APR);

  • Re-org oracle 11.1.0.7 partitioned and sub partitioned index not validiting

    Hi,
    As part of maintenance i did the following thing on the oracle 11.1.0.7 on windows (no archive log mode);
         Re-orgnaized the tables in application- data tablespace - done
         Re-orgnaized large table in SYSAUX tablespace - only one table (alter table sys.WRI$_OPTSTAT_HISTGRM_HISTORY move tablespace sysaux
    alter index sys.I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST rebuild nologging;
    alter index sys.I_WRI$_OPTSTAT_H_ST rebuild nologging;)
         Re-built the indexes on applicaton index tbs- done
         Re-built the partition indexes on application index tbs - done
         rebuilding of indexes in SYSAUX - done since it was invalid
         Run the analyze job –
         Re-claim the space at database level and OS level
    but i have the issues of partitioned and subpartition indexes are not validating..how to validate the indexes i am using the below querires but:
    ORA-14287: cannot REBUILD a partition of a Composite Range partitioned i

    i am using the below sqls:
    set head off
    set linesize 200
    select 'alter index '||index_owner||'.'||index_name||' rebuild partition '||partition_name||' ; ' from dba_ind_partitions where status <> 'VALID' and index_owner not in ('SYS','SYSTEM')
    set head off
    set linesize 200
    select 'alter index '||index_owner||'.'||index_name||' rebuild subpartition '||subpartition_name||' ;'
    from dba_ind_subpartitions
    where status <> 'VALID'

  • Sharing the /home partition and general partition questions

    Hello, I'm new to Arch, but have been using Linux for a few years (albeit still at a beginner level).  I'm going to be reinstalling Arch on an old computer that has a 40GB main drive so dual boot a "operational" OS for day to day stuff that I want to make sure will be running well and then another OS that I can test on or just have for trying new distros.  I also have an 80GB that I'll use for data (but I don't think I want that to be my home drive). 
    My question is:  If I have two different installations of Arch, (or a second distribution) should they share the same /home partition?  My thought is "no", but I didn't know.
    Also, I'm planning on splitting the 40GB drive the following partitions.  Do these make sense, or would there be a better way to do this? 
    5GB = / (OS #1)
    14.5GB = /home (OS #1)
    5GB = / (OS #2)
    14.5GB = /home (OS #2)
    1 GB = swap (both OSes)
    I have an ancient P4 w/ 512 of RAM.

    sharing /home drives would NOT be a good option in your case simply because you are going to use the 2nd OS as test/trials. Those other OSes may have different ways of storing config files etc which may lead to having a lot of junk to parse through. and if you ever use any configs for the Test OS, and they are somewhat in conflict with Arch - in any way - you might end up having to re-configure settings for your favorite apps in Arch.
    I have a 30 GB HDD on a 10 yr old laptop which has Arch. This is the partition scheme I have
    ╔═[16:10]═[inxs @ arch]
    ╚═══===═══[~]>> df
    Filesystem Type Size Used Avail Use% Mounted on
    /dev/sda3 ext3 7.0G 1.7G 5.0G 25% /
    none tmpfs 125M 100K 125M 1% /dev
    none tmpfs 125M 0 125M 0% /dev/shm
    /dev/sda4 ext4 16G 850M 14G 6% /home
    /dev/sda6 reiserfs 5.1G 558M 4.5G 11% /var
    /dev/sda1 ext2 61M 12M 47M 20% /boot
    ╔═[21:16]═[inxs @ arch]
    ╚═══===═══[~]>> fdisk
    Disk /dev/sda: 30.0 GB, 30005821440 bytes
    255 heads, 63 sectors/track, 3648 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000080
    Device Boot Start End Blocks Id System
    /dev/sda1 1 8 64228+ 83 Linux
    /dev/sda2 9 726 5767335 5 Extended
    /dev/sda3 727 1640 7341705 83 Linux
    /dev/sda4 1641 3648 16129260 83 Linux
    /dev/sda5 9 73 522081 82 Linux swap / Solaris
    /dev/sda6 74 726 5245191 83 Linux
    ╔═[21:18]═[inxs @ arch]
    ╚═══===═══[~]>>
    Since you have 10GB more than I do, you can adjust accordingly and make partitions for your test OSes as well.
    Last edited by Inxsible (2009-10-08 01:22:30)

  • Usb flash drive partitions and view partitions in windows 7 or 8 O.S using C or C++ or C#

    I want to make 2 partitions in usb flash drive. How can a usb can be partitioned using C or C++ or C# languages? And these partitions can be able to see either in a tool or in windows o.s

    Hi,
    Your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Maybe you can try to consult on this forum:
    https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=wdk
    Anyway, I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • S_TABU_DIS and non-classified tables (&NC&)

    Does anyone have any insight into providing display access to non-classified tables (&NC&) via authorization object S_TABU_DIS.  Our specific issue at this point is via SE16 with display only access.  Our testing has shown that tables without any authorzation group assigned required a value of (&NC&) in field DICBERCLS in order to make SE16 work.  The challenge is that we have a number of custom tables without any authorization group which means we need to provide &NC&.  If we do this the users automatically get access all the non-classified tables.

    >
    Ed Marks wrote:
    > Does anyone have any insight into providing display access to non-classified tables (&NC&) via authorization object S_TABU_DIS.  Our specific issue at this point is via SE16 with display only access.  Our testing has shown that tables without any authorzation group assigned required a value of (&NC&) in field DICBERCLS in order to make SE16 work.  The challenge is that we have a number of custom tables without any authorization group which means we need to provide &NC&.  If we do this the users automatically get access all the non-classified tables.
    If there is an intention / requirement to display a table, then the best practice way is to create a view in SM30, assign an auth group to the table via SE54, and then create a transaction in SE93 to call that view. Or search for an existing one.
    There are parameter transactions; basically the same thing as SM30.... except the users dont know that. You can also add your own additional checks on other auth objects.
    ''&NC&' means "not classified" as there is no requirement to control the access for the data browser transactions, because there is no intention that a user should display or change them in your concept.
    Cheers,
    Julius

  • Create data partition and ubuntu partition

    I would like to create 2 more partitions on a ThinkPad x230t tablet: one partition for all my files and other partition to install ubuntu OS.
    According to Disk Management the computer already has the following partitions:
    SYSTEM_DRV              Simple, Basic, NTFS, Healthy(System, Active, Primary Partition)
    Windows7_OS(C        Simple, Basic, NTFS, Healthy(Boot, Page File, Crash Dump, Primary Partition)
    Lenovo_Recovery(Q   Simple, Basic, NTFS, Healthy(Primary Partition)
    I have read that there is a limit to the number of primary partitions allowed and that partition type and placement matter.
    Any suggestions on how to proceed are welcome.
    Thanks.

     - As I read, I guess GRUB makes the recovery button useless? I don't want to lose my licensed Vista, so what can you suggest me to do?
     I think it will work. At least if it doesn't you may reinstall Rescue and Recovery.
    After shrinking C: drive, it complains about not being able to find winload.exe and does not open
    You have to recover the loader. I used a Windows Vista bootable DVD for this purpose.

  • Disk Utility crashed during partition and DOUBLED partition use - now it's full?

    This one has me stumped.
    1TB Disk - NON-start-up - had about 450GB of data files on it.
    Split it with disk partition so I could reclaim free space.
    Disk Utility crashed during the partition.
    Relaunched Disk Utility.
    Now shows 900GB of the disk are used.
    Tried to repair disk with Disk Utility, "Can't Unmount Disk"
    Have rebooted now and am trying to find out WHAT that other 450GB of space taken up actually is. (using WhatSize).
    Anyone have any clues what the heck is going on? I now no longer have any space to duplicate the partiion files to (though on another drive completely). I can still access the files but not sure what that other space hog could be....?
    Thanks anyone.

    Techtool Pro was able to determine the directory structure was fubarred - repairing it corrected the structure to report the size correctly.

  • Is list partition and hash partition one and the same

    I am creating table with partition with the commands
    CREATE TABLE ABD (ENO NUMBER(5),CID NUMBER(3),ENAME VARCHAR2(10))
    PARTITION BY LIST (ENO)
    (PARTITION P1 VALUES (123),
    PARTITION P2 VALUES (143),
    PARTITION CLIENT_ID VALUES (746))
    ALTER TABLE ABD
    ADD PARTITION CLIENT_756 VALUES (756)
    but when i describe the table script it is showing like this
    CREATE TABLE ABD (
    ENO NUMBER (5),
    ENAME VARCHAR2 (10),
    CID NUMBER (3) )
    PARTITION BY HASH (ENO)
    PARTITIONS 4
    STORE IN ( USERS,USERS,USERS,
    USERS);
    actually i am creating list partition but it is showing hash partition why is it so?

    when i describe the table script it is showing like thisHow do you describe it, and which version are you on ?
    TEST@db102 SQL> CREATE TABLE ABD (ENO NUMBER(5),CID NUMBER(3),ENAME VARCHAR2(10))
      2  PARTITION BY LIST (ENO)
      3  (PARTITION P1 VALUES (123),
      4  PARTITION P2 VALUES (143),
      5* PARTITION CLIENT_ID VALUES (746))
    TEST@db102 SQL> /
    Table created.
    TEST@db102 SQL> ALTER TABLE ABD
      2* ADD PARTITION CLIENT_756 VALUES (756)
    TEST@db102 SQL> /
    Table altered.
    TEST@db102 SQL> select dbms_metadata.get_ddl('TABLE','ABD','TEST') from dual;
    DBMS_METADATA.GET_DDL('TABLE','ABD','TEST')
      CREATE TABLE "TEST"."ABD"
       (    "ENO" NUMBER(5,0),
            "CID" NUMBER(3,0),
            "ENAME" VARCHAR2(10)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
      PARTITION BY LIST ("ENO")
    (PARTITION "P1"  VALUES (123)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS ,
    PARTITION "P2"  VALUES (143)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS ,
    PARTITION "CLIENT_ID"  VALUES (746)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS ,
    PARTITION "CLIENT_756"  VALUES (756)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS )
    TEST@db102 SQL>                                                                               

  • Can one logical table had bothfragmented and non-fragmented table sources?

    Hi,
    I created one logical table with three logical table sources as explained below.
    1. Inventory Item logical table source with fragmentation clause of ITEM_TYPE='INVENTORY', I checked source combination feature for this LTS.
    1. Punch out logical table source with fragmentation clause of ITEM_TYPE='PUNCHOUT', I checked source combination feature for this LTS.
    3. Category logical table source without any fragmentation.
    The relation between category and item is one to many.
    I am getting errors in answers if i try to query all attributes of item for a category in dimension only query.Could somebody validate whether i can create one Logical table with fragmeted as well as non-fragmented logical table sources or not?

    Can you share the error messages you are getting?
    regards
    John
    http://obiee101.blogspot.com

  • Setting up bootable mac partition and windows partition

    I have a 250GB portable harddisk (USB 2.0 and Firewire connections available). I've allocated 150GB for a bootable OSX partition using firewire which works very well.
    How can I use the remaining 100GB for backing up my Windows PC data?

    If I partition the portable harddisk as FAT32, then I cannot install OSX into that harddisk.
    MacDrive is one possibility. The other solution is to get another portable harddisk for backing up my PC data. I was hoping to use one portable harddisk instead of two.

Maybe you are looking for

  • Enter-Event on an "Input Field"

    Hello Community... i would like to trigger an event on an Input-Field in my Form. When I enter a value and press "Enter" the value should be given via an output signal to another iView. What kind of event do I have to choose to achieve that? I chose

  • My epson WF-3540  will not print.

    After updating to  Yosemite. My Epson will not print.,even  with the  the epson  2.19 driver update.  None of My devices can find my printer. It  only works with USB plug directly to my iMac.  .( iMac (24-inch Mid 2007,Processor-2.8 GHz Intel Core 2

  • Plug-in's additional files

    Hello all, I'm sure this is a no-brainer but I'm gonna ask it anyway:  Where is the best place to store/retrieve any additional files that my plug-in might need?  I assumed I could keep things like that in my plug-in's bundle (I'm on Mac OS X, CS5) b

  • 2 different drives on my RAID connectors?

    I think I've seen this asked before, but can't remember the answer or find the thread, so I have to ask again: I have an MSI 845 Ultra MS6398 with RAID connecters IDE3 and IDE4. I have hooked a 40gig Maxtor hard drive on IDE3 in a 1+0 array and it wo

  • Auto-lock is grey out so time can't be adjusted...what to do?

    Any ideas on how to adjust lock out time?? Merry Christmas to all