Create list-range partition table

Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
I am trying to create a partition table with LIST-Range, and I am getting this following error, is oracle 10.2.0.4 database supports to create list-range partition(composite)
SQL> CREATE TABLE tbp_list_range
REPORT_DATE DATE,
member_id_01 varchar2(2),
DATE_SERVICE date,
member_id varchar2(15)
PARTITION BY LIST(member_id_01)
SUBPARTITION BY RANGE (DATE_SERVICE)
PARTITION SPTYR04M01_C VALUES('AA','aa')
NOLOGGING
COMPRESS (
SUBPARTITION PTYR12M011 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
SUBPARTITION PTYR12M021 VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
SUBPARTITION recent1 VALUES LESS THAN (MAXVALUE)
PARTITION SPTYR04M01_Yo VALUES('BJ','bj')
NOLOGGING
COMPRESS (
SUBPARTITION PTYR12M01 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
SUBPARTITION PTYR12M02 VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
SUBPARTITION recent2 VALUES LESS THAN (MAXVALUE)
SUBPARTITION BY RANGE (DATE_SERVICE)
ERROR at line 9:
ORA-00922: missing or invalid option
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Any help would be greatly appreciated.
Thanks,

any possible work around for this scenario on 10.2.0.4
--thanks                                                                                                                                                                                               

Similar Messages

  • Creating Local partitioned index on Range-Partitioned table.

    Hi All,
    Database Version: Oracle 8i
    OS Platform: Solaris
    I need to create Local-Partitioned index on a column in Range-Partitioned table having 8 million records, is there any way to perform it in fastest way.
    I think we can use Nologging, Parallel, Unrecoverable options.
    But while considering Undo and Redo also mainly time required to perform this activity....Which is the best method ?
    Please guide me to perform it in fastest way and also online !!!
    -Yasser

    YasserRACDBA wrote:
    3. CREATE INDEX CSB_CLIENT_CODE ON CS_BILLING (CLIENT_CODE) LOCAL
    NOLOGGING PARALLEL (DEGREE 14) online;
    4. Analyze the table with cascade option.
    Do you think this is the only method to perform operation in fastest way? As table contain 8 million records and its production database.Yasser,
    if all partitions should go to the same tablespace then you don't need to specify it for each partition.
    In addition you could use the "COMPUTE STATISTICS" clause then you don't need to analyze, if you want to do it only because of the added index.
    If you want to do it separately, then analyze only the index. Of course, if you want to analyze the table, too, your approach is fine.
    So this is how the statement could look like:
    CREATE INDEX CSB_CLIENT_CODE ON CS_BILLING (CLIENT_CODE) TABLESPACE CS_BILLING LOCAL NOLOGGING PARALLEL (DEGREE 14) ONLINE COMPUTE STATISTICS;
    If this operation exceeds particular time window....can i kill the process?...What worst will happen if i kill this process?Killing an ONLINE operation is a bit of a mess... You're already quite on the edge (parallel, online, possibly compute statistics) with this statement. The ONLINE operation creates an IOT table to record the changes to the underlying table during the build operation. All these things need to be cleaned up if the operation fails or the process dies/gets killed. This cleanup is supposed to be performed by the SMON process if I remember correctly. I remember that I once ran into trouble in 8i after such an operation failed, may be I got even an ORA-00600 when I tried to access the table afterwards.
    It's not unlikely that your 8.1.7.2 makes your worries with this kind of statement, so be prepared.
    How much time it may take? (Just to be on safer side)The time it takes to scan the whole table (if the information can't read from another index), the sorting operation, plus writing the segment, plus any wait time due to concurrent DML / locks, plus the time to process the table that holds the changes that were done to the table while building the index.
    You can try to run an EXPLAIN PLAN on your create index statement which will give you a cost indication if you're using the cost based optimizer.
    Please suggest me if any other way exists to perform in fastest way.Since you will need to sort 8 million rows, if you have sufficient memory you could bump up the SORT_AREA_SIZE for your session temporarily to sort as much as possible in RAM.
    -- Use e.g. 100000000 to allow a 100M SORT_AREA_SIZE
    ALTER SESSION SET SORT_AREA_SIZE = <something_large>;
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • List-range partition

    Hi Oracle Gurus,
    I have a table with list partition, as the partitions are growing large I need to create subpartitions.
    Is it possible to create a range subpartition under list partition. If yes I need that subpartition to be built on time not on date.
    Is it possible.

    While range-list partitioning exists in 10g, list-range partitioning to the best of my knowledge does not exist. There are some new options in 11g but I can't remember what they are off the top of my head. You can check the on-line documentation to see what your partitioning options are
    Your partitioning options will depend on what version of Oracle you are using. Also remember that you need the licence to use the partitioning feature

  • Non-Partitioned Global Index on Range-Partitioned Table.

    Hi All,
    Is it possible to create Non-Partitioned Global Index on Range-Partitioned Table?
    We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
    Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
    Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
    Please help me in identifying other 3 indexes types by referring below ouputs!!!
    select INDEX_NAME,TABLE_NAME,PARTITIONING_TYPE,LOCALITY from dba_part_indexes where TABLE_NAME='CS_BILLING';
    INDEX_NAME TABLE_NAME PARTITI LOCALI
    CSB_CLIENT_CODE CS_BILLING RANGE LOCAL
    select index_name,index_type,table_name,table_type,PARTITIONED from dba_indexes where table_name='CS_BILLING';
    INDEX_NAME INDEX_TYPE TABLE_NAME TABLE_TYPE PAR
    CSB_CREATE_DATE NORMAL CS_BILLING TABLE NO
    CSB_SUBMIT_ORDER NORMAL CS_BILLING TABLE NO
    CSB_CLIENT_CODE NORMAL CS_BILLING TABLE YES
    CSB_ORDER_NBR NORMAL CS_BILLING TABLE NO
    select INDEX_OWNER,INDEX_NAME,TABLE_NAME,COLUMN_NAME from dba_ind_columns where TABLE_NAME='CS_BILLING';
    INDEX_OWNER INDEX_NAME TABLE_NAME COLUMN_NAME
    RPADMIN CSB_CREATE_DATE CS_BILLING CREATE_DATE
    RPADMIN CSB_SUBMIT_ORDER CS_BILLING SUBMIT_TO_INVOICE
    RPADMIN CSB_SUBMIT_ORDER CS_BILLING ORDER_NBR
    RPADMIN CSB_CLIENT_CODE CS_BILLING CLIENT_CODE
    RPADMIN CSB_ORDER_NBR CS_BILLING ORDER_NBR
    select dip.index_name, dpi.locality, dip.partition_name, dip.status
    from dba_part_indexes dpi, dba_ind_partitions dip
    where dpi.table_name ='CS_BILLING'
    and dpi.index_name = dip.index_name;
    INDEX_NAME LOCALI PARTITION_NAME STATUS
    CSB_CLIENT_CODE LOCAL CSB_2006_4Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2006_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_1Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_2Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_4Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_1Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_2Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_4Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_1Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_2Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_4Q USABLE
    select * from dba_part_indexes
    where table_name ='CS_BILLING'
    and locality = 'GLOBAL';
    no rows selected
    -Yasser
    Edited by: YasserRACDBA on Mar 5, 2009 11:45 PM

    Yaseer,
    Is it possible to create Non-Partitioned and Global Index on Range-Partitioned Table?
    Yes
    We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
    Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
    You got local index and 3 non-partitioned "NORMAL" b-tree tyep indexes
    Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
    Above staement will create non-partitioned index
    Here is an example of creating global partitioned indexes
    CREATE INDEX month_ix ON sales(sales_month)
       GLOBAL PARTITION BY RANGE(sales_month)
          (PARTITION pm1_ix VALUES LESS THAN (2)
           PARTITION pm2_ix VALUES LESS THAN (3)
           PARTITION pm3_ix VALUES LESS THAN (4)
            PARTITION pm12_ix VALUES LESS THAN (MAXVALUE));Regards

  • How to see the logic in an existing range partition table of a database.

    Hi I need to see the logic used in a Range partitioned table in a database.
    I need this because i need to create a db similar to this.
    This is a live database.
    Version used :10.2.0.3.0
    How can i seee this
    Cheers,
    Kunwar

    How to get that.
    For example if i want to see the script for a table. I get this eror
    SQL> select dbms_metadata.get_ddl('TABLE','x) from dual;
    ERROR:
    ORA-31603: object "x" of type TABLE not found in schema "SYS"
    ORA-06512: at "SYS.DBMS_METADATA", line 1546
    ORA-06512: at "SYS.DBMS_METADATA", line 1583
    ORA-06512: at "SYS.DBMS_METADATA", line 1901
    ORA-06512: at "SYS.DBMS_METADATA", line 2792
    ORA-06512: at "SYS.DBMS_METADATA", line 4333
    ORA-06512: at line 1
    And i dont know the login details of that user..

  • TIMESTAMP(6) Partitioned Key -   Range partitioned table ddl needed

    What is DDL syntax for TIMESTAMP(6) Partitioned Key, Range partitioned table
    Edited by: oracletune on Jan 11, 2013 10:26 AM

    >
    What is DDL syntax for TIMESTAMP(6) Partitioned Key, Range partitioned table
    >
    Not sure what you are asking. Are you asking how to create a partitioned table using a TIMESTAMP(6) column for the key?
    CREATE TABLE TEST1
        USERID                 NUMBER,
        ENTRYCREATEDDATE     TIMESTAMP(6)
    PARTITION BY RANGE (ENTRYCREATEDDATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
        PARTITION P0 VALUES LESS THAN (TO_DATE('1-1-2013', 'DD-MM-YYYY'))
    )See my reply Posted: Jan 10, 2013 9:56 PM if you need to do it on a TIMESTAMP with TIME ZONE column. You need to add a virtual column.
    Creating range paritions automatically

  • Alter range partition table to Interval partitioning table.

    Hi DBA's,
    I have a very big range partitioned table.
    Recently we have upgraded our database to 11gR2 which has a feautre called interval partitioning.
    Now i want to modify that existing range partitioned table to Interval Partitioning.
    can we alter the range partitioned table to interval partitioning table?
    I googled for the syntax but i didn't find it, can any one help[ me out on this?
    Thanks.

    If you ignore the "alter session set NLS_CALENDAR=PERSIAN;" during create/alter, everything else seems to work.
    When you set the "alter session..." during inserts, the rows gets inserted into the correct partitions.
    Only thing is when you look at HIGH_VALUE, you need to convert from the default GREGORIAN to PERSIAN.

  • When to create index on partitioned table ?

    Hi,
    The original table TEST1 contain one index called INDX_HIREDATE on field HIREDATE
    CREATE TABLE TEST1(
    COD NUMBER PRIMARY KEY,
    HIREDATE DATE);
    CREATE INDEX INDX_HIREDATE ON TEST1 (HIREDATE);
    I created a example partitioned table as below:
    CREATE TABLE TEST2_PART(
    COD NUMBER PRIMARY KEY,
    HIREDATE DATE)
    PARTITION BY RANGE (HIREDATE)(
    PARTITION P2003 VALUES LESS THAN (TO_DATE('01/01/2004','DD/MM/YYYY')),
    PARTITION P2004 VALUES LESS THAN (TO_DATE('01/01/2005','DD/MM/YYYY')),
    PARTITION P3000 VALUES LESS THAN (MAXVALUE));
    INSERT /*+ APPEND */ INTO TEST2 SELECT * FROM TEST1;
    Questions:
    Need i to create the index on TEST2 table the same way done on the TEST1 table?
    ex: CREATE INDEX INDX_HIREDATE ON TEST2 (HIREDATE);
    or have i need to create the global/local index on each partition?
    The Primary Key index is a global for partitions??
    What is the best way?
    Thanks

    Index creation on partitioned tables is similar to the non-partitioned tables. There is no special syntax unless you need to create LOCAL indexes. For creating local indexes, add LOCAL key word at the end of the "create index...." command.
    To create local primary key index you may need to use different syntax the one used in your create table command. Refer to SQL Reference manual for actual syntax. (remember manuals are the best place for getting quick answers). All the manuals are available online (at otn.oracle.com).

  • Create a GPT partition table and format with a large volume (solved)

    Hello,
    I'm having trouble creating a GPT partition table for a large volume (~6T). It is a RAID 5 (hardware) with 3 hard disk drives having a size of 3T each (thus the resulting 6T volume).
    I tried creating a GPT partition table with gdisk but it just fails at creating it, stopping here (I've let it run for like 3 hours...):
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/md126.
    I also tried with parted but I get the same result. Out of luck, I created a GPT partition table from Windows 7 and  2 NTFS partitions (15G and the rest of space for the other) and it worked just fine. I then tried to format the 15G partition as ext4 but, as for gdisk, mkfs.ext4 will just never stop.
    Some information:
    fdisk -l
    Disk /dev/sda: 256.1 GB, 256060514304 bytes, 500118192 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0xd9a6c0f5
    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 104861695 52429824 83 Linux
    /dev/sda2 104861696 466567167 180852736 83 Linux
    /dev/sda3 466567168 500117503 16775168 82 Linux swap / Solaris
    Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes, 5860533168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk label type: dos
    Disk identifier: 0x00000000
    Device Boot Start End Blocks Id System
    /dev/sdb1 1 4294967295 2147483647+ ee GPT
    Partition 1 does not start on physical sector boundary.
    Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes, 5860533168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk /dev/sdd: 3000.6 GB, 3000592982016 bytes, 5860533168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk label type: dos
    Disk identifier: 0x00000000
    Device Boot Start End Blocks Id System
    /dev/sdd1 1 4294967295 2147483647+ ee GPT
    Partition 1 does not start on physical sector boundary.
    Disk /dev/sde: 320.1 GB, 320072933376 bytes, 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x5ffb31fc
    Device Boot Start End Blocks Id System
    /dev/sde1 * 2048 625139711 312568832 7 HPFS/NTFS/exFAT
    Disk /dev/md126: 6001.1 GB, 6001143054336 bytes, 11720982528 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 65536 bytes / 131072 bytes
    Disk label type: dos
    Disk identifier: 0x00000000
    Device Boot Start End Blocks Id System
    /dev/md126p1 1 4294967295 2147483647+ ee GPT
    Partition 1 does not start on physical sector boundary.
    WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
    gdisk -l on my RAID volume (/dev/md126):
    GPT fdisk (gdisk) version 0.8.7
    Partition table scan:
    MBR: protective
    BSD: not present
    APM: not present
    GPT: present
    Found valid GPT with protective MBR; using GPT.
    Disk /dev/md126: 11720982528 sectors, 5.5 TiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 8E7D03F1-8C3A-4FE6-B7BA-502D168E87D1
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 11720982494
    Partitions will be aligned on 8-sector boundaries
    Total free space is 6077 sectors (3.0 MiB)
    Number Start (sector) End (sector) Size Code Name
    1 34 262177 128.0 MiB 0C01 Microsoft reserved part
    2 264192 33032191 15.6 GiB 0700 Basic data partition
    3 33032192 11720978431 5.4 TiB 0700 Basic data partition
    To make things clear: sda is an SSD on which Archlinux has been freshly installed (sda1 for root, sda2 for home, sda3 for swap), sde is a hard disk drive having Windows 7 installed on it. My goal with the 15G partition is to format it so I can mount /var on the HDD rather than on the SSD. The large volume will be for storage.
    So if anyone has any suggestion that would help me out with this, I'd be glad to read.
    Cheers
    Last edited by Rolinh (2013-08-16 11:16:21)

    Well, I finally decided to use a software RAID as I will not share this partition with Windows anyway and it seems a better choice than the fake RAID.
    Therefore, I used the mdadm utility to create my RAID 5:
    # mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1
    # mkfs.ext4 -v -m .1 -b 4096 -E stride=32,stripe-width=64 /dev/md0
    It works like a charm.

  • Oracle 11g  List - Range Partition - Help Needed

    Hi All,
    I want to create a composite partition (LIST-RANGE) but RANGE partition should using interval partition
    This is my query .
    CREATE TABLE "DMSDB"."DEVICE_UTILS"
    (     "ULID" VARCHAR2(100 CHAR),
         "IP_ADDRESS" VARCHAR2(24 CHAR),
         "PORT" VARCHAR2(8 CHAR),
         "SHUTDOWN" NUMBER(10,0),
         "LINE_TYPE" NUMBER(10,0) DEFAULT '0',
         "OCCUPIED" NUMBER(10,0),
         "UTILIZATION" NUMBER(10,0),
         "IDLE_TIME" VARCHAR2(32 CHAR),
         "ACTIVATION_TIME" VARCHAR2(32 CHAR),
         "PULLED_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
         "ACCESS_TIME" TIMESTAMP (6) DEFAULT SYSDATE
    PARTITION BY LIST(ULID)
              PARTITION PART_DEVUTILS_ULID VALUES (DEFAULT)
         SUBPARTITION BY RANGE( PULLED_DATE)
         PARTITION PART_DEVUTILS_WEEK INTERVAL (NUMTOYMINTERVAL(1,'WEEK'))
    Somehow its not working. can you please suggest where i am making mistake?

    Interval partitioning is not supported at the subpartition level.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_7002.htm#BABCDDIA
    Regards
    Girish Sharma

  • Unique key on range-partitioned table

    Hi,
    We are using a composite range-hash interval partitioned table
    Uses index - trying to make this have same tablespace as the partitions i.e. local but not liking it
    alter table RETAILER_TRANSACTION_COMP_POR
    add constraint RETAILER_TRANSACTION_COMP_PK primary key (DWH_NUM)
    using index
    LOCAL
    ora-14039: partitioning columns must form a subset of key columns of a unique index
    Without local then fine but doesn't have same tablespace as the partitions and don't want to make this part of partition key.
    Tbale range partitioned - this is just a UK to prevent duplicates

    [oracle@localhost ~]$ oerr ora 14039
    14039, 00000, "partitioning columns must form a subset of key columns of a UNIQUE index"
    // *Cause:  User attempted to create a UNIQUE partitioned index whose
    //          partitioning columns do not form a subset of its key columns
    //          which is illegal
    // *Action: If the user, indeed, desired to create an index whose
    //          partitioning columns do not form a subset of its key columns,
    //          it must be created as non-UNIQUE; otherwise, correct the
    //          list of key and/or partitioning columns to ensure that the index'
    //          partitioning columns form a subset of its key columns

  • Partition Pruning on Interval Range Partitioned Table not happening when SYSDATE used in Where Clause

    We have tables that are interval range partitioned on a DATE column, with a partition for each day - all very standard and straight out of Oracle doc.
    A 3rd party application queries the tables to find number of rows based on date range that is on the column used for the partition key.
    This application uses date range specified relative to current date - i.e. for last two days would be "..startdate > SYSDATE -2 " - but partition pruning does not take place and the explain plan shows that every partition is included.
    By presenting the query using the date in a variable partition pruning does table place, and query obviously performs much better.
    DB is 11.2.0.3 on RHEL6, and default parameters set - i.e. nothing changed that would influence optimizer behavior to something unusual.
    I can't work out why this would be so. It very easy to reproduce with simple test case below.
    I'd be very interested to hear any thoughts on why it is this way and whether anything can be done to permit the partition pruning to work with a query including SYSDATE as it would be difficult to get the application code changed.
    Furthermore to make a case to change the code I would need an explanation of why querying using SYSDATE is not good practice, and I don't know of any such information.
    1) Create simple partitioned table
    CREATETABLE part_test
       (id                      NUMBER NOT NULL,
        starttime               DATE NOT NULL,
        CONSTRAINT pk_part_test PRIMARY KEY (id))
    PARTITION BY RANGE (starttime) INTERVAL (NUMTODSINTERVAL(1,'day')) (PARTITION p0 VALUES LESS THAN (TO_DATE('01-01-2013','DD-MM-YYYY')));
    2) Populate table 1million rows spread between 10 partitions
    BEGIN
        FOR i IN 1..1000000
        LOOP
            INSERT INTO part_test (id, starttime) VALUES (i, SYSDATE - DBMS_RANDOM.value(low => 1, high => 10));
        END LOOP;
    END;
    EXEC dbms_stats.gather_table_stats('SUPER_CONF','PART_TEST');
    3) Query the Table for data from last 2 days using SYSDATE in clause
    EXPLAIN PLAN FOR
    SELECT  count(*)
    FROM    part_test
    WHERE   starttime >= SYSDATE - 2;
    | Id  | Operation                 | Name      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |           |     1 |     8 |  7895  (1)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |           |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|           |   111K|   867K|  7895   (1)| 00:00:01 |   KEY |1048575|
    |*  3 |    TABLE ACCESS FULL      | PART_TEST |   111K|   867K|  7895   (1)| 00:00:01 |   KEY |1048575|
    Predicate Information (identified by operation id):
       3 - filter("STARTTIME">=SYSDATE@!-2)
    4) Now do the same query but with SYSDATE - 2 presented as a literal value.
    This query returns the same answer but very different cost.
    EXPLAIN PLAN FOR
    SELECT count(*)
    FROM part_test
    WHERE starttime >= (to_date('23122013:0950','DDMMYYYY:HH24MI'))-2;
    | Id  | Operation                 | Name      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |           |     1 |     8 |   131  (0)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |           |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|           |   111K|   867K|   131   (0)| 00:00:01 |   356 |1048575|
    |*  3 |    TABLE ACCESS FULL      | PART_TEST |   111K|   867K|   131   (0)| 00:00:01 |   356 |1048575|
    Predicate Information (identified by operation id):
       3 - filter("STARTTIME">=TO_DATE(' 2013-12-21 09:50:00', 'syyyy-mm-dd hh24:mi:ss'))
    thanks in anticipation
    Jim

    As Jonathan has already pointed out there are situations where the CBO knows that partition pruning will occur but is unable to identify those partitions at parse time. The CBO will then use a dynamic pruning which means determine the partitions to eliminate dynamically at run time. This is why you see the KEY information instead of a known partition number. This is to occur mainly when you compare a function to your partition key i.e. where partition_key = function. And SYSDATE is a function. For the other bizarre PSTOP number (1048575) see this blog
    http://hourim.wordpress.com/2013/11/08/interval-partitioning-and-pstop-in-execution-plan/
    Best regards
    Mohamed Houri

  • Problem when creating list box in table control

    Hi every body ,
                      I am placing a list box in table control ,  the list box is coming perfectly but
    when I am scrolling  or pressing enter the data in that field is clearing.
       if I remove the list box , and i enter the data directly and scrolling or press enter
    the data is not clearing.
    But only for list box only it is be having like that
    what is the problem?
      the code is as follows
    *{   INSERT         DEVK935807                                        1
    *&      Module  glaccuontlist  INPUT
          text
    module glaccuontlist input.
    type-pools vrm.
    tables: zglaccount.
    data:
            name  type vrm_id,
            list  type vrm_values,
            value like line of list.
           clear:value.
           refresh: list.
            name = 'ACGL_ITEM-HKONT'.
            select * from zglaccount.
             value-key = sy-dbcnt.
             value-text = zglaccount-hkont.
             append value to list.
             clear value.
            endselect.
          call function 'VRM_SET_VALUES'
            exporting
              id                    = name
              values                = list
          EXCEPTIONS
            ID_ILLEGAL_NAME       = 1
            OTHERS                = 2
          if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          endif.
    endmodule.                 " glaccuontlist  INPUT
    *}   INSERT
    thanks in advance.\
    srinivas.

    Hi srinivasa,
    try it.
    select * from zglaccount.
    <b>value-key = zglaccount-hkont.</b>
    value-text = zglaccount-hkont.
    append value to list.
    clear value.
    endselect.
    Regards
    Allan Cristian

  • List-range partition and subpartition

    Does anyone know that Oracle 10g support partition by list and subpartition by range? Thanks.

    check the documentation link [http://download.oracle.com/docs/cd/B19306_01/appdev.102/b31695/dialogs.htm#sthref441]
    hope you will find your answer on link page.

  • Trying to convert Interval Partitioned Table to Range..Exchange Partition..

    Requirement:
    Replace Interval partitioned Table by Range Partitioned Table
    DROP TABLE A;
    CREATE TABLE A
       a              NUMBER,
       CreationDate   DATE
    PARTITION BY RANGE (CreationDate)
       INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
       (PARTITION P_FIRST
           VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'));
    INSERT INTO A
         VALUES (1, SYSDATE);
    INSERT INTO A
         VALUES (1, SYSDATE - 30);
    INSERT INTO A
         VALUES (1, SYSDATE - 60);I need to change this Interval Partitioned Table to a Range Partitioned Table. Can I do it using EXCHANGE PARTITION. As if I use the conventional way of creating another Range Partitioned table and then :
    DROP TABLE A_Range
    CREATE TABLE A_Range
    a NUMBER,
    CreationDate DATE
    PARTITION BY RANGE (CreationDate)
       (partition MAX values less than (MAXVALUE));
    Insert  /*+ append */  into A_Range Select * from A; --This Step takes very very long..Trying to cut it short using Exchange Partition.Problems:
    I can't do
    ALTER TABLE A_Range
      EXCHANGE PARTITION MAX
      WITH TABLE A
      WITHOUT VALIDATION;
    ORA-14095: ALTER TABLE EXCHANGE requires a non-partitioned, non-clustered table
    This is because both the tables are partitioned. So it does not allow me.
    If I do instead :
    create a non partitioned table for exchanging the data through partition.
      Create Table A_Temp as Select * from A;
       ALTER TABLE A_Range
      EXCHANGE PARTITION MAX
      WITH TABLE A_TEMP
      WITHOUT VALIDATION;
      select count(*) from A_Range partition(MAX);
    -Problem is that all the data goes into MAX Partition.
    Even after creating a lot of partitions by Splitting Partitions, still the data is in MAX Partition only.
    So:
    -- Is it that we can't Replace an Interval Partitioned Table by Range Partitioned Table using EXCHANGE PARTITION. i.e. We will have to do Insert into..
    -- We can do it but I am missing something over here.
    -- If all the data is in MAX Partition because of "WITHOUT VALIDATION" , can we make it be redistributed in the right kind of range partitions.

    You will need to pre-create the partitions in a_range, then exchange them one by one from a to a tmp then then to arange. Using your sample (thanks for proviing the code by the way).
    SQL> CREATE TABLE A
      2  (
      3     a              NUMBER,
      4     CreationDate   DATE
      5  )
      6  PARTITION BY RANGE (CreationDate)
      7     INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
      8     (PARTITION P_FIRST
      9         VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'));
    Table created.
    SQL> INSERT INTO A VALUES (1, SYSDATE);
    1 row created.
    SQL> INSERT INTO A VALUES (1, SYSDATE - 30);
    1 row created.
    SQL> INSERT INTO A VALUES (1, SYSDATE - 60);
    1 row created.
    SQL> commit;
    Commit complete.You can find the existing partitions form a using:
    SQL> select table_name, partition_name, high_value
      2  from user_tab_partitions
      3  where table_name = 'A';
    TABLE_NAME PARTITION_NAME HIGH_VALUE
    A          P_FIRST        TO_DATE(' 2001-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
    A          SYS_P44        TO_DATE(' 2013-01-28 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
    A          SYS_P45        TO_DATE(' 2012-12-29 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
    A          SYS_P46        TO_DATE(' 2012-11-29 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAYou can then create table a_range with the apporopriate partitions. Note that you may need to create additional partitions in a_range because interval partitioning does not create partitions that it has no data for, even if that leaves "holes" in the partitioning scheme. So, based on the above:
    SQL> CREATE TABLE A_Range (
      2     a NUMBER,
      3     CreationDate DATE)
      4  PARTITION BY RANGE (CreationDate)
      5     (partition Nov_2012 values less than (to_date('30-nov-2012', 'dd-mon-yyyy')),
      6      partition Dec_2012 values less than (to_date('31-dec-2012', 'dd-mon-yyyy')),
      7      partition Jan_2013 values less than (to_date('31-jan-2013', 'dd-mon-yyyy')),
      8      partition MAX values less than (MAXVALUE));
    Table created.Now, create a plain table to use in the exchanges:
    SQL> CREATE TABLE A_tmp (
      2     a              NUMBER,
      3     CreationDate   DATE);
    Table created.and exchange all of the partitions:
    SQL> ALTER TABLE A
      2    EXCHANGE PARTITION sys_p44
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A_Range
      2    EXCHANGE PARTITION jan_2013
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A
      2    EXCHANGE PARTITION sys_p45
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A_Range
      2    EXCHANGE PARTITION dec_2012
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A
      2    EXCHANGE PARTITION sys_p46
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A_Range
      2    EXCHANGE PARTITION nov_2012
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> select * from a;
    no rows selected
    SQL> select * from a_range;
             A CREATIOND
             1 23-NOV-12
             1 23-DEC-12
             1 22-JAN-13John

Maybe you are looking for

  • SAP ISA R/3 Edition problem with TREX

    Hi! We are migration our Internet Sales (R/3 Edition) 4.0 with SAP J2EE Engine 6.20 to SAP J2EE Engine 6.40. We’ve already migrate your Java Basket data. And we’ve installed TREX 6.1 for catalogue replication and we’ve created a WEB SITE in IIS. We’v

  • Is there a way to change a volume license to individual license?

    I've recently upgrade all 11 of our licenses from CS5.5 to CS6, the boxed licenses worked no probs but the volume license did not. After chatting to support they informed me that the volume license will have to be upgraded by that department and the

  • Upgraded to iTunes 11.0.5.5 - showing music covers instead of movie covers in Movies tab

    I am running Vista on a PC - upgraded to iTunes 11.0.5.5 & now have a music album cover in the movies tab where one of my movies should be.  Click on the album tab & the movie cover shows - click to play & you get the music.  How do I restore each to

  • How to fetch invoice details based on service notification

    Hello,       How to fetch the invoice deatils for a service quotation. Wat are the tables used for this purpose. Thanks in advance. Regards, Umasankar.

  • VOFM Copying Routines

    Hi, I have 2 requirements - firstly where sales orders should not be combined into a delivery for a particular Special Processing Indicator value ( VBKD - SDABW ), i.e, seperate deliveries should be created. The 2nd requirement is for delivery split