Dbms_redefinition used to convert a non partitioned table to partitioned

A table is created with below DDL
CREATE TABLE TEST1("EQUIPMENT_DIM_ID" NUMBER(9,0) NOT NULL ENABLE,
"CARD_DIM_ID" NUMBER(9,0),
"NH21_DIM_ID" NUMBER(5,0) NOT NULL ENABLE);
Interim table created with
CREATE TABLE INTERIM("EQUIPMENT_DIM_ID" NUMBER(9,0) NOT NULL ENABLE,
"CARD_DIM_ID" NUMBER(9,0),
"NH21_DIM_ID" NUMBER(5,0) NOT NULL ENABLE);
PARTITION BY RANGE ("EQUIPMENT_DIM_ID")
(PARTITION "P0" VALUES LESS THAN (1)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) NOCOMPRESS ,
PARTITION "P1" VALUES LESS THAN (2)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) NOCOMPRESS ,
Performed dbms_Redefinition (start,sync and finish) to get the table test1 data from nonpartitioned to partitioned one. At the end of table conversion, dbms_metadata.get_ddl shows like below
CREATE TABLE TEST("EQUIPMENT_DIM_ID" NUMBER(9,0) CONSTRAINT "SYS_C005605" NOT NULL ENABLE,
"CARD_DIM_ID" NUMBER(9,0),
"NH21_DIM_ID" NUMBER(5,0) CONSTRAINT "SYS_C005601" NOT NULL ENABLE);
PARTITION BY RANGE ("EQUIPMENT_DIM_ID")
(PARTITION "P0" VALUES LESS THAN (1)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) NOCOMPRESS ,
PARTITION "P1" VALUES LESS THAN (2)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) NOCOMPRESS
Can you help me how to hide or remove the "CONSTRAINT "SYS_C005605"" etc section showing in ddl for the table?The reason being if take this ddl definition and load in another database where it can give error in case same named constraint already exist.
Many thanks
Regards
Manoj Thakkan
Oracle DBA
Bangalore

Create your NOT NULL check constraints using ALTER TABLE and name them as you would a primary or foreign key ... with a name that makes sense.
I personally have a strong dislike for system generated naming and would be thrilled if this lazy practice of defining columns as NOT NULL during table creation went away.

Similar Messages

  • Convert non-partition table to partition table

    Hello Everybody
    I am just want to ask about how to Convert non-partition table to partition table ?
    Thanks
    Ramez S. Sawires

    Dear ARF
    First of all thank you for replying me , second do u have any links talking about dbms_redefinition package
    I am using Database Oracle 10g
    Thanks
    Ramez S. Sawires
    Message was edited by:
    Ramez S. Sawires

  • ORA-00604 ORA-00904 When query partitioned table with partitioned indexes

    Got ORA-00604 ORA-00904 When query partitioned table with partitioned indexes in the data warehouse environment.
    Query runs fine when query the partitioned table without partitioned indexes.
    Here is the query.
    SELECT al2.vdc_name, al7.model_series_name, COUNT (DISTINCT (al1.vin)),
    al27.accessory_code
    FROM vlc.veh_vdc_accessorization_fact al1,
    vlc.vdc_dim al2,
    vlc.model_attribute_dim al7,
    vlc.ppo_list_dim al18,
    vlc.ppo_list_indiv_type_dim al23,
    vlc.accy_type_dim al27
    WHERE ( al2.vdc_id = al1.vdc_location_id
    AND al7.model_attribute_id = al1.model_attribute_id
    AND al18.mydppolist_id = al1.ppo_list_id
    AND al23.mydppolist_id = al18.mydppolist_id
    AND al23.mydaccytyp_id = al27.mydaccytyp_id
    AND ( al7.model_series_name IN ('SCION TC', 'SCION XA', 'SCION XB')
    AND al2.vdc_name IN
    ('PORT OF BALTIMORE',
    'PORT OF JACKSONVILLE - LEXUS',
    'PORT OF LONG BEACH',
    'PORT OF NEWARK',
    'PORT OF PORTLAND'
    AND al27.accessory_code IN ('42', '43', '44', '45')
    GROUP BY al2.vdc_name, al7.model_series_name, al27.accessory_code

    I would recommend that you post this at the following OTN forum:
    Database - General
    General Database Discussions
    and perhaps at:
    Oracle Warehouse Builder
    Warehouse Builder
    The Oracle OLAP forum typically does not cover general data warehousing topics.

  • "A GUID Partition Table (GPT) partitioning scheme is required."

    Hi.
    Im trying to encrypt an external HDD and it says "A GUID Partition Table (GPT) partitioning scheme is required."
    Im aware HDD needs a MAC OS Plus (Journaled), I have check disk Information and its formated as MAC OS Plus (Journaled), so why its keep saying to a GPT Partion scheme is required)
    Any idea on how to overcome this?
    Thanks!

    Issue was with partition map, it was Apple instead GUID as listed in diskutil list

  • 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

  • Using DBCO with a non 'Z' table

    Hi all,
    I need to access a table in an Oracle DB. the connection in transactioncode DBCO is created. But when I try to select from table 'FTTH' i get the message ' "FTTH" is not defined in the ABAP Dictionary.........'.
    I have been told that the table also needs to be created in SAP. But how due I solve this when the table name dos not start with a 'Z'.
    I have been sugested that the way to solve this is to create an Alias on the Oracle server. Is this the correct way. Or is there a way to solve it in SAP without creating a non 'Z' table.
    Thanks in advance.
    Best regards
    Dennis

    Hello Dennis,
    you could use native sql to access this table ( commands EXEC SQL.  ... ENDEXEC ).
    Have a look on OSS - note 323151 .
    Regards Wolfgang

  • GUID partition table/Apple Partition Map

    Hello,
    I just bought recently a Seagate FreeAgent Go for Mac and I'm planning on using it with Time Machine. My question is the following: since the Seagate is partitioned following the GUID partition table, and my mac's internal HD is partitioned according to the Apple Partition Map; would that affect in any way the backups?
    Thx!

    From http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/diskutil .8.html
    the +APMFormat specifies that an Apple Partition Map scheme should be used. This is the traditional Apple partitioning scheme used to start up a PowerPC-based Macintosh computer, to use the disk as a non-startup disk with any Mac, or to create a multiplatform compatible startup disk+.
    For more on GPT, see:
    http://developer.apple.com/technotes/tn2006/tn2166.html
    http://db.tidbits.com/article/8405 and
    http://www.macfixit.com/article.php?story=20060721104222189

  • Why I cannot split a partition table whose partitions are in a tablespace?

    SQL> CREATE TABLE "GDRK"."LT2_701C_RANGE"
    2 ( "CHAR_CODE" VARCHAR2(40),
    3 "STAT_UNIT_CODE" VARCHAR2(20),
    4 "ORGN_TYPE_CODE" CHAR(1) NOT NULL ENABLE,
    5 "ORGN_CODE" VARCHAR2(26) NOT NULL ENABLE,
    6 "ORGN_NAME" VARCHAR2(60) NOT NULL ENABLE,
    7 "UUID" VARCHAR2(36) NOT NULL ENABLE,
    8 "CYC_CODE" VARCHAR2(2) NOT NULL ENABLE,
    9 "H10" VARCHAR2(2),
    10 "H11" VARCHAR2(3),
    11 "H12" VARCHAR2(1),
    12 "H13" VARCHAR2(1),
    13 "H14" VARCHAR2(1),
    14 "H15" VARCHAR2(1),
    15 "H16" VARCHAR2(1),
    16 "H17" VARCHAR2(1),
    17 "H18" VARCHAR2(1),
    18 "H19_01" VARCHAR2(3),
    19 "H19_02" VARCHAR2(1),
    20 "H2" VARCHAR2(1),
    21 "H20" VARCHAR2(4),
    22 "H3_01" VARCHAR2(2),
    23 "H3_02" VARCHAR2(2),
    24 "H4_01" VARCHAR2(1),
    25 "H4_02" VARCHAR2(1),
    26 "H5_01" VARCHAR2(1),
    27 "H5_02" VARCHAR2(1),
    28 "H6" VARCHAR2(1),
    29 "H7" VARCHAR2(1),
    30 "H8" VARCHAR2(1),
    31 "H9" VARCHAR2(4),
    32 "REG_NUM" NUMBER,
    33 "ERA_NUM" NUMBER,
    34 "POWER_1" FLOAT(126),
    35 "POWER_2" FLOAT(126)
    36 )
    37 PARALLEL
    38 partition by range(CHAR_CODE) --substr(c1,1,1)
    39 (
    40 partition p0 values less than ('10'),
    41 partition p1 values less than ('20'),
    42 partition p2 values less than ('50'),
    43 partition p5 values less than (maxvalue));
    Table created.
    SQL> set timi on
    SQL> insert /*+ append */ into LT2_701C_RANGE select * from LT2_701C;
    539398 rows created.
    Elapsed: 00:00:28.02
    SQL> commit;
    Commit complete.
    Elapsed: 00:00:00.06
    SQL> select count(*) from LT2_701C_RANGE partition(p0);
    COUNT(*)
    0
    Elapsed: 00:00:00.00
    SQL> c/p0/p5
    1* select count(*) from LT2_701C_RANGE partition(p5)
    SQL> /
    COUNT(*)
    0
    Elapsed: 00:00:00.02
    SQL> c/p5/p2
    1* select count(*) from LT2_701C_RANGE partition(p2)
    SQL> /
    COUNT(*)
    539398
    Elapsed: 00:00:01.15
    SQL> ALTER TABLE LT2_701C_RANGE SPLIT PARTITION p2 at ('4420')INTO (
    2 PARTITION p20,
    3 PARTITION p21);
    ALTER TABLE LT2_701C_RANGE SPLIT PARTITION p2 at ('4420')INTO (
    ERROR at line 1:
    ORA-01652: unable to extend temp segment by 128 in tablespace EPRAS
    Elapsed: 00:00:00.89

    SQL> drop table LT2_701c_RANGE;
    Table dropped.
    Elapsed: 00:00:00.58
    SQL> drop index idx_c_p2;
    drop index idx_c_p2
    ERROR at line 1:
    ORA-01418: specified index does not exist
    Elapsed: 00:00:00.00
    SQL> CREATE TABLE "GDRK"."LT2_701C_RANGE"
    2 ( "CHAR_CODE" VARCHAR2(40),
    3 "STAT_UNIT_CODE" VARCHAR2(20),
    4 "ORGN_TYPE_CODE" CHAR(1) NOT NULL ENABLE,
    5 "ORGN_CODE" VARCHAR2(26) NOT NULL ENABLE,
    6 "ORGN_NAME" VARCHAR2(60) NOT NULL ENABLE,
    7 "UUID" VARCHAR2(36) NOT NULL ENABLE,
    8 "CYC_CODE" VARCHAR2(2) NOT NULL ENABLE,
    9 "H10" VARCHAR2(2),
    10 "H11" VARCHAR2(3),
    11 "H12" VARCHAR2(1),
    12 "H13" VARCHAR2(1),
    13 "H14" VARCHAR2(1),
    14 "H15" VARCHAR2(1),
    15 "H16" VARCHAR2(1),
    16 "H17" VARCHAR2(1),
    17 "H18" VARCHAR2(1),
    18 "H19_01" VARCHAR2(3),
    19 "H19_02" VARCHAR2(1),
    20 "H2" VARCHAR2(1),
    21 "H20" VARCHAR2(4),
    22 "H3_01" VARCHAR2(2),
    23 "H3_02" VARCHAR2(2),
    24 "H4_01" VARCHAR2(1),
    25 "H4_02" VARCHAR2(1),
    26 "H5_01" VARCHAR2(1),
    27 "H5_02" VARCHAR2(1),
    28 "H6" VARCHAR2(1),
    29 "H7" VARCHAR2(1),
    30 "H8" VARCHAR2(1),
    31 "H9" VARCHAR2(4),
    32 "REG_NUM" NUMBER,
    33 "ERA_NUM" NUMBER,
    34 "POWER_1" FLOAT(126),
    35 "POWER_2" FLOAT(126)
    36 )
    37 PARALLEL
    38 partition by range(CHAR_CODE) --substr(c1,1,1)
    39 (
    40 partition p0 values less than ('4410'),
    41 partition p1 values less than ('4420'),
    42 partition p2 values less than ('4450'),
    43 partition p5 values less than (maxvalue));
    Table created.
    Elapsed: 00:00:00.22
    SQL> insert /*+ append */ into LT2_701C_RANGE select * from LT2_701C;
    insert /*+ append */ into LT2_701C_RANGE select * from LT2_701C
    ERROR at line 1:
    ORA-01688: unable to extend table GDRK.LT2_701C_RANGE partition P0 by 128 in
    tablespace EPRAS
    Elapsed: 00:00:06.20
    SQL> show parameter recy
    NAME TYPE VALUE
    buffer_pool_recycle string
    db_recycle_cache_size big integer 0
    recyclebin string OFF

  • Regarding Partition Table:Spilt Partition

    Hi ,
         I have create one partition table. I did range partitioned on this .original table has 1035 Millions records.
         table has data from Jan 2008 to till May.I have create one partition of Jan-2008 to March 2009.
         Name is PS_INTRIMDETAIL_TILL_MAR2009 .This Partition has one table space
         Which has Five datafile of 20 GB.
         Next Onwards Partitions are Apr2009,May2009 this partitons are Monthwise.
         Now I want to split this PS_INTRIMDETAIL_TILL_MAR2009 partition on quaterly basis.
         Kindly suggest me how can I split this partiton.
         I also want to know the appropriate tablespace size for split partition.

    Hello,
    Here;s how you can split your partition by quartely
    ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_MAR2009 AT
    (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q4
           TABLESPACE TABLESPACE TS_INTROAM_TILL_MAR2009
           PARTITION PS_INTROAM_TILL_MAR2009);
    ALTER TABLE KLONDIKE.TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_Q4 AT
    (TO_DATE(' 2008-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q3
           PARTITION PS_INTROAM_TILL_Q4);
    ALTER TABLE KLONDIKE.TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_Q3 AT
    (TO_DATE(' 2008-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q2
           PARTITION PS_INTROAM_TILL_Q3);
    ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_Q2 AT
    (TO_DATE(' 2008-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q1
           PARTITION PS_INTROAM_TILL_Q2);To compress old partitions;
    You can create one temp compressed for one quaretly partiton, you can repeat this process
    1. create table Q1_cmp tablespace <ts_name> compress as select * from TBLMEDRATINTRIM_DETAIL_ROAM_01 where CALLEND between to_date('20080101,'YYYYMMDD') and to_date('20080331','YYYYMMDD');
    2. Then exchange Q1 uncompressed partition with Q1_cmp
    ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
      EXCHANGE PARTITION PS_INTROAM_TILL_Q1
      WITH TABLE Q1_CMP
      EXCLUDING INDEXES
      WITHOUT VALIDATION;
    3. Then just rename partition back to original nameyou are in telecom and are you saving CDRs or MSUs, so tablespace size depends upon the volume. I suggest to go with the default value of 32 gig and I think it will grow upto 20 G
    create tablespace q1_ts datafile '/location/q1_ts/q1_tsdat01.dbf'  size 512M autoextend on next 256M maxsize unlimited.Hope this helps
    Regards

  • No more optical drive and windows 8 issue: "Windows cannot be installed on this disk as it has an MBR partition table."

    I have an Early 2011 13" MBP going strong with an SSD and original HDD installed in the optical drive. However, having had success with windows 7 on my old HDD I was planning to install Windows 8.1 (from .iso) on my SSD. However, for the past day or so it's been a nightmare.
    I tried the official procedure but by editing the bootcamp info.plist so I could boot from USB (you can't install windows from an external optical drive apparently) partitioning as bootcamp wanted too.
    I then tried it a number of different ways using disk utility etc and with an empty space
    However, I always seem to end up with the error "“Windows cannot be installed on this disk. The selected disk has an MBR partition table. On EFI systems, Windows can only installed on GPT disks“
    I read some interesting stuff here http://www.royhochstenbach.com/installing-windows-8-1-on-a-2013-mac-pro/
    He points out that
    "Windows 7 and 8 in x64 support EFI. Normally if you install Windows on a Mac and use the installation DVD, it boots into regular BIOS mode, thus can be installed on an MBR partition. I tried the same, but since the Mac Pro doesn’t have an optical drive I had to use an external drive. And apparently the Mac boots external optical drives in EFI mode too. The Bootcamp wizard is aware of this, and creates a GPT partition on a non-superdrive Mac but an MBR partition on a superdrive Mac."
    This means Bootcamp is essentially making the wrong type of partition?
    My real question is? How do I install it windows 8? I'm really on my last legs!
    I really don't want to have to open this thing up and reinsert my optical drive as its really really difficult to get out of the enclosure (would probably have to break it).
    A huge thanks in advance!

    Hi,
    Have you tried that suggestion?
    You also could use this commands to check and install again:
    Inside windows installer, hit Shift+F10 to get a command prompt, then run diskpart and type List disk to displays a list of disks and information about them, such as their size, amount of available free space, whether the disk is a basic or dynamic disk,
    and whether the disk uses the master boot record (MBR) or GUID partition table (GPT) partition style.
    and then select the target disk. Zap the drive (with the clean command), create GPT table (new gpt), create the GPT-EFI special partitions.
    Step-by-step instructions is here for reference:
    HOW TO: Use the Diskpart.efi Utility to Create a GUID Partition Table Partition on a Raw Disk in Windows
    http://support.microsoft.com/kb/297800?wa=wsignin1.0
    Then reboot so the firmware finds those partitions and adds the disk to the EFI-native boot order (Windows installer checks this).
    Karen Hu
    TechNet Community Support

  • PARTITION TABLE 이란?

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-13
    PARTITION TABLE 이란?
    =====================
    PURPOSE
    partition table에 대한 기본 개념입니다.
    SCOPE
    8~10g Standard Edition 에서는 Partitioning Option 은 지원하지 않습니다.
    Explanation
    ORACLE 8에서 제공하는 partition table 에 대해 알아보자.
    1. Partitioned Table이란?
    partitioning 이란 큰 object 를 작고 manage 가 가능하게 분리하는 것을 의미하며,
    table 이나 index 에서만 가능하고 cluster, snapshot 은 불가능하다.
    각 partition 은 별개의 segment 에 저장되어진다.
    Oracle8에서 table 은 기본이 되는 key value 에 의해 partition 으로 분리되어진다.
    각 partition은 독립적으로 운영된다.
    예를 들어 table partition 은 DML (insert, update, delete) 문에 의한
    transaction 을 다른 partition 에 영향을 주지 않고 복구가 가능하다.
    DBA_TAB_PARTITIONS 에 각 partition 의 storage 정보 등을 갖는다.
    2. 어떻게 partitioned Table을 생성하는가 ?
    partition key(s)와 개개의 partition 에 범위를 주어 생성한다.
    이 partition 이름은 주어질 수 있으며 만일 생략되면 ORACLE 이 SYS_Pn 으로
    generate 한다.
    예제 :
    emp partition 을 EMPNO column을 partition key 로 하여 생성해 보자.
    CREATE TABLE emp
    (EMPNO NUMBER(5),
    PARTITION BY RANGE(EMPNO)(
    partition emp_p1 VALUES LESS THAN (2000),
    partition emp_p2 VALUES LESS THAN (4000),
    partition emp_p3 VALUES LESS THAN (MAXVALUE));
    select * from emp partition (emp_p3);
    ACCT_NO PERSON SALES_AMOUNT WEEK_NO
    1000 abc 10 30
    insert into emp partition (emp_p3) values (7000, 'bcd', 10, 30);
    3. partition table 관련한 dictionary 정보
    . storage parameters
    --> DBA_TAB_PARTITIONS
    . partiton table 의 upper partition bound
    --> select high_value, partition_position from sys.dba_tab_partitions
    where table_name = 'SALES';
    4. Partitioned tables의 제약점은?
    a) Datatype 제약
    Partitioned table은 LONG 이나 LONG RAW datatype을 가질 수 없다.
    또한 LOB datatypes (BLOB, CLOB, NCLOB, or BFILE), object types을 가질 수
    없다. 이 LOB type 은 V8.1부터는 가능할 것으로 기대된다.
    b) Clusters 는 partition 될 수 없다.
    c) Bitmap 제한
    bitmap 은 local partitioned table 에서만 가능하고 global indexes 로는
    불가능하다.
    d) Physical 제한
    Partitioned table은 여러 개의 database에 걸쳐 있을 수 없다.
    오직 1 instance 에서만 가능하다.
    5. Local Prefixed와 Local Non-Prefixed index란?
    Local index란 partitioned table 의 index로 이는 오로지 한 partition 의
    row들을 나타내는 ROWID 를 갖는 index 이다.
    이는 주로 partition table 의 partition key 로 사용되어진다.
    이를 equi-partitioning 이라 한다.
    Prefixed index는 partition key 에 대응하는 leading index key(s) 이다.
    Non-Prefixed index 는 leading column 이 되는 partition key 를 포함하지 않는
    index key 이다.
    6. Global index란?
    global index 는 prefix 만 제공하며 non-prefix 는 제공하지 않는다.
    global Index 는 전체 table 의 ROWID 처럼 사용되어진다.
    7. partitions을 사용하는 방법?
    Partition-Extended Table Name을 사용한다.
    즉 "schema.table PARTITION part_name" 를 사용하는데 schema 는 schema owner
    이고 table은 base table 이름이며, PARTITION 은 써도 되고 안 써도 되는 용어이고,
    partition_name은 partition 의 name 이다.
    이 partition-extented table 이름은 다음 문장에서 사용되어진다.
    INSERT
    UPDATE
    DELETE
    LOCK TABLE
    SELECT
    Q) partition 에 insert 시:
    SQL> insert into sales partition (p8) values (7000, 'bcd', 10, 30);
    Q) partition을 delete시:
    SQL> delete from sales partition (p8);
    Q) partition을 update 시:
    SQL> update sales partition (p8) set sales_amount = 20;
    Q) partition을 select 시:
    SQL> select * from sales PARTITION (Q4);
    8. partition-extended table 이름의 제약?
    . remote schema object를 포함할 수 없다.
    partition-extended table name 은 dblink 를 포함할 수 없으며, dblink 를 통해
    table 로 변환 가능한 synonym 을 포함할 수 없다.
    만일 remote partition의 사용을 원할 때에는 remote site 에서
    partitioned-extended table 이름을 사용하여 view 를 생성할 수 있다.
    . partition-extended table 이름은 PL/SQL에서 사용되지 않는다.
    partition-extended table 이름을 사용한 SQL 문은 DBMS_SQL package 를 통해
    만일 사용하고자 한다면 view 를 사용하여야 한다.
    . 오로지 base table 만 허용된다.
    partition extension 은 base table 에만 허용되고 synonyms, views, 그외 schema
    에서는 허용되지 않는다.
    9. Export/Import 시 Table-Level 과 Partition-Level 의 차이점?
    테이블 단위의 export에서는 partitioned or non-partitioned table 전체가 index
    와 그 table 에 dependent 한 다른 모든 object 가 함께 export 된다.
    즉 partitioned table 의 모든 partition 이 export 된다. (이는 direct path
    export and conventional path export에 모두 적용.)
    또한 모든 export 모드 (full, user, table) 가 테이블 단위의 export 를 support
    한다.
    partition 단위의 export에서는 사용자가 테이블의 하나 또는 그 이상의 partition
    을 export 할 수 있다.
    Full database 단위나 user mode 는 partition-level의 export 를 support 하지
    않는다. 오직 table levle 만 가능하다.
    또한 incremental export (incremental,cumulative, and complete) 가 full
    database mode 에서만 가능하기 때문에 partition-level export는 incremental
    exports를 지원하지 못한다.
    Partition-level import는 export 되어진 non-partitioned table을 import 하지
    못한다. 그러나, table-level 의 import로 non-partitioned table 로부터
    partitioned table 이 import되어진다.
    즉 partition-level import 는 export 되어진 table 이 partitioned 되어 있고
    export file 에 있을 때에만 가능하다.
    export file 의 partition name 이 valid 하지 않는 경우 import 시 경고
    message 를 발생한다.
    모든 경우 partitioned data 는 import 시 선택적으로 가능하게 export 되어 진다.
    export 나 import 시 table name 을 지정 시는
    TABLES=schema_name : tables_name : partition_name 으로 사용한다.
    Partition 단위의 export 는 table 내의 특정 partition 을 한개 또는 그 이상을
    export 가능하게 한다.
    이 때 partition name 이 주어지지 않으면 table 전체가 사용된다.
    다음은 partiotion level 의 export 예제이다.
    exp system/manager FILE = export.dmp TABLES = (scott.b:px, scott.b:py,
    mary.c, d:qb)
    이 예제에서 scott.b 는 반드시 partitioned table이고 px ,py 는 2개의
    partition 이다.
    mary.c 는 partitioned 또는 non-partitioned table 이다. 그러나 d table 은
    반드시 partitioned table 이며 qb 는 그 partioion 중의 하나이다.
    만일 table-name이나 같은 table 의 partition-name이 중복 사용되어지면
    export 는 error 를 발생한다. 예를 들어 다음 partition-level의 export 명령어는
    table sc 와 partition px 가 중복 사용되어 error 를 발생한다.
    exp system/manager FILE = export.dmp TABLES = (sc, sc:px, sc)
    10. partiton table 또는 view를 어떻게 non-partitioned table로 변환시키는가?
    table 을 변환하기 위해 dummy table 을 생성하고,
    alter table EXCHANGE PARTITION 명령어를 통해 수행한다.
    이 명령어는 매우 빨리 data dictionary 를 update 시킨다.
    SPLIT PARTITION 은 매우 큰 partition table 이나 view 를 handling 하는 데
    유용하다.
    SQL:
    1. partition을 갖는 dummy_t table 을 생성
    2. alter table EXCHANGE partition T with dummy_T
    3. drop table T
    exp/imp:
    1. export the table
    2. drop the table .
    3. partiton 을 갖는 table 을 다시 생성
    4. table data 를 import 한다.
    11. table partition을 결합하는 법?
    export/import:
    partition-level 의 export, import 를 통해 가능하다.
    1. partition data 를 갖는 temporary table을 생성한다.
    2. drop the partition to be merged
    3. insert into table (select * from temporary table)
    4. drop temp.
    그러나, table partition 을 분할하는 방법은 export, import 를 통해 불가능하다.
    Example
    Reference Document
    ------------------

    Before we go too far with this, if you manually query with TO_DATE on the variable instead of TO_CHAR on the column, does the query actually use the index?
    The TO_CHAR on the column will definitely stop Oracle from using any index on the column. If the query will use the index if you TO_DATE the variable, as I see it, you have three options. First, fix the application problem that won't let you use TO_DATE from the application. Second, change the application to call a function returning a ref cursor, get the date string as a parameter to the function, and do the TO_DATE in the function.
    Third, you could consider creating a function-based index on TO_CHAR(transaction_date, 'dd-Mon-yy'). This would be the least desirable option, particularly if you would also be selecting records based on a range of transaction_dates, since it loses a lot of information that the optimizer could use in devising an efficient query plan. It could also change your results for a range scan.
    John

  • Deadlock issue in Oracle 10g Partitioned Tables

    Hi ALL,
    I am facing an issue of Deadlock while inserting data into a partitioned table.
    I get an error "ORA-00600: Deadlock detected". when i see the trace files, following lines are appearing in them:
    "Single resource deadlock: blocking enqueue which blocks itself".
    Here is the detail of my test case:
    1. I have a list-partitioned table, with partitioning defined on some business codes.
    2. I have a query that merges data into partitioned table (actually compares unique keys between temporary table and partitioned table and then issue an insert if keys not matched, no update part).
    3. The temporary table contains transactional data against many business codes.
    3. when calling the above query from multiple (PL/SQL) sessions, i observe that when we merge data in same partition (from different sessions) than deadlock issue occurs, otherwise it is OK.
    4. Note that all sessions are executed at same time. Also note that Commit is called after each session is completed. Each session contains 2-3 more queries after the mentioned merge statement.
    Is there an issue with oracle merge/insert on same partition (from different sessions)? What is the locking mechanism for this particular case (partitioned tables)?
    My oracle version is Oracle 10g (10.2.0.4). Kindly advice.
    Thanks,
    QQ.

    Could you print the deadlock tree so we can see the type and mode of the locking. (Please use the 'code' tags - see FAQ at top right of screen - to showthe output in fixed font). can you list any SQL operated by this session that gets reported in the trace file.
    Does the table reference itself in a foreign key.
    Is this table involved in any referential integrity constraints.
    Do you have a global primary key index, or a local primary key index ?
    Are there any triggers on the table - if so do they contain autonomous transactions.
    At present the only though that springs to mind is that the merge command has to lock the target table to do the insert/update, but it also has to lock any child table. The mode of the child lock depends on whether it has a suitable index or not, and whether the child table IS also the parent table. If you have two merges to the same partition one partition may get its locks, and the other partition may be in a state where it can't get one of the locks because it's wait for the other. (This shouldn't be a self-deadlock, though, but the scenario might be heading in the right direction for a self-deadlock).
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." (Stephen Hawking)

  • Deadlock issue in Partitioned Tables

    Hi ALL,
    I am facing an issue of Deadlock while inserting data into a partitioned table.
    I get an error "ORA-00600: Deadlock detected". when i see the trace files, following lines are appearing in them:
    "Single resource deadlock: blocking enqueue which blocks itself".
    Here is the detail of my test case:
    1. I have a list-partitioned table, with partitioning defined on some business codes.
    2. I have a query that merges data into partitioned table (actually compares unique keys between temporary table and partitioned table and then issue an insert if keys not matched, no update part).
    3. The temporary table contains transactional data against many business codes.
    3. when calling the above query from multiple (PL/SQL) sessions, i observe that when we merge data in same partition (from different sessions) than deadlock issue occurs, otherwise it is OK.
    4. Note that all sessions are executed at same time. Also note that Commit is called after each session is completed. Each session contains 2-3 more queries after the mentioned merge statement.
    Is there an issue with oracle merge/insert on same partition (from different sessions)? What is the locking mechanism for this particular case (partitioned tables)?
    My oracle version is Oracle 10g (10.2.0.4). Kindly advice.
    Thanks,
    QQ.

    Oracle MERGE statements are slow as they must validate every record before insert.
    If you use array processing with BULK COLLECT and FORALL with the SAVE EXCEPTIONS clause you can avoid most of the overhead. Just collect your rows in an array, issue a FORALL INSERT SAVE EXCEPTIONS and let Oracle handle whatever happens.
    When Oracle is done, and it will be hundreds of times faster than what you are doing now, you can either process or ignore the records in the exceptions array.
    Another solution, more efficient if you can do it, is to just to an INSERT INTO SELECT FROM using an exceptions table created with DBMS_ERRLOG.
    www.psoug.org/reference/dbms_errlog.html

  • Partition pruning not working for partitioned table joins

    Hi,
    We are joining  4 partitioned tables on partition column & other key columns. And we are filtering the driving table on partition key. But explain plan is showing that all tables except the driving table are not partition pruning and scanning all partitions.Is there any limitation that filter condition cannot be dynamic?
    Thanks a lot in advance.
    Here are the details...
    SELECT a.pay_prd_id,
                  a.a_id,
                  a.a_evnt_no
      FROM b,
                c,
                a,
                d
    WHERE  (    a.pay_prd_id = b.pay_prd_id ---partition range all
                AND a.a_evnt_no  = b.b_evnt_no
                AND a.a_id       = b.b_id
       AND (    a.pay_prd_id = c.pay_prd_id---partition range all
            AND a.a_evnt_no  = c.c_evnt_no
            AND a.a_id       = c.c_id
       AND (    a.pay_prd_id = d.pay_prd_id---partition range all
            AND a.a_evnt_no  = d.d_evnt_no
            AND a.a_id       = d.d_id
       AND (a.pay_prd_id =  ---partition range single
               CASE '201202'
                  WHEN 'YYYYMM'
                     THEN (SELECT min(pay_prd_id)
                                      FROM pay_prd
                                     WHERE pay_prd_stat_cd = 2)
                  ELSE TO_NUMBER ('201202', '999999')
               END
    DDLs.
    create table pay_prd
    pay_prd_id number(6),
    pay_prd_stat_cd integer,
    pay_prd_stat_desc varchar2(20),
    a_last_upd_dt DATE
    insert into pay_prd
    select 201202,2,'OPEN',sysdate from dual
    union all
    select 201201,1,'CLOSE',sysdate from dual
    union all
    select 201112,1,'CLOSE',sysdate from dual
    union all
    select 201111,1,'CLOSE',sysdate from dual
    union all
    select 201110,1,'CLOSE',sysdate from dual
    union all
    select 201109,1,'CLOSE',sysdate from dual
    CREATE TABLE A
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    A_ID        NUMBER(9) NOT NULL,
    A_EVNT_NO    NUMBER(3) NOT NULL,
    A_DAYS        NUMBER(3),
    A_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION A_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE A ADD CONSTRAINT A_PK PRIMARY KEY (PAY_PRD_ID,A_ID,A_EVNT_NO) USING INDEX LOCAL;
    insert into a
    select 201202,1111,1,65,sysdate from dual
    union all
    select 201202,1111,2,75,sysdate from dual
    union all
    select 201202,1111,3,85,sysdate from dual
    union all
    select 201202,1111,4,95,sysdate from dual
    CREATE TABLE B
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    B_ID        NUMBER(9) NOT NULL,
    B_EVNT_NO    NUMBER(3) NOT NULL,
    B_DAYS        NUMBER(3),
    B_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION B_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE B ADD CONSTRAINT B_PK PRIMARY KEY (PAY_PRD_ID,B_ID,B_EVNT_NO) USING INDEX LOCAL;
    insert into b
    select 201202,1111,1,15,sysdate from dual
    union all
    select 201202,1111,2,25,sysdate from dual
    union all
    select 201202,1111,3,35,sysdate from dual
    union all
    select 201202,1111,4,45,sysdate from dual
    CREATE TABLE C
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    C_ID        NUMBER(9) NOT NULL,
    C_EVNT_NO    NUMBER(3) NOT NULL,
    C_DAYS        NUMBER(3),
    C_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION C_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE C ADD CONSTRAINT C_PK PRIMARY KEY (PAY_PRD_ID,C_ID,C_EVNT_NO) USING INDEX LOCAL;
    insert into c
    select 201202,1111,1,33,sysdate from dual
    union all
    select 201202,1111,2,44,sysdate from dual
    union all
    select 201202,1111,3,55,sysdate from dual
    union all
    select 201202,1111,4,66,sysdate from dual
    CREATE TABLE D
    (PAY_PRD_ID    NUMBER(6) NOT NULL,
    D_ID        NUMBER(9) NOT NULL,
    D_EVNT_NO    NUMBER(3) NOT NULL,
    D_DAYS        NUMBER(3),
    D_LAST_UPD_DT    DATE
    PARTITION BY RANGE (PAY_PRD_ID)
    INTERVAL( 1)
      PARTITION D_0001 VALUES LESS THAN (201504)
    ENABLE ROW MOVEMENT;
    ALTER TABLE D ADD CONSTRAINT D_PK PRIMARY KEY (PAY_PRD_ID,D_ID,D_EVNT_NO) USING INDEX LOCAL;
    insert into c
    select 201202,1111,1,33,sysdate from dual
    union all
    select 201202,1111,2,44,sysdate from dual
    union all
    select 201202,1111,3,55,sysdate from dual
    union all
    select 201202,1111,4,66,sysdate from dual

    Below query generated from Business Objects and submitted to Database (the case statement is generated by BO). Cant we use Case/Subquery/Decode etc for the partitioned column? We are assuming that  the case causing the issue to not to dynamic partition elimination on the other joined partitioned tables (TAB_B_RPT, TAB_C_RPT).
    SELECT TAB_D_RPT.acvy_amt,
           TAB_A_RPT.itnt_typ_desc,
           TAB_A_RPT.ls_typ_desc,
           TAB_A_RPT.evnt_no,
           TAB_C_RPT.pay_prd_id,
           TAB_B_RPT.id,
           TAB_A_RPT.to_mdfy,
           TAB_A_RPT.stat_desc
      FROM TAB_D_RPT,
           TAB_C_RPT fee_rpt,
           TAB_C_RPT,
           TAB_A_RPT,
           TAB_B_RPT
    WHERE (TAB_B_RPT.id = TAB_A_RPT.id)
       AND (    TAB_A_RPT.pay_prd_id = TAB_D_RPT.pay_prd_id -- expecting Partition Range Single, but doing Partition Range ALL
            AND TAB_A_RPT.evnt_no    = TAB_D_RPT.evnt_no
            AND TAB_A_RPT.id         = TAB_D_RPT.id
       AND (    TAB_A_RPT.pay_prd_id = TAB_C_RPT.pay_prd_id -- expecting Partition Range Single, but doing Partition Range ALL
            AND TAB_A_RPT.evnt_no    = TAB_C_RPT.evnt_no
            AND TAB_A_RPT.id         = TAB_C_RPT.id
       AND (    TAB_A_RPT.pay_prd_id = fee_rpt.pay_prd_id -- expecting Partition Range Single
            AND TAB_A_RPT.evnt_no    = fee_rpt.evnt_no
            AND TAB_A_RPT.id         = fee_rpt.id
       AND (TAB_A_RPT.rwnd_ind = 'N')
       AND (TAB_A_RPT.pay_prd_id =
               CASE '201202'
                  WHEN 'YYYYMM'
                     THEN (SELECT DISTINCT pay_prd.pay_prd_id
                                      FROM pay_prd
                                     WHERE pay_prd.stat_cd = 2)
                  ELSE TO_NUMBER ('201202', '999999')
               END
    And its explain plan is...
    Plan
    SELECT STATEMENT ALL_ROWS Cost: 79 K Bytes: 641 M Cardinality: 3 M
    18 HASH JOIN Cost: 79 K Bytes: 641 M Cardinality: 3 M
    3 PART JOIN FILTER CREATE SYS.:BF0000 Cost: 7 K Bytes: 72 M Cardinality: 3 M
    2 PARTITION RANGE ALL Cost: 7 K Bytes: 72 M Cardinality: 3 M Partition #: 3 Partitions accessed #1 - #1048575
    1 TABLE ACCESS FULL TABLE TAB_D_RPT Cost: 7 K Bytes: 72 M Cardinality: 3 M Partition #: 3 Partitions accessed #1 - #1048575
    17 HASH JOIN Cost: 57 K Bytes: 182 M Cardinality: 874 K
    14 PART JOIN FILTER CREATE SYS.:BF0001 Cost: 38 K Bytes: 87 M Cardinality: 914 K
    13 HASH JOIN Cost: 38 K Bytes: 87 M Cardinality: 914 K
    6 PART JOIN FILTER CREATE SYS.:BF0002 Cost: 8 K Bytes: 17 M Cardinality: 939 K
    5 PARTITION RANGE ALL Cost: 8 K Bytes: 17 M Cardinality: 939 K Partition #: 9 Partitions accessed #1 - #1048575
    4 TABLE ACCESS FULL TABLE TAB_C_RPT Cost: 8 K Bytes: 17 M Cardinality: 939 K Partition #: 9 Partitions accessed #1 - #1048575
    12 HASH JOIN Cost: 24 K Bytes: 74 M Cardinality: 957 K
    7 INDEX FAST FULL SCAN INDEX (UNIQUE) TAB_B_RPT_PK Cost: 675 Bytes: 10 M Cardinality: 941 K
    11 PARTITION RANGE SINGLE Cost: 18 K Bytes: 65 M Cardinality: 970 K Partition #: 13 Partitions accessed #KEY(AP)
    10 TABLE ACCESS FULL TABLE TAB_A_RPT Cost: 18 K Bytes: 65 M Cardinality: 970 K Partition #: 13 Partitions accessed #KEY(AP)
    9 HASH UNIQUE Cost: 4 Bytes: 14 Cardinality: 2
    8 TABLE ACCESS FULL TABLE PAY_PRD Cost: 3 Bytes: 14 Cardinality: 2
    16 PARTITION RANGE JOIN-FILTER Cost: 8 K Bytes: 106 M Cardinality: 939 K Partition #: 17 Partitions accessed #:BF0001
    15 TABLE ACCESS FULL TABLE TAB_C_RPT Cost: 8 K Bytes: 106 M Cardinality: 939 K Partition #: 17 Partitions accessed #:BF0001
    Thanks Again.

  • Replication For Partitioned Table

    Well , I have a partitioned Table having partition on Date Field. Table Contains composite primary Key Date Field + Connection Id . Table Contains approx 30 Million Records.
    Now when i m goin for replication setup , created materialized view on the basis of primary key , the fast refresh process takin time approx 3 hrs for refreshing 80,000 records on LAN environment.
    Before partitioning this table the same refresh was taking only 20 Minutes.
    can any body help me out to fasten up the refresh ?

    What version of oracle are you using? What type of partitioning you are using on the table? Is the materialized view partitioned? What type of refresh mechanism are you using?(REFRESH FAST or REFRESH FORCE or REFRESH COMPLETE)? Is it ON DEMAND or ON COMMIT?

Maybe you are looking for

  • Dropdown Custom field in Invoice

    Hi , I want to add a dropdown field in Ivoice Basic data screen. I am planning to do it using SRM Extension framework. SAP Implementation Guide --> SAP Supplier Relationship Management --> SRM Server --> Cross Application Basic Settings --> Extension

  • Should I buy a MacBook now? Please help!

    My old Notebook just messed up, so I definitely need a new one quite soon. I had a look at some MacBooks at the store and really liked them. I would order it online at the Apple Store and choose a bigger harddrive (80gb), so it would definitely be a

  • Strange intermittent internet disconnect-reconnect... and another question.

    This has happened twice now and is fixed with a restart, but I'd like to know if I have faulty hardware. What happens is that I'll open my Macbook from sleeping and the internet will disconnect for 2 seconds, reconnect for 2 seconds, disconnect for 2

  • Is there a way to hide buddy icon/picture in messages? [In the left section that lists all chats]

    Is there a way to hide buddy avatars/pictures from Messages?  I don't mean in a the chat window, but in the left section that lists all active conversations.  I don't really use pictures with contacts, so all I see are gray faces. Using Messages 8.0

  • Weird crash on bootup "kextcache quit unexpectedly"

    So I'm seeing something rather odd here on my 17" MBP. Every time I reboot, once it's finished booting it pops up a notification that "kextcache quit unexpectedly" with the OK and Report buttons available. I've reported it, but I'm trying to figure o