Suggestions for table partition for existing tables.

I have a table as below. This table contains huge data. This table has so many child tables .I am planning to do a 'Reference Partitioning' for the same.
create table PROMOTION_DTL
  PROMO_ID              NUMBER(10) not null,
  EVENT                 VARCHAR2(6),
  PROMO_START_DATE      TIMESTAMP(6),
  PROMO_END_DATE        TIMESTAMP(6),
  PROMO_COST_START_DATE TIMESTAMP(6),
  EVENT_CUT_OFF_DATE    TIMESTAMP(6),
  REMARKS               VARCHAR2(75),
  CREATE_BY             VARCHAR2(50),
  CREATE_DATE           TIMESTAMP(6),
  UPDATE_BY             VARCHAR2(50),
  UPDATE_DATE           TIMESTAMP(6)
alter table PROMOTION_DTL
  add constraint PROMOTION_DTL_PK primary key (PROMO_ID);
alter table PROMOTION_DTL
  add constraint PROMO_EVENT_FK foreign key (EVENT)
  references SP_PROMO_EVENT_MST (EVENT);
-- Create/Recreate indexes
create index PROMOTION_IDX1 on PROMOTION_DTL (PROMO_ID, EVENT)
create unique index PROMOTION_PK on PROMOTION_DTL (PROMO_ID)
-- Grant/Revoke object privileges
grant select, insert, update, delete on PROMOTION_DTL to SCHEMA_RW_ROLE;I would like to partition this table .Most of the queries contains the following conditions.
promo_end_date >=   SYSDATE
and
(event = :input_event OR
(:input_Start_Date <= promo_end_date           
AND promo_start_date <= :input_End_Date))Any time the promotion can be closed by updating the PROMO_END_DATE.
Interval partioning on PROMO_END_DATE is not possible as PROMO_END_DATE is a nullable and updatable field.
I am now to table partition.
Any suggestions are welcome...

DO NOT POST THE SAME QUESTION IN MULTIPLE FORUMS PLEASE!
Suggestions for table partition of existing tables

Similar Messages

  • Partitioning an Existing Table with data

    Hi All,
    I am few tables with data, I need to Partition the table without affecting existing table values is it possible?.
    if yes then Please suggest me some ideas to archive that..
    Thanks & Regards
    Sami

    Hi All,
    I Need to partition for existing table with 1 million records
    1. First partition should be created for 6 months
    2.Second partition should created for 1 year.
    3.So as of now we have 6 months Data in production + another 6 months data in First partition + another 1 year data in Second partition.
    4.More than 2 year’s data’s should be moved other partition or archived.
    kindly provide your valuabe suggestion.
    Thanks & Regards
    Sami

  • What's the best practice to partition an existing table?

    We are using Oracle 11g EE 11.2.0.3.0. We want to partition an existing table. I found some information from this link [http://www.oracle-base.com/articles/misc/partitioning-an-existing-table.php], but I am not sure whether that's the best way. Could anyone share the best practice of partitioning an existing table?
    Thanks.
    Jun

    >
    We want to partition a few related tables. A couple of tables have about 30 million rows, and a couple of other tables have about 10 million rows. The data for those tables is for ~2000 accounts, each of them is identified by a column named "account_id". We want to partition the tables by using the "account_id" as the partition key to gain better performance for queries, so we would probably use hash partition. Please advise.
    >
    1. What evidence do you have that your performance will be any better if you partition those tables?
    2. What evidence do you have that there is anything wrong with the performance of your current queries?
    3. Have you reviewed the actual execution plans for your most important queries to see if there is even any room for improvement?
    If your query uses account_id as a predicate but only pulls a few records from a 'master' table for that key value your performance may actually be worse if you partition that table. That is because using an index range scan Oracle can easily find the ROWIDs of the rows that need to be selected and then easily retrieve them regardless of their physical location.
    If you have queries that do NOT use account_id but currently use indexes the performance of those queries may also be worse if you partition that table. Those indexes will be GLOBAL.
    There are two major implications when you use hash partitioning:
    1. Any query that does NOT include the partitioning key (account_id for your case) will, of necessity, have to use a full table scan if an appropriate index is not available.
    2. You will get NO management benefits such as being able to add/remove partitions that include old data.
    Before you decide to partition a table you should conduct tests and examine the execution plans for your important queries.

  • Partition an existing table

    How can I partition an existing table? What's the SQL syntax?
    Thanks for help,
    Chen Zhao

    Does anybody know how to partition an existing table?
    YES! That is the simple answer to your question. There are a lot of people that know how to do that.
    Whether partitioning is appropriate and, if so, which method might be 'best' for YOU depends on the particulars of your use case. But as with most problems you need to make sure you troubleshoot whatever issue you have in the proper order:
    1. Identify a PROBLEM or issue that needs to be resolved - you haven't told us anything. Please post info about this
    2. Validate that the problem/issue actually exists (it could just be a fluke occurence)
    3. Identify potential solutions to the problem/issue - that list of solutions may, or may not, include partitioning
    4. Select a small number (e.g. 1 or 2) of those solutions for further analysis and actual tests.
    5. Select the 'best' (based on your orgs criteria) of those tested solutions for implemention
    You seem to already be on step #5. But in order for us to help you we have to understand what the results of steps 1 thru 4 are.
    Please post the information about your PROBLEM that we need to help you.

  • How to create a partition on existing table?

    Hey
    Could some one please tell me on how to create a partition on existing table?

    Could some one please tell me on how to create a partition on existing table?
    You can't - that isn't possible. Unless a table is already partitioned you can NOT create another partition on it.
    You must either redefine the table as a partitioned table (using the DBMS_REDEFINITION package) or create a new partitioned table and move the data to its new partitions.
    The choice will depend on how much data the existing table has and whether you can do it offline.

  • Partitioning an Existing Table

    Dear Forum,
    Can we create partition on an existing table without dropping it in Oracle 11.2.0.3.0?
    I know EXCHANGE PARTITION, but that I don't want.
    Thank you & regards.

    You cannot partition an existing table.
    You have to create a new partitioned table and move the data from the old table to the new table. If you want to do this online, you can potentially leverage the DBMS_REDEFINITION package to help you out. Behind the scenes, you're still creating a new table and, eventually, dropping the old table after moving all the data over. DBMS_REDEFINITION hides some of that from you and lets the table remain online while you are moving the data. But it adds some performance overhead.
    Justin

  • Create partition to existing table

    I have a existing table which is not partitioned. How can partition my existing table?

    oops.... This is more better....
    Partitioning an Existing Table
    http://www.oracle-base.com/articles/misc/PartitioningAnExistingTable.php
    Other method
    (1) create new_table with oen or more range partition.
    (2) alter table new_table exchange partition with old_table.
    (3) rename or drop old_table.
    (4) rename new_table to old_table.
    (5) split or add partition.
    -- Examples
    --(1)
    create table part_tab
    partition by range (col)
    (partition p1 values less than (maxvalue))
    as select * from org_tab where 1=0;
    --(2)
    alter table part_tab
    exchange partition p1 with table org_tab
    without validation
    --(3)
    rename org_tab to backup_table;
    --(4)
    rename part_tab to org_tab;
    --(5)
    alter table org_tab
    split partition p1 at (100)
    into (partition p1, partition p2);
    alter table org_tab
    split partition p2 at (200)
    into (partition p2, partition p3);
    -- Results
    SQL> select * from org_tab partition(p1);
    COL        VC
    99         abc
    SQL> c/p1/p2
      1* select * from org_tab partition(p2)
    SQL> /
    COL        VC
    199        def
    Original is written in Japanese language (OTN Japan)
    http://otn.oracle.co.jp/forum/message.jspa?messageID=3045618?
    Message was edited by:
    ushitaki

  • How to create a table from an existing table with new column

    Hi !
    Please help me.
    I want to create a table from an existing table with data and add two new column to the new table.
    What will be the syntax?

    craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
    new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
    if you want to have VARCHAR2 instead of CHAR for example:
    SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
    Table created.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            CHAR(8)
    SQL> alter table new_dept modify (new_col varchar2(8));
    Table altered.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            VARCHAR2(8)Rgds.
    Didn't see michael's post - it reflects the fix for this problem using CAST.
    Message was edited by:
    dnikiforov

  • Table partitioning (intervel partitioning) on existing tables in oracle 11g

    Hi i'm newbie to table partitioning. I'm using 11g. I have table of size 32 gb (which has 22 million records) and i want to apply interval partition on that table. I created a empty table with a partition having columns same as source table and take dump of the source table and import into the new partition table. can you please suggest how to import table dump into new table? also is there any other better idea to do the same.

    Hi,
    imp user/password file=exp.dmp ignore=y
    The ignore=y causes the import to skip the table creation and continues to load all rows.
    On the other hand, you can insert data into the partitioned table with a subquery from the non-partitioned table such as follows;
    insert into patitioned_table
    select * from original_table;
    Hope it helps,

  • Creating Partitions in Existing tables with Data

    Hello everyone,
    I want to know what the best way of creating partitions, in tables having data, is .. ???
    thanks
    Rossy Rocs

    There are two ways :
    1a Create a new Partitioned Table
    1b Copy data from the existing table to the new table
    1c Create Indexes
    1d Rename old table
    1e Rename new table
    OR
    2 Use DBMS_REDEFINITION
    See
    http://www.oracle-base.com/articles/misc/PartitioningAnExistingTable.php
    Hemant K Chitale

  • Creating multiple tables based on existing tables

    Hi,
    I have to create 60 tables based on existing 60 tables. Instead of creating one by one how can I create all 60 at once.
    The current 60 tables are named FY11_ACC1, FY11_ACC2, FY11_SALES1, FY11_SALES2 ...... , but all 60 tables start with FY11. I need to create the same structured tables but with FY12 names like FY12_ACC1, FY12_ACC2, FY12_SALES1, FY12_SALES2 .....
    Currently I am using "create table FY12_ACC1 as select * from FY11_ACC1 where 1=0". Is there a way I can write all of them in one query?
    Thanks for your time and help.

    ssk1974 wrote:
    Hi,
    I have to create 60 tables based on existing 60 tables. Instead of creating one by one how can I create all 60 at once.
    The current 60 tables are named FY11_ACC1, FY11_ACC2, FY11_SALES1, FY11_SALES2 ...... , but all 60 tables start with FY11. I need to create the same structured tables but with FY12 names like FY12_ACC1, FY12_ACC2, FY12_SALES1, FY12_SALES2 .....
    Currently I am using "create table FY12_ACC1 as select * from FY11_ACC1 where 1=0". Is there a way I can write all of them in one query?
    Thanks for your time and help.Well, i'm assuming FY = Fiscal Year and 11 = 2011 and then ACC1 = Account #1.
    From the sounds of things, your design isn't likely "correct'.
    If you'd care to delve in to the requirements a little bit ... what you have and what you need (business speak wise) there are no shortage of experts here that i'm sure would be happy to help you.
    If you're stuck with what you've got (or don't care to change your 'design') and all you care about is achieving that please disregard this message.

  • Partitioning of existing tables.. based on date

    Hello Friends,
    I have some tables where their is a column called x_as_of_dt COLUMN with DATE as the datatype.
    All the tables have already got data populated.
    Now I want to partition the tables based on column x_as_of_dt by YYYYMM
    How to approach this scenario..
    Appreciate your help
    thanks/kumar

    Hello Justin,
    I found that all the tables have indexes and check constraint only ( no primary and foreign key constraints ) for the tables that need to be partitioned .
    The actual table structure is like this.. ( Am using toad and this is the script from toad )
    CREATE TABLE X_FA_X_HOUSEHOLD
    FINANCIAL_ADVISOR_RK NUMBER(10) NOT NULL,
    HOUSEHOLD_RK NUMBER(10) NOT NULL,
    X_AS_OF_DATE DATE NOT NULL,
    FINANCIAL_ADVISOR_ID VARCHAR2(6 BYTE),
    HOUSEHOLD_ID NUMBER(10),
    X_BRANCH_ID VARCHAR2(3 BYTE),
    X_FA_HHD_PCT_SPLIT NUMBER(7,4) NOT NULL,
    X_RANK_NUM NUMBER(3),
    PROCESSED_DTTM DATE
    TABLESPACE KAW_DATA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX XPKX_FINANCIAL_ADVISOR_X_HOUSE ON X_FA_X_HOUSEHOLD
    (FINANCIAL_ADVISOR_RK, HOUSEHOLD_RK, X_AS_OF_DATE)
    LOGGING
    TABLESPACE KAW_IDX
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    GRANT SELECT ON X_FA_X_HOUSEHOLD TO KAW_READ_ROLE;
    REQUIREMENT: - I got to implement the partion on this table for the column - X_AS_OF_DATE
    STEP 1 - CREATE A PARTITIONed table
    CREATE TABLE PARTITION_X_FA_X_HOUSEHOLD
    FINANCIAL_ADVISOR_RK NUMBER(10) NOT NULL,
    HOUSEHOLD_RK NUMBER(10) NOT NULL,
    X_AS_OF_DATE DATE NOT NULL,
    FINANCIAL_ADVISOR_ID VARCHAR2(6 BYTE),
    HOUSEHOLD_ID NUMBER(10),
    X_BRANCH_ID VARCHAR2(3 BYTE),
    X_FA_HHD_PCT_SPLIT NUMBER(7,4) NOT NULL,
    X_RANK_NUM NUMBER(3),
    PROCESSED_DTTM DATE
    PARTITION BY RANGE (X_AS_OF_DATE)(
    PARTITION P200712 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200801 VALUES LESS THAN (TO_DATE(' 2008-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200802 VALUES LESS THAN (TO_DATE(' 2008-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200803 VALUES LESS THAN (TO_DATE(' 2008-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200804 VALUES LESS THAN (TO_DATE(' 2008-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200805 VALUES LESS THAN (TO_DATE(' 2008-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200806 VALUES LESS THAN (TO_DATE(' 2008-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200807 VALUES LESS THAN (TO_DATE(' 2008-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200808 VALUES LESS THAN (TO_DATE(' 2008-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200809 VALUES LESS THAN (TO_DATE(' 2008-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200810 VALUES LESS THAN (TO_DATE(' 2008-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200811 VALUES LESS THAN (TO_DATE(' 2008-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200812 VALUES LESS THAN (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200901 VALUES LESS THAN (TO_DATE(' 2009-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200902 VALUES LESS THAN (TO_DATE(' 2009-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200903 VALUES LESS THAN (TO_DATE(' 2009-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200904 VALUES LESS THAN (TO_DATE(' 2009-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200905 VALUES LESS THAN (TO_DATE(' 2009-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200906 VALUES LESS THAN (TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200907 VALUES LESS THAN (TO_DATE(' 2009-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200908 VALUES LESS THAN (TO_DATE(' 2009-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200909 VALUES LESS THAN (TO_DATE(' 2009-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200910 VALUES LESS THAN (TO_DATE(' 2009-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200911 VALUES LESS THAN (TO_DATE(' 2009-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P200912 VALUES LESS THAN (TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201001 VALUES LESS THAN (TO_DATE(' 2010-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201002 VALUES LESS THAN (TO_DATE(' 2010-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201003 VALUES LESS THAN (TO_DATE(' 2010-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201004 VALUES LESS THAN (TO_DATE(' 2010-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201005 VALUES LESS THAN (TO_DATE(' 2010-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201006 VALUES LESS THAN (TO_DATE(' 2010-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201007 VALUES LESS THAN (TO_DATE(' 2010-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201008 VALUES LESS THAN (TO_DATE(' 2010-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201009 VALUES LESS THAN (TO_DATE(' 2010-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201010 VALUES LESS THAN (TO_DATE(' 2010-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201011 VALUES LESS THAN (TO_DATE(' 2010-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201012 VALUES LESS THAN (TO_DATE(' 2011-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201101 VALUES LESS THAN (TO_DATE(' 2011-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201102 VALUES LESS THAN (TO_DATE(' 2011-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201103 VALUES LESS THAN (TO_DATE(' 2011-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201104 VALUES LESS THAN (TO_DATE(' 2011-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201105 VALUES LESS THAN (TO_DATE(' 2011-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201106 VALUES LESS THAN (TO_DATE(' 2011-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201107 VALUES LESS THAN (TO_DATE(' 2011-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201108 VALUES LESS THAN (TO_DATE(' 2011-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201109 VALUES LESS THAN (TO_DATE(' 2011-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201110 VALUES LESS THAN (TO_DATE(' 2011-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201111 VALUES LESS THAN (TO_DATE(' 2011-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P201112 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION PMAX VALUES LESS THAN (MAXVALUE) )
    STEP 2 - Loading the data ---------
    loading of data is as follows..
    INSERT INTO PARTITION_X_FA_X_HOUSEHOLD
    (FINANCIAL_ADVISOR_RK,
    HOUSEHOLD_RK,
    X_AS_OF_DATE,
    FINANCIAL_ADVISOR_ID,
    HOUSEHOLD_ID,
    X_BRANCH_ID,
    X_FA_HHD_PCT_SPLIT,
    X_RANK_NUM,
    PROCESSED_DTTM
    ) SELECT FINANCIAL_ADVISOR_RK,
    HOUSEHOLD_RK,
    X_AS_OF_DATE,
    FINANCIAL_ADVISOR_ID,
    HOUSEHOLD_ID,
    X_BRANCH_ID,
    X_FA_HHD_PCT_SPLIT,
    X_RANK_NUM,
    PROCESSED_DTTM
    FROM X_FA_X_HOUSEHOLD
    Step 3: - Creating indexes
    CREATE UNIQUE INDEX XPKX_FINANCIAL_ADVISOR_X_HOUSE ON PARTITION_X_FA_X_HOUSEHOLD
    (FINANCIAL_ADVISOR_RK, HOUSEHOLD_RK, X_AS_OF_DATE)
    Step 4: - Droping the actual table
    DROP TABLE X_FA_X_HOUSEHOLD
    Step 5: Renaming the partitioned table to old tablemame
    ALTER TABLE PARTITION_X_FA_X_HOUSEHOLD RENAME TO X_FA_X_HOUSEHOLD
    Does the above steps are correct - pls confirm.
    thanks/kumar

  • Partition an Existing Table with Data

    We have a table that is approx. 23Gb with 90 million rows. We need to partition it. What is the fastest or most efficient way to accomplish this? Oracle 10.2.0.4.

    user1175547 wrote:
    We have a table that is approx. 23Gb with 90 million rows. We need to partition it. What is the fastest or most efficient way to accomplish this? Oracle 10.2.0.4.you can use DBMS_REDEFINITION, also exchange partition is also a good solution :)
    http://www.oracle-base.com/articles/misc/PartitioningAnExistingTableUsingExchangePartition.php

  • Partitioning an Existing Table using DBMS_REDEFINITION with no primary key?

    HI,
    Is it possible to partiiton a table with dbms_redefination if the table contains no primary key?
    DB version 10.2
    Thank you All..

    Yes, of course, but you'll have to use rowID with "CONS_USE_ROWID" : http://68.142.116.68/docs/cd/B19306_01/appdev.102/b14258/d_redefi.htm#CBBFDJBC
    This will be longer but it is possible.

  • Adding a table to an existing table results in wrong link

    This is the code being used to add a table to a report:
    private ISCRTable AddLinkTable(ILinkTable linkTable, string sourceTableAlias, ConnectionInfo connectionInfo)
    { // construct a new Table from its name
    ISCRTable newTable = new Table();
    newTable.ConnectionInfo = connectionInfo.Clone();
    newTable.Name = linkTable.LinkTableName;
    newTable.Alias = linkTable.LinkTableName + "_ThisIsTheLinkTable" + LinkTableId++;
    if (_dataServiceSettings.DataProvider == DataProvider.Oracle11G)
    newTable.QualifiedName = _dataServiceSettings.DatabaseUserName.ToUpper() + "." + newTable.Name.ToUpper();
    else
    newTable.QualifiedName = "dba." + newTable.Name;
    // add a field to this new Table
    newTable.DataFields.Add(AddDbField(linkTable.DataField, newTable.Alias));
    // join this table to another one named sourceTableAlias, using linkFields TableLink
    tableLink = new TableLink();
    tableLink.SourceTableAlias = sourceTableAlias;
    tableLink.TargetTableAlias = newTable.Alias;
    tableLink.JoinType = CrTableJoinTypeEnum.crTableJoinTypeEqualJoin;
    Strings sourceFields = new Strings();
    Strings targetFields = new Strings();
    for (int i = 0; i + 1 < linkTable.LinkFields.Length; i += 2)
    sourceFields.Add(linkTable.LinkFields[i]); targetFields.Add(linkTable.LinkFields[i + 1]);
    tableLink.SourceFieldNames = sourceFields;
    tableLink.TargetFieldNames = targetFields;
    TableLinks tableLinks = new TableLinks();
    tableLinks.Add(tableLink); _report.ReportClientDocument.DatabaseController.AddTable(newTable, tableLinks);
    _report.ReportClientDocument.DatabaseController.VerifyTableConnectivity(newTable);
    //AddFieldToReport("{" + newTable.Alias + "." + linkTable.DataField + "}");
    return newTable;
    This is the resulting query SELECT "Article"."ArtId", "Article"."ArtDescr", "ArticleGroup"."AgDescr1", "Article"."ArtPurchLevel", "Article"."ArtMaximum", "Article"."ArtAbc", "Article"."ArtContext", "Article"."ArtPurchPrice", "Article"."ArtServOutUnt", "ArticleSite"."ArtsSitId", "Article"."ArtRecStatus"
    FROM  (dba.Article "Article" LEFT OUTER JOIN dba.ArticleGroup "ArticleGroup" ON "Article"."ArtAgId"="ArticleGroup"."AgId")
    INNER JOIN "10_78_00"."dba"."ArticleSite" "ArticleSite" ON "Article"."ArtId"="ArticleSite"."ArtsPurch" WHERE  "Article"."ArtContext"=1 AND ("ArticleSite"."ArtsSitId"='63'
    OR "ArticleSite"."ArtsSitId"='64') AND "Article"."ArtRecStatus">=0 ORDER BY "Article"."ArtId"
    the link field artspurch is not the field I declared . It happens to be the first column of the table ArticleSite. This seems to be a bug. has anyone ever experienced anything like this?
    ( Fixed the formatting )
    Message was edited by: Don Williams

    Hi Henk,
    What was the SQL before you added the table?
    I reformatted your code but you may want to confirms it correct or simply copy it into Notepad and then paste into this post.
    I find the easiest way to confirm is ad the table and joins in CR Designer first and then look at what Debug mode returns using this:
    btnReportObjects.Text = "";
    string crJoinOperator = "";
    foreach (CrystalDecisions.ReportAppServer.DataDefModel.TableLink rasTableLink in rptClientDoc.DataDefController.Database.TableLinks)
        //get the link properties
        btnCount.Text = "";
        int y = rptClientDoc.DataDefController.Database.TableLinks.Count;
        btnCount.Text = y.ToString();
        string crJoinType = "";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeAdvance)
            crJoinType = "-> Advanced ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeEqualJoin)
            crJoinType = "-> = ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeGreaterOrEqualJoin)
            crJoinType = "-> >= ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeGreaterThanJoin)
            crJoinType = "-> > ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeLeftOuterJoin)
            crJoinType = "-> LOJ ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeLessOrEqualJoin)
            crJoinType = "-> <= ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeLessThanJoin)
            crJoinType = "-> < ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeNotEqualJoin)
            crJoinType = "-> != ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeOuterJoin)
            crJoinType = "-> OJ ->";
        if (rasTableLink.JoinType == CrTableJoinTypeEnum.crTableJoinTypeRightOuterJoin)
            crJoinType = "-> ROJ ->";
        textBox1 = "Only gets Link type:" + rasTableLink.SourceTableAlias.ToString() + "." + rasTableLink.SourceFieldNames[0].ToString() +
            crJoinOperator + "." + crJoinType + rasTableLink.TargetTableAlias.ToString() + "." + rasTableLink.TargetFieldNames[0].ToString() + "\n";
        btnReportObjects.Text += textBox1;
        btnReportObjects.AppendText(" 'End' \n");
    There are some join types RAS is not capable of.
    Attach the report before and after you manually add the join and I'll see if I can get it to work also.
    Don
    ( PS - use the Advanced option to attach files and rename the reports to *.txt. )

Maybe you are looking for

  • Connecting my MacBook Pro to a TV

    I own a MacBook Pro 7,1. 2.4 GHz. Intel Core Duo. 13 inch. 4GB memory What do I need to connect it to my TV please?

  • Ip phone is not working with 802.1x port

    i can authenticate the pc using 802.1x, but its not working with ip phones...waiting for your kind reply..

  • Import Process Capital Goods- Message 8I 402

    Hello While doing the GR (Migo_GR)for Imported material after MIRO, we are getting the following error Excise modvat accounts not defined for CAPE transaction and ** excise group     Message no. 8I402 But we have alredy maintained the GL code, Is the

  • Adobe X Pro does not play well with Firefox 12.0

    Using Firefox 12.0 and up to date version of Acrobat X Pro -- no Adobe toolbar but listed in plugins. Work around using print Adobe Pdf consistently hangs or crashes.

  • Word won't work!

    I've just updated to Yosemite and can't open Word any more, getting the following message: You can't open the application "Microsoft Word" because PowerPC applications are no longer supported. I've searched for help and tried to download OpenOffice w