Move non-partition to Partition with order by cluse

Hi,
I have non partition table of around 9GB and want to convert it into Partiiton table. Following is the des:
SQL> select num_rows,blocks from dba_tables where table_name='DEMAND_DRAFT_STATUS';
  NUM_ROWS     BLOCKS
  21720123    1228647
SQL> select index_name,index_type from dba_indexes where table_name='DEMAND_DRAFT_STATUS';
INDEX_NAME                     INDEX_TYPE
SYS_C0011138                   NORMAL
IDX_DEMD_DRFT_STAT_INSERTED_BY BITMAP
IDX_DEMD_DRFT_STAT_UPDATED_BY  BITMAP
SQL> select clustering_factor from dba_indexes where index_name='SYS_C0011138';
CLUSTERING_FACTOR
        387978241
SQL> select column_name,column_position from dba_ind_columns where index_name='SYS_C0011138';
COLUMN_NAME
COLUMN_POSITION
ISSU_BR_CODE
              1
ISSU_BANK_CODE
              2
ISSU_EXTN_CNTR_CODE
              3
COLUMN_NAME
COLUMN_POSITION
DD_NUM
              4
ISSUE_DATE
              5
DD_CRNCY_CODE
              6
COLUMN_NAME
COLUMN_POSITION
OT_TYPE
              7
PRODUCT_CODE
              8
CURRENCY_CODE
              9
9 rows selected.
SQL> desc DEMAND_DRAFT_STATUS
Name                                                                                                              Null?    Type
ISSU_BR_CODE                                                                                                      NOT NULL VARCHAR2(6)
ISSU_BANK_CODE                                                                                                    NOT NULL VARCHAR2(6)
ISSU_EXTN_CNTR_CODE                                                                                               NOT NULL VARCHAR2(2)
DD_NUM                                                                                                            NOT NULL VARCHAR2(16)
ISSUE_DATE                                                                                                        NOT NULL DATE
DD_CRNCY_CODE                                                                                                     NOT NULL VARCHAR2(3)
OT_TYPE                                                                                                           NOT NULL VARCHAR2(2)
PRODUCT_CODE                                                                                                      NOT NULL VARCHAR2(5)
CURRENCY_CODE                                                                                                     NOT NULL VARCHAR2(3)
DD_STATUS                                                                                                                  CHAR(1)
DD_STATUS_DATE                                                                                                             DATE
DD_AMT                                                                                                                     NUMBER(20,4)
DD_REVAL_DATE                                                                                                              DATE
PRNT_ADVC_FLG                                                                                                              CHAR(1)
PRNT_RMKS                                                                                                                  VARCHAR2(50)
PAYEE_BR_CODE                                                                                                              VARCHAR2(6)
PAYEE_BANK_CODE                                                                                                            VARCHAR2(6)
PAYING_BR_CODE                                                                                                             VARCHAR2(6)
PAYING_BANK_CODE                                                                                                           VARCHAR2(6)
ROUTING_BR_CODE                                                                                                            VARCHAR2(6)
ROUTING_BANK_CODE                                                                                                          VARCHAR2(6)
INSTRMNT_TYPE                                                                                                              VARCHAR2(6)
INSTRMNT_ALPHA                                                                                                             VARCHAR2(6)
INSTRMNT_NUM                                                                                                               VARCHAR2(16)
PUR_NAME                                                                                                                   VARCHAR2(80)
PAYEE_NAME                                                                                                                 VARCHAR2(80)
PRNT_OPTN                                                                                                                  CHAR(1)
PRNT_FLG                                                                                                                   CHAR(1)
PRNT_CNT                                                                                                                   NUMBER(3)
DUP_ISS_CNT                                                                                                                NUMBER(3)
DUP_ISS_DATE                                                                                                               DATE
RECTIFED_CNT                                                                                                               NUMBER(3)
PAID_EX_ADVC                                                                                                               CHAR(1)
ADVC_RCV_DATE                                                                                                              DATE
BC_FLG                                                                                                                     CHAR(1)
ENTERED_BY                                                                                                                 CHAR(1)
CAUTIONED_STAT                                                                                                             CHAR(1)
CAUTIONED_REASON                                                                                                           VARCHAR2(50)
PAID_ADVC_FLG                                                                                                              CHAR(1)
INVT_SRL_NUM                                                                                                               VARCHAR2(16)
PRNT_REM_CNT                                                                                                               NUMBER(2)
INSERTED_BY                                                                                                                NUMBER(10)
UPDATED_BY                                                                                                                 NUMBER(10)
INSERTED_ON                                                                                                                DATE
UPDATED_ON                                                                                                                 DATE
DEL_FLG                                                                                                                    CHAR(1)
LCHG_TIME                                                                                                                  DATE
RCRE_TIME                                                                                                                  DATE
BUSINESS_DATE                                                                                                              DATEFollowing questions:
1) I want to Range partition by ISSUE_DATE (there is no issue), but i'm thinking of reordering the column of index i.e 'SYS_C0011138' (which is also primary key). For example low cardinality columns i will place first and high selective column i would place at last in order. Is that a good idea?
2) While creating Partition table i want to give insert /*+ parallel 10 */ into partitiontable select * from DEMAND_DRAFT_STATUS order by CURRENCY_CODE,DD_CRNCY_CODE,PRODUCT_CODE,OT_TYPE,ISSU_BANK_CODE,ISSU_EXTN_CNTR_CODE,ISSUE_DATE,ISSU_BR_CODE,DD_NUM;
Why i'm doing this because index is going to be created on CURRENCY_CODE,DD_CRNCY_CODE,PRODUCT_CODE,OT_TYPE,ISSU_BANK_CODE,ISSU_EXTN_CNTR_CODE,ISSUE_DATE,ISSU_BR_CODE,DD_NUM columns so clustering factore os that index would be good(this is primary key index btw). Is it good?
3) Once partition is done i want to compress the old partitions, but i'm bit worried that i wont get enough compress ratio if i create partition table with ORDER by clause. whats your thought?
Please give recommendation
Regards

rp0428 wrote:
>
whats your thought?
>
Your post raises nothing but questions about WHY you are doing any of this. We can't suggest appropriate solutions without knowing what the problems are or what goals you are trying to achieve.
>
I have non partition table of around 9GB and want to convert it into Partiiton table
>
Ok - but WHY? Are you currently having problems? What are they? Is performance poor? For what type of queries or operations? Is management a problem - can't easily roll-off old data?
>Well its management decision to partitions the table which are expected to have high size in future. There reference of 6GB i gave only for explanation, actually we have 2-3 tables which are 500+GB and will grow.
Its a DWH environment where daily incremental load happens. So we came out of decision to have tables(which have daily incremental load) partitioned on monthly basis. And keep last quatat partitions on Cell Flash cache(its exadata)
CLUSTERING_FACTOR
387978241
>
Yep - that is a high factor for 1.2 million blocks. But are you sure it is correct? It's 17 times greater than the number of rows in the table. That suggests that to read the entire table using the index every block has to be read 17 times. That doesn't make sense - odds are the table and index stats you provided are not current.
Yes thats seems to be correct figure. I'll check once again and post..
>
And it has this quote from Tom Kyte's book Expert Oracle Database Architecture
>
we could also view the clustering factor as a number that represents the number of logical i/o’s against the table, that would be performed to read the entire table via the index.
>
Even assuming that index has a high clustering factor the next question is:
So what? That would only be relevant if you are using that index to access the entire table or large numbers of blocks.
Is there a problem you are having that you can identify the clustering factor as the main culprit?
If it ain't broke, don't fix it.
>Yes that correct but clustering factor worry me much after seeing its value which is very high as compared to # of blocks.
1) I want to Range partition by ISSUE_DATE (there is no issue), but i'm thinking of reordering the column of index i.e 'SYS_C0011138' (which is also primary key). For example low cardinality columns i will place first and high selective column i would place at last in order. Is that a good idea?
>
Range partitioning by a date can be useful so lets just assume it is in your case; maybe you are thinking about dropping old data. Is your primary key going to be global or local? That will affect performance if you drop old partitions; the global index has to be maintained but the local one doesn't.
I'm not going to drop any partitions of old data as of now but will compress them because they wont anticipate DMLS.(but might be select)
Now the question is about Primary key > wll it be Local of Global? Well i thought of having this Key as Local(because one of my primary key column will contain the partition key as well).
Reasons
1) better manageability( like if i want to compress old partitions, then having a gloabl parimary key index would become unusable state)
2) Might increase in select search criteria (assumption)
But having this as local will it impact any performance?
The primary key does include the partitioning column so it could be a local index. But the partitioning column is not the leading column so this would be a local nonprefixed index. Is that what you need or do you need prefixed index?
Have you researched the difference and determined which one you need for your use case?
No. My partition Key would not be in leading column of Primary key. But is there any difference if i not keep partition key as leading column of primary key?
See Local Partitioned Indexes in the VLDB and Partitioning Guide
http://docs.oracle.com/cd/B28359_01/server.111/b32024/partition.htm
Is rearranging the key columns a good idea? Hard to say without knowing your usage pattern.
Why are you reordering the primary key columns? Why are you putting low cardinality columns first?Well i have read some where quite lot times that having Low cardinality columns as leading coluns would increase performance and later we can get better compression ratios. Let me know if i'm wrong.
You shouldn't be doing either of these without a solid reason. What are the reasons? How do you know that, for your usage pattern, you won't make things worse?
>
2) While creating Partition table i want to give insert /*+ parallel 10 */ into partitiontable select * from DEMAND_DRAFT_STATUS order by CURRENCY_CODE,DD_CRNCY_CODE,PRODUCT_CODE,OT_TYPE,ISSU_BANK_CODE,ISSU_EXTN_CNTR_CODE,ISSUE_DATE,ISSU_BR_CODE,DD_NUM;
Why i'm doing this because index is going to be created on CURRENCY_CODE,DD_CRNCY_CODE,PRODUCT_CODE,OT_TYPE,ISSU_BANK_CODE,ISSU_EXTN_CNTR_CODE,ISSUE_DATE,ISSU_BR_CODE,DD_NUM columns so clustering factore os that index would be good(this is primary key index btw). Is it good?
>
That should give a good initial clustering factor for the index unless a lot of DML is done.
>
3) Once partition is done i want to compress the old partitions, but i'm bit worried that i wont get enough compress ratio if i create partition table with ORDER by clause. whats your thought?
>
You are probably correct since having the low cardinality data first will break things up more. But you are still trying to solve a problem that you don't know even exists. How much space will each partition take if uncompressed? How much if compressed?
At a minimum you should perform a tests for a realistic subset of data (a sample issue date).
1. Create an unordered uncompressed table (new tablespace to make size data more accurate).
2. Create an unordered compressed table
3. Create an ordered uncompressed table
4. Create an ordered compressed table
Yes i have tries to simulate this for 9GB table(only) and size of unordered compressed table is 1.2GB and size of ordered compressed table is 1.9GB out of 9B(uncompressed)
Then you will have a good idea what the space savings might be.
I suggest you first document the issues and problems you are having and list specific goals for any architecture changes.
For partiioning I would focus on identifying the goals, the partition key(s), and the numbers and types (global or local) for the primary key and other indexes.
Application team have already identified the Partitions key on tables which are supposed to be partitioned And they say most of the queries are on those date columns. Secondly as i explained having partition we will keep old partition in compressed state and new partitions in Cell flash cache.
For the primary key index (that includes the partitioning key) determine if you need a prefixed or nonprefixed index.
again whats the difference if i dont have partition key column in leading column of index?
Based on your usage patterns determine the indexes and columns that are the most important for querying. The clustering factor might be ideal for the primary key but totally screwed up for the indexes and queries that really count. You can't get an ideal clustering factor for every index.
The data order for the initial load can be in the order that gives you the best clustering factor for the main index you need it for. That assumes that you actually need the index for a purpose that the clustering factor can help with.Thanks a lot your explanation was helpful.
This setup for tables (i.e. having high # of columns in primary key for example 6-7 out of 15 columns approx in a table) is common for mostly all of the tables which are going to be partition.
And most of the columns in parimary key have 2-3 distinct values out of 1Million rows, so was about to think that i should put them ahead while creating a new primary key (Local) on newly created partition.
While doing this i also take into consideration that i load the data in ORDER BY clause (i.e. order by all columns of PK) to get excellent CF and moreover we could benefit from Storage Index on Exadata. and thanks for inputs too highly appreciated

Similar Messages

  • Move data from Non Partitioned Table to Partitioned Table

    Hi Friends,
    I am using Oracle 11.2.0.1 DB
    Please let me know how can i copy /move the data from Non -Partitioned Oracle table to the currently created Partiotioned table.
    Regards,
    DB

    839396 wrote:
    Hi All,
    Created Partitioned table but unable to copy the data from Non Partitioned table:
    SQL> select * from sales;
    SNO YEAR NAME
    1 01-JAN-11 jan2011
    1 01-FEB-11 feb2011
    1 01-JAN-12 jan2012
    1 01-FEB-12 feb2012
    1 01-JAN-13 jan2013
    1 01-FEB-13 feb2013into which partition should row immediately above ("01-FEB-13") be deposited?
    [oracle@localhost ~]$ oerr  ora 14400
    14400, 00000, "inserted partition key does not map to any partition"
    // *Cause:  An attempt was made to insert a record into, a Range or Composite
    //          Range object, with a concatenated partition key that is beyond
    //          the concatenated partition bound list of the last partition -OR-
    //          An attempt was made to insert a record into a List object with
    //          a partition key that did not match the literal values specified
    //          for any of the partitions.
    // *Action: Do not insert the key. Or, add a partition capable of accepting
    //          the key, Or add values matching the key to a partition specification>
    6 rows selected.
    >
    SQL>
    SQL> create table sales_part(sno number(3),year date,name varchar2(10))
    2 partition by range(year)
    3 (
    4 partition p11 values less than (TO_DATE('01/JAN/2012','DD/MON/YYYY')),
    5 partition p12 values less than (TO_DATE('01/JAN/2013','DD/MON/YYYY'))
    6 );
    Table created.
    SQL> SELECT table_name,partition_name, num_rows FROM user_tab_partitions;
    TABLE_NAME PARTITION_NAME NUM_ROWS
    SALES_PART P11
    SALES_PART P12
    UNPAR_TABLE UNPAR_TABLE_12 776000
    UNPAR_TABLE UNPAR_TABLE_15 5000
    UNPAR_TABLE UNPAR_TABLE_MX 220000
    SQL>
    SQL> insert into sales_part select * from sales;
    insert into sales_part select * from sales
    ERROR at line 1:
    ORA-14400: inserted partition key does not map to any partition
    Regards,
    DB

  • Query with non partition key in partitioning table

    i compare query select with non-partition key condition in table partition with 3, 4 and 6 partition.
    time execution for 3 partition faster then 4 partition, time execution for 4 partition faster than 6 partition.
    i know processing query select is selection all partition, but i don't know what make time execution different between 3, 4 and 6 partition??
    whether the transfer from one partition to another partition takes time?
    this example sql trace query select for 3,4 and 6 partition
    3 partition
    SELECT *
    FROM
    EQU_PARAM_MONITORINGHASH WHERE TO_CHAR(time_stamp,'mm/yy')=('02/09')
    call          cpu    elapsed       disk        rows
    Parse        0.00       0.00          0           0
    Execute      0.00       0.00          0           0
    Fetch        5.70       7.57      25291     1157583
    total        5.70       7.57      25291     1157583
    Parsing user id: 61  (SKENARIO1)
    Rows     Execution Plan
          0  SELECT STATEMENT   MODE: ALL_ROWS
          0   PARTITION HASH (ALL) PARTITION: START=1 STOP=3
          0    TABLE ACCESS   MODE: ANALYZED (FULL) OF
                   'EQU_PARAM_MONITORINGHASH' (TABLE) PARTITION: START=1 STOP=34 partition
    SELECT *
    FROM
    EQU_PARAM_MONITORINGHASH WHERE TO_CHAR(time_stamp,'mm/yy')=('02/09')
    call          cpu    elapsed       disk        rows
    Parse        0.00       0.00          0           0
    Execute      0.00       0.00          0           0
    Fetch        5.46       8.03      25126     1157583
    total        5.46       8.03      25126     1157583
    Parsing user id: 62  (SKENARIO2)
    Rows     Execution Plan
          0  SELECT STATEMENT   MODE: ALL_ROWS
          0   PARTITION HASH (ALL) PARTITION: START=1 STOP=4
          0    TABLE ACCESS   MODE: ANALYZED (FULL) OF
                   'EQU_PARAM_MONITORINGHASH' (TABLE) PARTITION: START=1 STOP=46 partition
    SELECT *
    FROM
    EQU_PARAM_MONITORINGHASH WHERE TO_CHAR(time_stamp,'mm/yy')=('02/09')
    call          cpu    elapsed       disk        rows
    Parse        0.00       0.00          0           0
    Execute      0.00       0.00          0           0
    Fetch        5.73       9.13      25190     1157583
    total        5.73       9.13      25190     1157583
    Parsing user id: 63  (SKENARIO3)
    Rows     Execution Plan
          0  SELECT STATEMENT   MODE: ALL_ROWS
          0   PARTITION HASH (ALL) PARTITION: START=1 STOP=6
          0    TABLE ACCESS   MODE: ANALYZED (FULL) OF
                   'EQU_PARAM_MONITORINGHASH' (TABLE) PARTITION: START=1 STOP=6thanks
    best regards
    eko

    ekopur wrote:
    i compare query select with non-partition key condition in table partition with 3, 4 and 6 partition.
    time execution for 3 partition faster then 4 partition, time execution for 4 partition faster than 6 partition.
    i know processing query select is selection all partition, but i don't know what make time execution different between 3, 4 and 6 partition??
    whether the transfer from one partition to another partition takes time?
    this example sql trace query select for 3,4 and 6 partition
    3 partition
    SELECT *
    FROM
    EQU_PARAM_MONITORINGHASH WHERE TO_CHAR(time_stamp,'mm/yy')=('02/09')
    call          cpu    elapsed       disk        rows
    Parse        0.00       0.00          0           0
    Execute      0.00       0.00          0           0
    Fetch        5.70       7.57      25291     1157583
    total        5.70       7.57      25291     1157583
    Parsing user id: 61  (SKENARIO1)
    Rows     Execution Plan
    0  SELECT STATEMENT   MODE: ALL_ROWS
    0   PARTITION HASH (ALL) PARTITION: START=1 STOP=3
    0    TABLE ACCESS   MODE: ANALYZED (FULL) OF
    'EQU_PARAM_MONITORINGHASH' (TABLE) PARTITION: START=1 STOP=34 partition
    SELECT *
    FROM
    EQU_PARAM_MONITORINGHASH WHERE TO_CHAR(time_stamp,'mm/yy')=('02/09')
    call          cpu    elapsed       disk        rows
    Parse        0.00       0.00          0           0
    Execute      0.00       0.00          0           0
    Fetch        5.46       8.03      25126     1157583
    total        5.46       8.03      25126     1157583
    Parsing user id: 62  (SKENARIO2)
    Rows     Execution Plan
    0  SELECT STATEMENT   MODE: ALL_ROWS
    0   PARTITION HASH (ALL) PARTITION: START=1 STOP=4
    0    TABLE ACCESS   MODE: ANALYZED (FULL) OF
    'EQU_PARAM_MONITORINGHASH' (TABLE) PARTITION: START=1 STOP=46 partition
    SELECT *
    FROM
    EQU_PARAM_MONITORINGHASH WHERE TO_CHAR(time_stamp,'mm/yy')=('02/09')
    call          cpu    elapsed       disk        rows
    Parse        0.00       0.00          0           0
    Execute      0.00       0.00          0           0
    Fetch        5.73       9.13      25190     1157583
    total        5.73       9.13      25190     1157583
    Parsing user id: 63  (SKENARIO3)
    Rows     Execution Plan
    0  SELECT STATEMENT   MODE: ALL_ROWS
    0   PARTITION HASH (ALL) PARTITION: START=1 STOP=6
    0    TABLE ACCESS   MODE: ANALYZED (FULL) OF
    'EQU_PARAM_MONITORINGHASH' (TABLE) PARTITION: START=1 STOP=6
    I'm assuming you recreated the table a couple of times with different numbers of hash partitions. (Tip: always use a power of two for the number of hash partitions - it keeps them all around the same size if you are using the feature on an appropriate data set.)
    There isn't really enough difference in time within the database to make any sensible comment about the difference in times. I note that you have also edited out the fetch count for the 1.1 million rows fetched, and have not captured (or perhaps just not printed) the wait times, so we don't know where you spent the time inside and outside the database.
    For all we can tell, the difference you are worried about might simply be network time on the fetch calls, and have nothing to do with the extract you've published.
    Regards
    Jonathan Lewis

  • ORA-14291: cannot EXCHANGE a composite partition with a non-partitioned ta

    How do I resolve the below issue. I need to create a temp table and then do a exchange partition to the temp table using certain condition . The main table
    edc.edc_log_test has partition and subpartition. I used the below sql to create the temp table. How can I create the temp table with partition so that I do not get the mentioned error.
    edc.edc_log_test has
    PARTITION BY RANGE(CAPTURE_DATE)
    SUBPARTITION BY LIST(TRAN_NBR)
    l_ddl := 'create table ' || p_object_owner_in || '.' ||
    p_part_subpart_name || ' as select * from ' ||
    p_object_owner_in || '.' || p_object_name_in || ' where 1=2';
    l_ddl := ' ALTER TABLE ' || p_object_owner_in || '.' ||
    p_object_name_in || ' EXCHANGE PARTITION ' ||
    p_part_subpart_name || ' WITH TABLE ' ||
    p_object_owner_in || '.' || p_part_subpart_name ||
    ' EXCLUDING INDEXES WITHOUT VALIDATION '; *
    ORA-14291: cannot EXCHANGE a composite partition with a non-partitioned table

    The subpartitioning scheme of the composite partitioned table must be matched by a partitioning scheme on the temporary table.
    In your case you need to list partition your temporary table on TRAN_NBR

  • Oracle 11.2 - Perform parallel DML on a non partitioned table with LOB column

    Hi,
    Since I wanted to demonstrate new Oracle 12c enhancements on SecureFiles, I tried to use PDML statements on a non partitioned table with LOB column, in both Oracle 11g and Oracle 12c releases. The Oracle 11.2 SecureFiles and Large Objects Developer's Guide of January 2013 clearly says:
    Parallel execution of the following DML operations on tables with LOB columns is supported. These operations run in parallel execution mode only when performed on a partitioned table. DML statements on non-partitioned tables with LOB columns continue to execute in serial execution mode.
    INSERT AS SELECT
    CREATE TABLE AS SELECT
    DELETE
    UPDATE
    MERGE (conditional UPDATE and INSERT)
    Multi-table INSERT
    So I created and populated a simple table with a BLOB column:
    SQL> CREATE TABLE T1 (A BLOB);
    Table created.
    Then, I tried to see the execution plan of a parallel DELETE:
    SQL> EXPLAIN PLAN FOR
      2  delete /*+parallel (t1,8) */ from t1;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3718066193
    | Id  | Operation             | Name     | Rows  | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | DELETE STATEMENT      |          |  2048 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  DELETE               | T1       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR      |          |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM)| :TQ10000 |  2048 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR |          |  2048 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |   5 |      TABLE ACCESS FULL| T1       |  2048 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement (level=2)
    And I finished by executing the statement.
    SQL> commit;
    Commit complete.
    SQL> alter session enable parallel dml;
    Session altered.
    SQL> delete /*+parallel (t1,8) */ from t1;
    2048 rows deleted.
    As we can see, the statement has been run as parallel:
    SQL> select * from v$pq_sesstat;
    STATISTIC                      LAST_QUERY SESSION_TOTAL
    Queries Parallelized                    1             1
    DML Parallelized                        0             0
    DDL Parallelized                        0             0
    DFO Trees                               1             1
    Server Threads                          5             0
    Allocation Height                       5             0
    Allocation Width                        1             0
    Local Msgs Sent                        55            55
    Distr Msgs Sent                         0             0
    Local Msgs Recv'd                      55            55
    Distr Msgs Recv'd                       0             0
    11 rows selected.
    Is it normal ? It is not supposed to be supported on Oracle 11g with non-partitioned table containing LOB column....
    Thank you for your help.
    Michael

    Yes I did it. I tried with force parallel dml, and that is the results on my 12c DB, with the non partitionned and SecureFiles LOB column.
    SQL> explain plan for delete from t1;
    Explained.
    | Id  | Operation             | Name     | Rows  | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | DELETE STATEMENT      |          |     4 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  DELETE               | T1       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR      |          |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM)| :TQ10000 |     4 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR |          |     4 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |   5 |      TABLE ACCESS FULL| T1       |     4 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    The DELETE is not performed in Parallel.
    I tried with another statement :
    SQL> explain plan for
    2        insert into t1 select * from t1;
    Here are the results:
    11g
    | Id  | Operation                | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | INSERT STATEMENT         |          |     4 |  8008 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  LOAD TABLE CONVENTIONAL | T1       |       |       |            |          |        |      |            |
    |   2 |   PX COORDINATOR         |          |       |       |            |          |        |      |            |
    |   3 |    PX SEND QC (RANDOM)   | :TQ10000 |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR    |          |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |   5 |      TABLE ACCESS FULL   | T1       |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    12c
    | Id  | Operation                          | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | INSERT STATEMENT                   |          |     4 |  8008 |     2   (0)| 00:00:01 |        |      |            |
    |   1 |  PX COORDINATOR                    |          |       |       |            |          |        |      |            |
    |   2 |   PX SEND QC (RANDOM)              | :TQ10000 |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   3 |    LOAD AS SELECT                  | T1       |       |       |            |          |  Q1,00 | PCWP |            |
    |   4 |     OPTIMIZER STATISTICS GATHERING |          |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    |   5 |      PX BLOCK ITERATOR             |          |     4 |  8008 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    It seems that the DELETE statement has problems but not the INSERT AS SELECT !

  • How to move data from one DB (non-partitioned) to another DB (partitioned)

    I have a huge database (2 TB) that is storing data in non-partitioned tables. I want to create another database to store the exact same data but in partitioned tables. How can I do this in the most efficient manner? Good old export and import should work but this would take ages.

    Let me give you guys a full picture and see if you could help me.
    The existing Unix server is running an Oracle 8i Database (datawarehouse) and I'm planning to create a new 10g database on a new Unix server. After which I will do parallel loading on both databases until I am ready to switch over to the new database. Most of the tables in the existing database is not partitioned and I need it to be partitioned on the new database. My database is around 2.4 TB and it is residing on a SAN (4.4 TB). I am planning only to have the 10g binary files on the new unix server, thus the new database would be on the SAN. Disk space availability is my most immediate concern as I would also have to set aside 600 GB on the SAN for another server.
    Any suggestions on how can I do this best?

  • How do I move a partition using Windows 7?

    I have a relatively new computer that runs on Windows 7 (W7).  This is my first experience with a Windows OS newer than XP.  On systems running XP and older operating systems I was in the habit of using OEM tools for partition management. 
    This particularly included Partition Magic and GParted.  I have a strong preference for partitioning the hard drive into multiple partitions in order to separate the software, from the user data, and the temporary storage files.  I'm also in the
    habit of running more than one operating system partition.  This would include both different operating systems as well as as different instances of the same operating system.
    It looks to me like W7 includes more and possibly better partition management software than XP and earlier versions of Windows.  One of the fundamental tasks is the need to move partitions around on a drive.  Partition management software typically
    has resizing capability.  I'm accustomed to using such tools where you can either reduce or enlarge the size of the partition.  The parameters that you need to supply include the amount of free space that you want to end up with both before and after
    an existing partition.  It looks like the W7 tools only allow you to specify the size that want when the operation is complete.  They do NOT seem to allow you to precisely specify where the resulting partition ends up being located.  It sort
    of sounds like the resulting partition is always going to start at the same location, which means that these tools don't let you relocate the partition.  If so that is most unfortunate and represents a serious deficiency.
    Is there something I'm missing?  In that, is it possible to move partitions?  If W7 cannot do it are there recommended OEM tools with such capability?  In that, is there a substitute for Partition Magic?

    Hi,
    In Windows 7, you can use Disk Management to locate your disk partition. In addition, you can also use Diskpart command in CMD console to allocate the partition.
    Please refer to the conents of the link below for more details:
    http://support.microsoft.com/kb/300415
    Roger Lu
    TechNet Community Support

  • Two partitions with OSX how to get only one back

    I installed xp on my macbook and did not know it was service pack 1. Hours later I have two partitions on my macbook both with OSX now. How can I get my macbook back to one partition with OSX on it?


    Enlarging a volume
    If you have multiple volumes on a disk and one is running out of space, you may be able to enlarge it
    without losing any of its data.
    To enlarge a volume, you must delete the volume that comes after it on the disk, and then move the
    volume’s end point into the freed space. You can’t enlarge the last volume on a disk. You can see the
    order of the volumes in Disk Utility by selecting the disk, clicking Partition, and looking at the Volume
    Scheme list.
    All data on the deleted volume will be erased. Be sure to back up your disk’s data before you begin.
    To enlarge a volume:
    From the list at the left, select the disk that contains the volume you want to enlarge, and then click
    Partition.
    In the Volume Scheme list, select the volume beneath the volume you want to enlarge, and then click
    Delete〔-〕.
    The volume is immediately erased, leaving the space it formerly occupied available.
    Resize the volume.
    You can drag the divider at the bottom of the volume in the Volume Scheme list, or you can select the
    volume, and then enter a value in the Size field.
    If the enlarged volume doesn’t use all the space from the deleted volume, you can create new volumes
    in the unused space.
    To create a new volume, click Add〔+〕, select the new volume, and choose its name, format, and size.
    Click Apply.
    Disk Utility enlarges the volume and creates any new volumes.
    Kj ♞

  • Partitioning Non-partitioned Exesting Tables

    Hi all
    i'm working with oracle apps 11i with db 8i
    i have tables in GL module with rows inserted since 2003
    i want to use a partitioning method to divide the tables
    what are the statements i use to alter this tables in order to partition them ?
    thanks

    hi
    A non-partitioned table can not be "converted" to a partitioned table. You will have to re-create your table with the appropriate partitioning clause
    you can use this example
    create table partemp(
    empno number(4) not null,
    ename varchar2(10),
    job varchar2(9),
    mgr number(4),
    hiredate date,
    sal number(7,2),
    comm number(7,2),
    deptno number(2))
    partition by range(empno)
    (partition partemp6 values less than (8000))
    hope this helps
    zekeriya
    alter table partemp exchange partition partemp6 with table emp
    alter table partemp split partition partemp6
    at (7000)
    into (partition partemp1,
    partition partemp6)
    alter table partemp split partition partemp6
    at (7200)
    into (partition partemp2,
    partition partemp6)
    alter table partemp split partition partemp6
    at (7400)
    into (partition partemp3,
    partition partemp6)
    alter table partemp split partition partemp6
    at (7600)
    into (partition partemp4,
    partition partemp6)
    alter table partemp split partition partemp6
    at (7800)
    into (partition partemp5,
    partition partemp6)
    /

  • How to use Oracle partitioning with JPA @OneToOne reference?

    Hi!
    A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
    We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
    How do we use Oracle partitioning on the @OneToOne relationships?
    (We'd rather not change the model as we already have millions of rows in the db.)
    On the main entity "Trans" we use: partition by range (month) on a date column.
    And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
    But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
    @Entity
    public class Employee {
    @Id
    @Column(name="EMP_ID")
    private long id;
    @OneToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ADDRESS_ID")
    private Address address;
    EMPLOYEE (table)
    EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
    1 Bob Way 50000 6
    2 Sarah Smith 60000 7
    ADDRESS (table)
    ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
    6 17 Bank St Ottawa ON Canada K2H7Z5
    7 22 Main St Toronto ON Canada     L5H2D5
    From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
    How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
    Thanks for any advice.
    /Mats

    Crospost! How to use Oracle partitioning with JPA @OneToOne reference?

  • How to find out the Non Partitioned Tables used 2Gb on oracle

    Hi team
    how to find out the Non Partitioned Tables used > 2Gb on oracle where not is sys & system
    regards

    heres 1 I made earlier
    set pagesize 999
    set linesize 132
    col owner format a25
    col segment_name format a60
    select owner,segment_name,segment_type,(bytes/1024/1024)"MB size"
    from dba_segments
    where owner not in ('SYS','SYSTEM','XDB','MDSYS','SYSMAN') -- edit for taste
    and segment_type = 'TABLE'
    having (bytes/1024/1024) > 2000
    group by bytes, segment_Type, segment_name, owner
    order by 4 asc

  • How to completely erase ( no recovery partition remaining) a lion partition with disk utilities on lion install disk?

    Where in a  lion install disc made from the installer can I find a bootable file with disk utilities?
    I downloaded lion a few hours ago and installed.
    I have 4 large hardrives (1.5TB) arranged in 8 partitions to allow me to work on a varied group of projects. I have some projects that need to be worked on with software running under Tiger, some with software that runs under leopard, some with snow leopard, and now Lion. I own multiple copies of software and multiple user pack system install discs.
    On a regular basis, I back up chunks of work on projects to external discs, and special backup areas on one of my drives. I don't like using time machine because I am running many operating environments on my mac pro and I don't ever want to be tied to one operating environment for important functionality, and I want to maximize the open space on my hard drives.
    Several partitions involve large video files. I am working on them in various versions of final cut, premiere and imovie. Because I have to use the same software versions my different clients are running, I don't want to move all the files " up" to a modern version. It would be professional suicide to stop accommodating my various clients. I say this to try to head off being told to make my clients upgrade. There are too many different clients and they are not going to replace all their equipment.
    On these volumes with video files, I often fill them up and copy off what I need to backup before I erase and do a clean install.  I also run VM Fusion and windows XP. I absolutely do not want to have a Recovery HD partition left on the drive when I erase or influencing the other partions using different OS versions on that same drive.
    Is there a bootable disc on the installer disk I just made? Can I use the disk utilities to do a low level erase on the lion volume that will remove the recovery partition?
    Can I go back to booting from Snow Leopard and erasing the Recovery partition with the drive partition that way? Will the Snow Leopard utility take out the Lion HD recovery partition?
    I am used to erasing my drives and rebuilding my machine and I believe it is the right way to use my multiple drives in my workflow. Now that I've got this invisible recovery partition, can you help me remove it and create a bootable disc that includes disk utilities?

    I assume the unix pdisk command will show you want is going on.
    You may not have a big worry.  There have always been a lot of hidden partitions. Disk Utility under 10.4.11 reports this drive has three (my now report four )  partitions, when pdisk reports that there are 15. 
    Macintosh-HD -> Applications -> Utilities -> Terminal
    Press return when done typing sudo pdisk -l
    -l include a lower case L
    The sudo command will ask for your administration password. No characters will appear when typing your password. Press return when done typing. sudo stands for super user do.  It's just like root. Be careful.
    mac $ sudo pdisk -l
    Password:
    Partition map (with 512 byte blocks) on '/dev/rdisk0'
    #:                type name                    length   base      ( size )
    1: Apple_partition_map Apple                       63 @ 1       
    2:      Apple_Driver43*Macintosh                   56 @ 64      
    3:      Apple_Driver43*Macintosh                   56 @ 120     
    4:    Apple_Driver_ATA*Macintosh                   56 @ 176     
    5:    Apple_Driver_ATA*Macintosh                   56 @ 232     
    6:      Apple_FWDriver Macintosh                  512 @ 288     
    7:  Apple_Driver_IOKit Macintosh                  512 @ 800     
    8:       Apple_Patches Patch Partition            512 @ 1312    
    9:     Apple_Bootstrap untitled                  1954 @ 149319048
    10:           Apple_HFS Apple_HFS_Untitled_1   2254440 @ 263968    (  1.1G)
    11:     Apple_UNIX_SVR2 untitled               6617188 @ 149321002 (  3.2G)
    12:           Apple_HFS Apple_HFS_Untitled_2 146538496 @ 2780552   ( 69.9G)
    13:     Apple_UNIX_SVR2 swap                    363298 @ 155938190 (177.4M)
    14:          Apple_Free Extra                   262144 @ 1824      (128.0M)
    15:          Apple_Free Extra                   262144 @ 2518408   (128.0M)
    Device block size=512, Number of Blocks=156301488 (74.5G)
    DeviceType=0x0, DeviceId=0x0
    Drivers-
    1:  23 @ 64, type=0x1
    2:  36 @ 120, type=0xffff
    3:  21 @ 176, type=0x701
    4:  34 @ 232, type=0xf8ff

  • How to Implement 30 days Range Partitioning with Date column. Not Interval

    Hi,
    I am using the db:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    Current table structure is:
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE
    PARTITION BY RANGE (CreationDate)
    INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
    (PARTITION P_FIRST
    VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'))
    How can I define virtual column based partitioning with RANGE partitioning without using INTERVAL partitioning.
    And that is with Intervals of 30 days.
    For monthly I am trying as
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval date as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than (to_date('08-2012','mm-yyyy')),
    partition p_SEP12 values less than (to_date('09-2012','mm-yyyy')),
    partition p_OCT12 values less than (to_date('10-2012','mm-yyyy'))
    Enable ROw Movement
    BUT CAN'T INSERT the data even for that:
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Please suggest..

    Hi rp,
    Interval Partitioned to Range. Created Daily Partitions from Monthly Part. got complicated so I am posting here.
    Basically,
    I know Interval Partitioning is a kind of Range partitioning. But explicitly for Interval Partitioned tables XML Indexes are not allowed as discussed here:
    XMLIndexes on an Interval Partitioned Table??
    I can do monthly partitions as :
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval varchar2(8) as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than ('09-2012'),
    partition p_SEP12 values less than ('10-2012'),
    partition p_OCT12 values less than ('11-2012')
    ) Enable ROw Movement
    Insert into a (a, CreationDate)
    Values (1, '12-SEP-2012')
    Insert into a (a, CreationDate)
    Values (1, '14-SEP-2012')
    Select * from A partition (p_SEP12)
    Select * from A partition (p_AUG12)
    Select * from A partition (p_OCT12)
    Can we do it for 30 days partitions, instead of the monthly partitions. ANY suggestions..
    Thanks..

  • 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

  • The 'Partition' with 'ID' = 'FAC2CRDN' doesn't exist in the collection.

    Hi,
    When I am importing csv file system is showing me the following error:
    [Admin-ProcessPartition]The 'Partition' with 'ID' = 'FAC2CRDN' doesn't exist in the collection.
    I checked my OLAP database. Partition with id = FAC2CRDN exists.
    Please help me to come our from this issue and Thanks.
    Regards,
    Stanislav

    I would suggest you the following steps in order to see if your problem is fixed or if you still have some errors:
    1) full optimize your application
    2) try to full process the OLAP database directly from the Analysis Services management console.
    Regards,
    Simmaco

Maybe you are looking for