How to partition an existing table?

Hi all

Is there some way I can change a no compartmentalized partitioned table.
We have a table with almost 4 million documents and we want that it partition by date (per day).

Is this a good idea? or someone has another suggestion on this solution.

Really appreciate any help on this.

Thank you
APS

I have a similar question in my application that records the transaction in the transactions of several years table... Since keep us data for so many years it is difficult to maintain and affecting performance.

We thought to use Oracle partitioning to partition the data in the table by month, then we will make transactions online on the score for the last few months.
But Oracle partitioning comes with enterprise edition, and we need to purchase this license. Since its very expensive, the proposal was rejected by management.
Then we got to know that we have only 13 months of data online.

Creating archiving scripts to purge historical data and keep the backup of the entire database before the purge... so in case it is necessary to refer to older data for 13 months, we can restore the backup on any other DB and get that.

You can think of the archiving of data.

Tags: Database

Similar Questions

  • Partition on existing Tables

    Hello

    I want to archive a database due to too much data into DB everymonth, so I have to delete the records from the previous month, which is about 4 million.

    Can someone give me idea to delete records as soon as possible. My opinion is to create the partition on the table and drop the partition once he becomes older.
    But if I want to introduce the partition then I have to create a partition in an existing table. So please give me the best way to introduce the partition of the existing table.

    It would really help that may suggest meanings.

    Thank you

    Spengler

    Here is an example

    CREATE TABLE my_table (
      id           NUMBER,
      description  VARCHAR2(50),
      create_date date
    )PARTITION BY RANGE (create_date)
    (PARTITION id_id0 VALUES LESS THAN (TO_DATE('26/08/2009', 'DD/MM/YYYY')) TABLESPACE users,
     PARTITION id_id1 VALUES LESS THAN (TO_DATE('27/08/2009', 'DD/MM/YYYY')) TABLESPACE users,
     PARTITION id_id2 VALUES LESS THAN (TO_DATE('28/08/2009', 'DD/MM/YYYY')) TABLESPACE users,
     PARTITION id_id3 VALUES LESS THAN (TO_DATE('29/08/2009', 'DD/MM/YYYY')) TABLESPACE users,
    PARTITION id_id4 VALUES LESS THAN (TO_DATE('30/08/2009', 'DD/MM/YYYY')) TABLESPACE users,
    PARTITION id_max  VALUES LESS THAN  (MAXVALUE) TABLESPACE users);
    

    -Insert the sample data

     INSERT INTO my_table  VALUES (0, 'ZERO',sysdate);
    INSERT INTO my_table  VALUES (1, 'One',sysdate+1);
    INSERT INTO my_table  VALUES (2, 'Two',sysdate+2);
    INSERT INTO my_table  VALUES (3, 'Three',sysdate+3);
    INSERT INTO my_table  VALUES (4, 'Four',sysdate+4);
    COMMIT;
    

    -You can run these queries to check the output.

    select * from my_table;
    select * from my_table partition(id_id0);
    select * from my_table partition(id_id1);
    select * from my_table partition(id_id2);
    select * from my_table partition(id_id3);
    select * from my_table partition(id_id4);
    select * from my_table partition(id_max);
    

    -Split partition

    ALTER TABLE my_table SPLIT PARTITION id_max AT (TO_DATE('01/09/2009', 'DD/MM/YYYY'))
    INTO (PARTITION id_id5 TABLESPACE users,PARTITION id_max TABLESPACE users);
    

    -Insert data into the new partition

    INSERT INTO my_table  VALUES (5, 'FIVE',sysdate+5);
    commit;
    

    -check

    select * from my_table partition(id_id5);
    
  • Creating a partitioned table to an existing table interval.

    Hello

    Is there a way I can create a partitioned table interval of an existing table using DEC? I know how to create a partitioned table in range.

    create the table range_partitioned_table

    partition by range (date_column)

    (

    partition p1 lower ((to_date (' 08/01/2012 ',' mm/dd/yyyy'))),

    lower partition p2 values (to_date (' 09/01/2012 ',' mm/dd/yyyy')),

    PN VALUES LESS THAN (MAXVALUE) PARTITION

    )

    AS SELECT * from existing_table;

    Is there a similar way to the Interval partition an existing table?

    create the table interval_partitioned_table

    partition by range (date_column)

    interval (provide the interval)

    (

    partition p1 lower ((to_date (' 08/01/2012 ',' mm/dd/yyyy'))),

    partition p2 values less (to_date (' 09/01/2012 ',' mm/dd/yyyy')),

    -PN SCORE VALUES LESS THAN (MAXVALUE)

    )

    AS SELECT * from existing_table;

    For example:

    SQL > create table interval_partitioned_table
    2 partition by range (hiredate)
    interval of 3 (numtoyminterval(1,'YEAR'))
    (4)
    5 score below p1 ((to_date (' 08/01/2012 ',' mm/dd/yyyy'))),
    6 partition p2 values less (to_date (' 09/01/2012 ',' mm/dd/yyyy')),
    7 - PARTITION pN VALUES LESS THAN (MAXVALUE)
    8)
    9 AS SELECT * FROM emp;

    Table created.

    SQL >

    SY.

  • How add us partition on an existing table?

    Hi gurus,

    What would be the best way to add a partition to an existing table?

    Is there a simple documentation for example?

    Thank you

    What would be the best way to add a partition to an existing table?

    Is there a simple documentation for example?

    Was it something you were ask in an interview?

    You cannot add a partition to a table unless this table is a partitioned table.

    The table is already partitioned? If so, after the DDL.

    The Oracle documentation has examples of adding partitions to a table that is already partitioned

    Partition management

    Adding Partitions

    This section explains how to manually add partitions of a partitioned table and explains why partitions can be added specifically for partitioned more indexes.

    Adding a Partition to a partitioned Table range

    Use of the ALTER TABLE ... ADD PARTITION statement to add a new partition at the end 'high' (the point after the last existing partition). To add a partition at the beginning or in the middle of a table, use the SPLIT PARTITION clause.

  • How to add the new column in existing table to our desired location?

    How to add the new column in existing table to our desired location?

    For example, I have to add the new column 'course' before the salary column in the emp table.

    I think the best way is to add the column at the end of the table and create a new view with the order of the columns...

    Another option...

    places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table

    Refer

    Add column (from table) in the desired position

    Example:

    CREATE TABLE temp_my_user LIKE)

    SELECT * FROM password);

    DROP TABLE password;

    (Password) CREATE TABLE

    userID NUMBER

    , first name VARCAHR2 (25)

    , middleInitial VARCHAR2 (1)

    (, name VARCHAR2 (25));

    INSERT INTO password (userID, firstName, lastName)

    (SELECT username

    first name

    lastName

    OF temp_my_user);

    DROP TABLE temp_user;

  • How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    How can I add data file to an existing table on Oracle RAC ASM with no OMF? Thank you!

    Hello

    So I guess you have some files in ASM, see your first existing file structure

    Select file_name

    from dba_data_files;

    and to add to an existing table, the example below (even if you're better sticking with OMFs!)-is that what you are looking for?

    SQL > create tablespace TEST1

    2 datafile '+ DATA' size 1 M;

    Created tablespace.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    6 selected lines.

    SQL > alter tablespace TEST1

    2 Add datafile ' + DATA / mynewfile01.dbf ' size 2 m;

    Tablespace altered.

    SQL > select file_name in dba_data_files;

    FILE_NAME

    --------------------------------------------------------------------------------

    +Data/orcl2/datafile/users.259.859820983

    +Data/orcl2/datafile/undotbs1.258.859820983

    +Data/orcl2/datafile/SYSAUX.257.859820983

    +Data/orcl2/datafile/system.256.859820981

    +Data/orcl2/datafile/example.269.859821049

    +Data/orcl2/datafile/Test1.271.859843053

    + DATA / mynewfile01.dbf

    Thank you

  • How to partition a table

    Hi all

    I use oracle 10g R2 64 bits on 64-bit windows server 2008.

    I am facing problem with a table, which seems to be supposed to be a table partitioned, because it expects the 80000 lines per year.

    This is the normal table for the table script

    create table Leave_Request (Leave_request_id number primary key,
                                              emp_id number references emp(emp_id) not null,
                                              leave_type_id number references leave_types(leave_type_id) not null,
                                              leave_apply_date date not null,
                                              leave_from_date date not null,
                                              leave_to_date date not null,
                                              remarks varchar2(3000));
    

    What is known, is that an index would be created to Leave_request_id automatically.

    now, my question is how to partition? How to create its index score?

    I read a few pages on the partitions and the notion of partitioning, but always confused with my situation.

    an example would be much appreciated.

    Thank you.

    First of all you must decide the column on which you want to partition in function. As you expect 80000 lines per year, you can partition it on the date column for example leave_apply_date with the partition of the RANGE.

    What is known, is that an index would be created to Leave_request_id automatically.

    No you need write explicitly create index statement to create indexes.

    now, my question is how to partition?

    Here is an example:

    CREATE TABLE sales_range

    (salesman_id NUMBER (5),)

    salesman_name VARCHAR2 (30),

    Sales_Amount NUMBER (10),

    Sales_Date DATE)

    PARTITION OF RANGE (sales_date)

    (

    PARTITION sales_jan2000 VALUES LESS THAN (TO_DATE('02/01/2000','MM/DD/YYYY')),

    PARTITION sales_feb2000 VALUES LESS THAN (TO_DATE('03/01/2000','MM/DD/YYYY')),

    PARTITION sales_mar2000 VALUES LESS THAN (TO_DATE('04/01/2000','MM/DD/YYYY')),

    PARTITION sales_apr2000 VALUES LESS THAN (TO_DATE('05/01/2000','MM/DD/YYYY'))

    );

    How to create its index score?

    Just add keyword LOCAL at the end of the create index example statement

    CREATE INDEX abc_ix_01 ON test (last_update_time) LOCAL app_index TABLESPACE;

    For more information, read Tables and partitioned indexes .

  • Cannot add the partition to an existing table.

    Hello

    I don't add the partition to an existing table that is not partitioned, get the error as a type of data not valid, then I'm not find syntax errors.

    ALTER TABLE MESSAGEX_XCHANGE

    ADD THE PARTITION OF RANGE (LAST_MODIFY_TIMESTAMP)

    (

    PARTITION old_data VALUES LESS THAN (To_TIMESTAMP('27/02/2014','DD/MM/YYYY')),

    You see for VALUES LESS THAN (To_TIMESTAMP('28/02/2014','DD/MM/YYYY')) of the PARTITION

    );

    Error report:

    SQL error: ORA-00902: invalid data type

    1. 00000 - "invalid data type".

    * Cause:

    * Action:

    Thank you

    Manon...

    You get this error because your edit statement has an invalid syntax. In addition, you cannot partition a table that is not already configured for partitioning!

    You have to physically re-create the partitioned table in order to add new partitions to it.

  • How to check if a table exists in the database or not?

    People,

    Hello. I use the server of Oracle 11 GR 1 material with Oracle Linux 5 database.

    My instance of database is named HRCS90, which the user access Id is MyName, and his identification of user SYS system.

    I have a few questions about user ID to access the PSRECDEL and PSROLEDEFN table in the HRCS90 database as below:

    SQL > select * from PSRECDEL;

    His output under the SYS user: table or view does not exist.

    His output under user myName: no selected lines. This means that the table THAT PSRECDEL exists, and myName user can access.

    SQL > select * from PSROLEDEFN;

    His output under SYS and MyName: table or view does not exist.

    My questions are:

    How to check if a table really exists in the instance of database HRCS90 or not?

    Thanks in advance.


    If a table is present in the database, it must be present in DBA_OBJECTS. If he fell, he would be present in the TRASH. If he fell purged, it is not available in the database, Cant it confirm you this object is not in the database? See a little test here

    SQL > CREATE TABLE TESTTAB (ID);

    Table created.

    SQL >

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB.

    OBJECT_NAME OWNER

    ------------------------------ ---------------------------------------------

    SCOTT TESTTAB

    SQL >

    -Drop table (without purging. So now, it will be in the recyclebin)

    SQL > DROP TABLE TESTTAB;

    Deleted table.

    SQL >

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    OBJECT_NAME ORIGINAL_NAME OWNER

    ------------------------------ ------------------------------ --------------

    SCOTT BIN$ 8LKloIv3SYWA0WJ33GS + Aw == $0 TESTTAB

    Now see this case when you use PURGE. If it won't move the table to the trash. First of all I am clear the existing dba_recyclebin to the user entries. Then I'm falling table using purge.

    SQL > PURGE TABLESPACE USERS USER SCOTT.

    Purged tablespace.

    SQL >

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    no selected line

    SQL > CREATE TABLE TESTTAB (ID);

    Table created.

    SQL >

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB;

    OBJECT_NAME OWNER

    ------   ----------

    SYS TESTTAB

    SQL > DROP TABLE TESTTAB PURGE;

    Deleted table.

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    no selected line

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB;

    no selected line

    Since there is no entry to both DBA_OBJECTS and DBA_RECYCLEBIN. So that means that the particular object is not in the database.

  • How to query a single partition of a table

    Dear Experts,

    Please, help me in this issue.

    https://community.Oracle.com/thread/3511578

    I try to get the number of records in a partition of a table. 11.2.0 Oracle database version

    Picture is of size 700 GB.

    Table is partitioned on COVERED_LINE_END_DATE using the range.

    I want my query to run on particular partition

    I created the local partition on COVERED_LINE_END_DATE index

    I want to restrict my questions to a single partition, and then I want to use index to get quick results.

    Currently my queries takes hours, and same table without partition table works well.

    Please suggest me how this partition table.

    I always ask this table by using the range of dates, which is quarterly.

    so I partiton table quarterly. and then I want to index particular partition.

    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    SQL_ID a75mjmfsd873v
    --------------------
     select  count(1) FROM X_3_PV_TD_LINE_ITEMS_FF_REL_2 A  WHERE
    A.COVERAGE = 'COVERED' AND A.SERIALIZED = 'Y'  AND
    A.COVERED_LINE_END_DATE BETWEEN sysdate-30 AND sysdate
    
    
    Plan hash value: 3089225921
    
    
    ------
    | Id  | Operation                               | Name| Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                        ||       |       |  1425 (100)|          |       |       |        |      |     |
    |   1 |  SORT AGGREGATE                         ||     1 |    21 |            |          |       |       |        |      |     |
    |   2 |   PX COORDINATOR                        ||       |       |            |          |       |       |        |      |     |
    |   3 |    PX SEND QC (RANDOM)                  | :TQ10000|     1 |    21 |            |          |       |       |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     SORT AGGREGATE                      ||     1 |    21 |            |          |       |       |  Q1,00 | PCWP |     |
    |   5 |      FILTER                             ||       |       |            |          |       |       |  Q1,00 | PCWC |     |
    |   6 |       PX PARTITION LIST ALL             ||  1307 | 27447 |  1425   (1)| 00:00:18 |     1 |     5 |  Q1,00 | PCWC |     |
    |   7 |        TABLE ACCESS BY LOCAL INDEX ROWID| X_3_PV_TD_LINE_ITEMS_FF_REL_2|  1307 | 27447 |  1425   (1)| 00:00:18 |   KEY |   KEY |  Q1,00 | PCWP |     |
    |   8 |         INDEX RANGE SCAN                | X_3_COVERED_LINE_END_DATE_IDX|  5229 |       |   209   (0)| 00:00:03 |   KEY |   KEY |  Q1,00 | PCWP |     |
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    22 rows selected.
    

    Thanks in advance for your help and your time.

    Thus, a query today in February will span two partitions FY14Q3 and FY14Q2 * and * actually access all subparts in each of these two partitions because your query filter to a specific subpartition.

    Hemant K Collette

  • modify an existing table to selectively the partition interval range

    I'm using Oracle 11.2.0.3.

    I have an existing table that has parition interval range.

    example:
     
    create table Log( ts date, level  varchar2(20), scr varchar2(2000))PARTITION BY RANGE (TS)
    INTERVAL( NUMTODSINTERVAL(1,'DAY'))
    Currently, we have the log of the table that is the partition of the range by day and we drop old parition to a week. However, we want to change this to persist the records in the table of WHICH = LEVEL "IMPORTANT."

    What is the best way to achieve this?

    >
    Is it possible to modify the existing interval partition table to add partition in the list?
    >
    Only using the DBMS_REDEFINITION to do online. And that always involves the creation of a "provisional" table

    If you have a window of failure just to create a new partitioned table the way you want to and INSERT the data into it. You should be able to use a DEC to do if you want. You may not use swap partition since all data must be physically moved.
    >
    Can we do list-interval partition table i.e. (with partition interval as partition sup)?
    >
    No - subpartitioning of interval is not currently supported.

    Here is the code example of a partitioned table by using the RANGE-interval LIST. It uses a VIRTUAL column, but you can ignore it for your use case

    DROP TABLE mytable;
    
    CREATE TABLE mytable
    (
    CREATION_DATE TIMESTAMP(6),
    LAST_MODIFIED_DATE TIMESTAMP(6),
    CREATION_DAY NUMBER(2) GENERATED ALWAYS AS (TO_NUMBER(TO_CHAR(CREATION_DATE, 'DD'))) VIRTUAL
    )
    PARTITION BY RANGE (LAST_MODIFIED_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
    SUBPARTITION BY LIST (CREATION_DAY)
       SUBPARTITION TEMPLATE
       ( SUBPARTITION days_1_5 VALUES (1,2,3,4,5)
       , SUBPARTITION days_6_10 VALUES (6,7,8,9,10)
       , SUBPARTITION days_11_15 VALUES (11,12,13,14,15)
       , SUBPARTITION days_16_20 VALUES (16,17,18,19,20)
       , SUBPARTITION days_21_25 VALUES (21,22,23,24,25)
       , SUBPARTITION days_26_31 VALUES (26,27,28,29,30,31)
       )
    (
       PARTITION prior_to_2013 VALUES LESS THAN (TO_DATE('2013-01-01', 'YYYY-MM-DD'))
    )
    
  • How to change the PCTFREE parameter for an existing table

    How to change the PCTFREE parameter for an existing table?

    Guys can you help me please

    Hello

    Of course it is possible.
    In this case you would export the table from the database (using old style exp)
    Start the import with the index_file option to generate the table/index instructions
    Modify the file created and updated the PCTFREE and remove any that need to be performed (default, if I remember correctly, he comments on the statements of the Index)
    Run the file for the table and the index created
    After that start the import with the option "ignore = yes".

    Make sure that you export only this particular table using "tables =
    Also in importing the "ignore = yes" will also be important data that still exists.

    In my view, however, this is not what you want to do. It's more complex, sensitive failure and the table should be deleted, so users are affected unnecessarily long.

    Success!
    FJFranken

  • Type logic Partition of an existing table

    Dear all,

    My database is 10gr 2 and Linux is the operating system.

    One of my table in the production database is huge and contains lots of data. Table is growing daily. There are many queries that users run on this table and the selection criteria is normally the date of entry of the registration, it's an Entrty_Date field with the date data type.

    I want a partition logical on this table in such a way, the table name remains the same, and data are logically partitioned.

    As if the Entry_Date is from 2005, a partition is made on criteria:


    2005-2006
    2006-2007
    .
    .
    2011
    . at the request of the user for records having entry date > 2011... the query is made only this piece of the table, which makes the fast query.

    I hope that I am able to make you understand my problem. If its possible in Oracle please let me know the name of the method and I'll RND on this one. And I have to do it on an existing table that contains a lot of data.

    Thank you
    Imran

    Hello

    You can do this
    http://www.Oracle-base.com/articles/Misc/PartitioningAnExistingTable.php
    I suggest go fill through the myths of have from before backward Oracle documentation and to understand and then to proceed
    http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96612/d_redefi.htm

    -Pavan Kumar N

  • How can I convert an existing table to the ITO

    Hello

    My Oracle version is 10.2.0.4

    Here's my my test_table structure.

    He has 1141580 rows.

    I want to convert to table index. However, there is no secondary indexes.
    How can I convert an existing table to the ITO.

    CREATE TABLE test_table (
       Column1             NUMBER        NOT NULL,
       Column2             DATE          NOT NULL,
       Column3             VARCHAR2(100) NOT NULL,
       Column4             VARCHAR2(8)   NULL,
       Column5             VARCHAR2(40)  NOT NULL,
       Column6             VARCHAR2(3)   NULL,
       Column7             NUMBER        NOT NULL,
       Column8             NUMBER        NULL,
       Column9             VARCHAR2(32)  NULL,
    )
    
    /
    
    
    
    ALTER TABLE test_table
      ADD CONSTRAINT test_table_pk2 PRIMARY KEY (
        Column1,
        Column2
      )
      USING INDEX
        STORAGE (
          INITIAL   30720 K
        )
    
    /
    
    
    ALTER TABLE test_table
      ADD CONSTRAINT test_table_cons1 FOREIGN KEY (
        Column1
      ) REFERENCES test_table2 (
        Column1
      )
    /

    Documentation Oracle say:
    Redefinition of Table online allows you to change the organization from a normal table (heap-organized) to an organized in index table and vice versa.

    For example, you might want to try.

  • Partitioning of an existing Table using the EXCHANGE PARTITION

    Hi all

    I have one unpartitioned table I partitioned by Exchange, this table has several indexes and constraints (primary and foreign).

    ALTER TABLE notpart_table ADD (
        CONSTRAINT PK_KCESPITI PRIMARY KEY (K_CESP, TIPORD)
            USING INDEX TABLESPACE TBLS_CONTA,
        CONSTRAINT FK_KCONTO_CE FOREIGN KEY (K_CONTO) REFERENCES xxxx (K_CONTO));
    
    CREATE INDEX IX_NFATTURA_CE ON notpart_tab (ANNO_FATTURA, K_REGISTRO, K_REGFA, TIPORD)
        TABLESPACE TBLS_CONTA;
    
    
    
    
    

    after Create a partitioned Table Destination

    notpart_table2, I created the same constraints and indexes defined in notpart_table


    When I run


    ALTER TABLE notpart_table2
      EXCHANGE PARTITION PART_notpart_table2
      WITH TABLE notpart_table
      WITHOUT VALIDATION
      UPDATE GLOBAL INDEXES;
    
    
    
    

    I get: ora-02266

    Why?

    Thanks in advance for any help


    Post edited by: vigilant Rosario

    It is not exactly what you have. Very probably not partitioned table, you are partitioning is the parent to another table table:

    SQL > create table tbl1 (id number)
    2.

    Table created.

    SQL > alter table tbl1
    2 Add the constraint tbl1_pk
    3 primary key
    4.

    Modified table.

    SQL > create table tbl2 (id number)
    2.

    Table created.

    SQL > alter table tbl2
    2 Add the constraint tbl1_fk1
    3 foreign key
    4 references tbl1
    5.

    Modified table.

    SQL > insert into tbl1 values (1)
    2.

    1 line of creation.

    SQL > insert into tbl2 values (1)
    2.

    1 line of creation.

    SQL > create table tbl1_part (id number)
    2 partition by range (id)
    3 (partition p1 values less than (1000000))
    4.

    Table created.

    SQL >
    SQL > alter table tbl1_part
    Exchange 2 partition p1
    3 with table tbl1
    4 without validation
    5 update global indexes
    6.
    with table tbl1
    *
    ERROR at line 3:
    ORA-02266: permit to unique/primary keys in table referenced by foreign keys

    SQL >

    If so, of the foreign key and recreate it pointing to the partitioned table as parent after finished partitioning the table.

    SY.

Maybe you are looking for