List-partition wall

Hello

I need to split a partition list in my table in two recording.

I want to divide the partition "PRT_TEST_02_03" as follows:

Value of 2 should go in PRT_TEST_02

and

Value 3 should go in PRT_TEST_03

But I always get an error message... I don't know why!

DROP TABLE TEST_TO_SPLIT

/

CREATE TABLE TEST_TO_SPLIT

(id NUMBER

, grp NUMBER (3)

, text VARCHAR2 (100)

)

TABLESPACE ALL_DATA

LIST BY SCORE (grp)

(PARTITION PRT_TEST_01 VALUES (1),

PARTITION PRT_TEST_02_03 VALUES (2, 3),

PRT_TEST_04_07 PARTITION VALUES (4, 5, 6, 7)

)

/

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (1, 1, 'a');

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (2, 1, 'b');

INSERT INTO TEST_TO_SPLIT (id, grp, text) VALUES (3, 2, 'c');

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (4, 3, ');

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (5, 3, 'e');

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (6, 4, 'f');

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (7, 5, 'g');

INSERT INTO TEST_TO_SPLIT (id, grp, text) VALUES (8, 6, 'h');

INSERT IN TEST_TO_SPLIT (id, grp, text) VALUES (9, 7, 'i');

COMMIT;

ALTER TABLE TEST_TO_SPLIT SPLIT PARTITION PRT_TEST_02_03 VALUES (2, 3) INTO (PARTITION, PARTITION PRT_TEST_03 PRT_TEST_02)

/

Connected to:

Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

With partitioning, OLAP, Data Mining and Real Application Testing options

ALTER TABLE TEST_TO_SPLIT SPLIT PARTITION PRT_TEST_02_03 VALUES (2, 3) INTO (PARTITION, PARTITION PRT_TEST_03 PRT_TEST_02)

*

ERROR on line 1:

ORA-14314: resulting list partitions must contain at least 1 value

SQL >

Could you please tell me what I'm doing wrong?

Thanks in advance!

Hello Adme12

Yes... Let's not your syntax.

Try this:

ALTER TABLE TEST_TO_SPLIT SPLIT PARTITION PRT_TEST_02_03 VALUES (2) INTO (PARTITION, PARTITION PRT_TEST_03 PRT_TEST_02)

;

Select grp, COUNT (*) from PARTITION (PRT_TEST_02) GROUP BY grp test_to_split

UNION ALL

Select grp, COUNT (*) from PARTITION (PRT_TEST_03) GROUP BY grp test_to_split

;

In this case, the value 2 will be maped on the partition of PRT_TEST_02 and the remaining values in the original PRT_TEST_02_03 - in this case, the 3 - partition will be mapped to PRT_TEST_03!

I hope this helps you!

Tags: Database

Similar Questions

  • Adding new LIST partition

    Hi all

    I'm using Oracle 11 g R2 and have an existing table with 3-list of Partitions.

    CREATE TABLE parts_tbl
    (id char(10),
    name varchar2 (500),
    Type number
    )
    PARTITION OF List (type)
    (PARTITION part_t1 VALUES (1),)
    PARTITION part_t2 VALUES (2),
    PARTITION part_t3 VALUES (3)
    );

    Is it possible to ALTER the table to add a new partition to list value of 4?

    Thank you
    Vivek

    Hello

    Yes, like this:

    ALTER TABLE parts_tbl ADD PARTITION part_t4 VALUES (4);
    

    Kind regards.
    Al

  • list partitioning

    Hi all

    I need to create a table with partitions in the list. The number of partitions is quite high (about 750).

    I have several questions to which I have not found in the documentation Oracle:

    1. is there a limit in the number of partitions in the list?
    2. How can I retrieve the data dictionary that the values are related to the specific partition
    3. how much time does it take to merge or split a partition (partition may contain a hundred thousand or even a few million rows)

    Thank you
    Gabor

    csiszgab wrote:

    1. is there a limit in the number of partitions in the list?

    Maximum number of partitions allowed per table or index is 1024K - 1 (if you are 10.1 or old limit is 64 k - 1). See the limits of the logical database

    2. How can I retrieve the data dictionary that the values are related to the specific partition

    SELECT  PARTITION_NAME,
            HIGH_VALUE
      FROM  USER_TAB_PARTITIONS
      WHERE TABLE_NAME = 'partitioned-table-name';
    

    3. how much time does it take to merge or split a partition (partition may contain a hundred thousand or even a few million lines

    You have to do to find, but not too long. Although it depends on if you include the index and whether or not the table is used. Also check optimize SPLIT PARTITION and SUBPARTITION SPLIT operations

    SY.

  • Request Cross-listing (Partition by Clause? Self-join?)

    Hello

    I need a query that cross-list will be a teacher teaches this semester of courses. Essentially, both fields must be the same (i.e.: CourseTitle & Section), while the third field is different (for example: subject).

    For example, Max Power is a Professor teaching the 3 course, one co-inscrit (123 ENG and JRL 123):
    LastName     FirstName     Subject     Section     CourseTitle
    Power          Max          ENG     123     English Composition
    Power          Max          ENG     452     Robert Frost Poetry     
    Power          Max          JRL     123     English Composition
    Power           Max          ENG      300     Faulkner & Twain
    The result of the desired query is:
    LastName     FirstName     Subject     Section     CourseTitle
    Power          Max          ENG     123     English Composition
    Power          Max          JRL     123     English Composition
    Basically, I don't need that the courses co-inscrit in the output. Is this an instance where I use a "Partition by Clause' or should I create a self-join?

    Well thanks for all help and comments.

    Hello

    user11137889 wrote:
    Unfortunately, I can't create tables. I don't have permission. I can't modify, add or remove all the data.

    It is no possible to work! You should have your own schema in a database of development, perhaps on your own machine, where you can create tables freely. You can develop or test software effectively without this ability.
    You must post CREATE TABLE and INSERT to your sample data, even if you can't test. Without this, all anyone can do is guess.

    If you want to only count each topic once, then replace COUNT (*) by COUNT (DISTINCT subject). Here, 'subject' can be almost any kind of expression, for example:

    count( DISTINCT substr ( ssbsect_ptrm_code
                            , 1
                     , 1
                     )
         ) over ( partition by  ssbsect_crse_numb
                      ,          scbcrse_title
             ) cnt
    
  • List partition

    Hi all
    I would like to know if NULL and NOT NULL value are possible for a partition in the list.
    Can someone help me?

    Steve

    Hello

    The doc is here for you:
    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2129255]

  • PARTITION OF HASH ON LIST

    version: Oracle 10g

    Hi all
          i have a table partitioned by hash(8 segments) with 200 millions records . now we want to move to list partition the same table by state.
          Is there a way to drop hash Partitions with out losing the data, and Add list partition.
         
         

    No, you can't 'convert' hash Partitions to list of Partitions.

    You must create an empty table that is partitioned from the list and then hover over the data to the new table.
    You can use Direct path Insert (i.e. INSERT with APPEND tip) with degree PARALLEL and NOLOGGING on the target table to speed up the copy.
    You can also use DBMS_REDEFINITION to migrate the data.
    In both cases, you must also create the index on the new table.

    Hemant K Collette

  • PARTITION-level statistics under

    How do you define statistics to score high school level?
    We are running Oracle 11 g R2 and you want statistics to simulate different data among secondary distributions in the walls.
    Essentially, we want to control/change the "NUM_ROWS" to fool the optimizer to think that there are more or less lines.

    We went through the DBMS_STATS subprograms
    DBMS_STATS. GET_TABLE_STATS
    DBMS_STATS. SET_TABLE_STATS
    Two of these subprogrammes appear to be able to go to the subpartition to the deepest level.

    We can determine the statistics (NUM_ROWS) for secondary partitions by querying the DBA_TAB_SUBPARTITIONS table NUM_ROWS column.
    AFTER the parsed table.
    But we have not found a way to PUT the statistics in the table at the level of secondary partition.

    We work in a VLDB and using the RANGE-LIST partitioning for our big tables.

    Published by: user10260925 on February 20, 2011 09:02

    Published by: user10260925 on February 20, 2011 09:02

    user10260925 wrote:
    How do you define statistics to score high school level?
    We are running Oracle 11 g R2 and you want statistics to simulate different data among secondary distributions in the walls.
    Essentially, we want to control/change the "NUM_ROWS" to fool the optimizer to think that there are more or less lines.

    We went through the DBMS_STATS subprograms
    DBMS_STATS. GET_TABLE_STATS
    DBMS_STATS. SET_TABLE_STATS
    Two of these subprogrammes appear to be able to go to the subpartition to the deepest level.

    We can determine the statistics (NUM_ROWS) for secondary partitions by querying the DBA_TAB_SUBPARTITIONS table NUM_ROWS column.
    AFTER the parsed table.
    But we have not found a way to PUT the statistics in the table at the level of secondary partition.

    How do you use the set_table_stats procedure - it should do what you want, even if you use the parameter "partname" to provide a name of subpartition if you want to replace some stats subpartition.

    for example

    begin
         dbms_stats.set_table_stats(
              ownname      => user,
              tabname          => 'PT_RL',
              partname     => 'P_2002_FEB_CA',
              numrows          => 1000,
              numblks          => 10,
              avgrlen          => 80
         );
    end;
    /
    

    In this area, above, p_2002_feb_ca is the subpartition in the partition of a partitioned table p_2002_feb CA / ranges list.

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    A general reminder on "Forum label / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718

    If you mark never questions answers people decide later that it isn't worth trying to answer you because they never know if yes or no, their response has been of no use, or if you even bothered to read it.

    It is also important mark responses that you thought useful - again once it leaves other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching on the same issue, also means that when you mark a bad or wrong the useful answer someone can be invited to tell you (and the rest of the forum) which is so bad or wrong on the answer that you found it useful.

  • remove all the HARD drive recovery partition incl. disk partitions

    IM in the process of upgrading to vista 32-bit Ultimate edition - a Lenovo T61 laptop OS original vista home, comes with HARD 160 GB but only show 110 GB disk.
    There is the hidden for drive recovery partition. now, I've wanted this disk recovery partition removed for more space for important files of video editing.

    How can I remove this parition hidden containing the recovery disk?

    I bought the support for laptop recovery CD - I have no need of the hidden partition.

    in the process, I deleted the existing partition (not the hiiden recovery partition) and installed vista ultimate 32 and it lights without problem. I then installed
    the INF chipset utilitty downloaded from the Lenovo Web site, and then installed some drivers downloaded - and all in perfect condition smooth running.

    now, I decided to remove that hidden partition containing the disk recovery - whatever happens after that, I have the recovery CD.

    How to remove this hidden partition? TIA

    http://www.mydigitallife.info/2008/02/29/delete-and-remove-to-unlock-EISA-hidden-recovery-or-diagnostic-partition-in-Vista/

    The link above is General info re remove hidden restore partitions.

    "In some OEM system, such as IBM/Lenovo, is impossible to remove from Windows."

    This link below might be more to the point for you:

    http://Forum.NotebookReview.com/showthread.php?p=2367169

    Written by:

    Computer notebook evangelist

    Join Date: March 2007
    Messages: 437
    Reputation power: 7

    "" "This applies only to Windows Vista.

    * Make sure that you have backed up your OEM code before deleting the Rugged hidden

    The hidden restore Partition Lenovo is a protected partition, then you will not be able to remove it through disk management as you would with any other normal partition. You can use Diskpart. You can still use these steps to remove the hidden restore partition if you have already done a clean install, but you will need a 3rd party software to combine with the main partition. It is better if you remove the first hidden restore Partition, then cross with a clean install using one of the many guides available on this forum.

    Step 1.
    Burn recovery media. Type "Recovery media" (without the quotes) in the search in the Start Menu. Open the application and follow the instructions.

    Step 2.
    Open the application by typing Diskpart either 'Diskpart' (without the quotes) in the search, or type "Diskpart.exe" in run by pressing Windows key + R.

    Step 3.
    Now with open Diskpart, you must enter the following command lines:

    I. type "list disk" without the quotes and press ENTER.

    II. Type in "select disk 0" and press ENTER.

    III. then type in "list partition" and press ENTER.

    IV. then type in 'select partition x' x = the recovery partition you want to delete (I think it's 1, I do not remember) replace x with the number of recovery partition and press to enter.

    V. finally type in "delete partition override" and press ENTER.

    That should do the trick. Good luck!

    __________________
    T61 15.4 "

    Specific ThinkPad Vista 32/64 bit Clean Install Guide side.


    Delete Hidden Partition Lenovo's of recovery on Vista using Diskpart Guide.
    Of orev Vista Clean install and RAM Memtest module test Guides.
    The Lenovo wallpapers 1680 x 1050factory-installed.

    WARNING:
    Grain of salt applies in my view.

    See you soon. Mick Murphy - Microsoft partner

  • 2nd partition on my external hard drive does not appear in windows 7

    Hello

    I partitioned the standard hard drive of my system by partition magic. He managed. But this time my drive external hard was also plugged in the computer.

    After you restart the system, I discovered that partition 1 my disk external drive of 500 GB is accessible but 2nd 500 GB partition is not displayed in my computer. In disk management it shows but have no details and no letter. I tried to rename the letter, but got an error on disk management.

    I have seen other threads associated with this problem as using DISKPART or uninstall the driver but no help. Because after you have reinstalled the driver 1 partiton is visible but not another.

    DISKPART > list volume

    Volume # Ltr Label Fs Type size status Info
    ----------  ---  -----------  -----  ----------  -------  ---------  --------
    Volume 0 D DVD - ROM 0 B no media
    System sound volume 1 Eman NTFS Partition 100 MB
    Volume 2 C NTFS Partition 95 GB Boot sound
    Volume 3 G GB 191 healthy Partition NTFS
    Hidden volume 4 recovery NTFS Partition of 10 GB healthy
    Volume 5 E my passport NTFS Partition 465 GB healthy

    DISKPART > list disk

    Disc # status size free Dyn Gpt
    --------  -------------  -------  -------  ---  ---
    Disk 0 online 298 GB 0 B
    Online disc 1 931 GB 0 B

    DISKPART > select disk 1

    Disc 1 is now the selected disk.

    DISKPART > list partition

    Partition # type Offset size
    -------------  ----------------  -------  -------
    Partition 1 primary 465 GB 1024 KB
    Partition 2 465 primary GB 465 GB

    What should I do to access my 2nd partition?

    Hello Manu,

    I found a temporary solution to this problem. I resized the partition unknown by reducing 1 GB

    and he attributed the letter. It works fine now. But now that the partition of 1 GB is now displayed as unknown. My data was sure, my 2nd partition was not full.

  • Delete several partitions in the physical model

    Hi all

    I don't know if anyone has the same need for me, if this is maybe because I don't know how to do something which is already being implemented.

    Anyway, my question is:

    How can I remove multiple partitions (400) both from the same table in the physical model?

    I choose the partitions, but the popup does not work, I can press the button Delete in the toolbar, but don't participate in anything.

    I imported my data dictionary, a scheme with several tables that have lots of partitions and I'm not interested to save these partitions.

    When I try to generate the DDL generates all partitions and I don't want the DDL with thousands of scores on the inside.

    the number of tables with partitions is not so high but isn't comfortable to go one by one by selecting the partitions and deleting the object (400 times in one table),

    I can change the table to say that is not partitioned and all partitions will disappear but I so need to again change the table and include the fields for partitions and partition, not useful,

    Another option would be to select when importing, if I want to import only a single partition for each table

    but I do not know is at the end there just because I think only delete partitions with a single operation should be sufficient, at least for me

    Thanks in advance

    Hello

    I connected an improvement on that request.

    An approach that could help is to use the dialog box compare models to control which partitions are imported.  However, this feature is available in version 4.1 (EA1 and ai2).

    If you have something in your model before making your import (for example a fictitious Table), the dialog box compare models will be displayed after the import.

    In tree compare models, if you expand the node of a Table with partitions, it will appear a range Partitions, the node list Partitions or Partitions to hash.  If you uncheck this node, the subordinate entries for all the individual partitions will become selected, and they will not be included when you use the merge button.

    If you have many Partitioned Tables and you want to do this for all Partitions of your range (for example), you can move from tree to table in the dialog box view to compare, and then change the option SET to the range Partition Type (top-right) and then use the button to deselect all (upper-left) to deselect all Partitions of the range.

    David

  • BitMap or Partition

    Hello gurus

    I want to know if I screwed up in my interveiew :-). I think I did.

    I was asked this case you have an employee table with 100 million lines with field of sex in it to have 50% MAN and 50% of GIRLS (i.e. 50 million each). Currently, there are no indexes and partitions. the user issues a SELECT statement * OF THE KIND WHERE the EMPLOYEES = "MALE" and find it slow. Who would be the first best option for best prformance? BITMAP image index the gender OR the gender column list partition column (assuming that there is no other request on this table)?

    I originally ported to the Bitmap indexes, but changed his mind to score because in this case oracle knows where the data is located and access directly the partition, but in the case of index bitmap, oracle still has to do a scan to find which lines have MALE having the bit 1.

    A I screw up :-)?

    Thank you

    Sunny

    Hello

    It is a very good. And your response (partition) was good. Any index, bitmap or no, will never be a good idea to get 50 million lines. A comprehensive analysis of a partition that has all of the lines that we need is the best: read you each block only once, all lines in the block are the ones you are interested in, and read you them with diluvium readings.

    The case concerned the myth this bitmap index is good for poor selective columns. But it is false. And the access of the index is good only for good selectivity. The point with the bitmap index, is that you can combine them, then you can have the index bitmap on all columns, and they are effective if you combine enough columns to get good selectivity.

    Kind regards

    Franck.

  • Partitioning of reference - application always accesses all partitions

    I followed the instructions to Oracle Database 11g: new features for developers and DBAS Top | Partitioning on reference partitioning and actually tried this example. If you do not want to read the details of the example here is the SQL code of two tables:

    create table customers

    (

    cust_id key primary number.

    cust_name varchar2 (200),

    side varchar2 (1) not null

    )

    list partition (side)

    (

    values of pA score ("A"),

    pB of partition values ('B')

    );

    create table sales

    (

    sales_id number primary key,

    cust_id number not null,

    sales_amt number,

    constraint fk_sales_01

    foreign key (cust_id)

    customer references

    )

    benchmark score (fk_sales_01);

    I've added a few values:

    Insert into Z_CUSTOMERS (CUST_ID, CUST_NAME, RATING) Values (1, 'John', 'A');

    Insert into Z_CUSTOMERS (CUST_ID, CUST_NAME, RATING) Values (2, 'Ben', 'B');

    Insert into Z_SALES (SALES_ID, CUST_ID, SALES_AMT) Values (10, 1, 200);

    Insert into Z_SALES (SALES_ID, CUST_ID, SALES_AMT) Values (20, 2, 500);

    Insert into Z_SALES (SALES_ID, CUST_ID, SALES_AMT) Values (30, 2, 900);

    Insert into Z_SALES (SALES_ID, CUST_ID, SALES_AMT) Values (40, 2, 250);

    COMMIT;

    Now, my understanding of the reference partitioning power comes from the fact that I run a query such as:

    Select * from z_sales where cust_id in (select cust_id in z_customers where the rating = 'A');

    It must cover a single partition in z_sales and z_customers. However, the execution plan indicates the following:

    Plan

    SELECT STATEMENT ALL_ROWSCost: 6 bytes: 108 cardinality: 2

    6 NESTED LOOPS

    Cost 4 NESTED LOOPS: cardinality of 6 bytes: 108: 2

    2 PARTITION REFERENCES all THE cost: 4 bytes: 156 cardinality: 4 Partition #: 3 Partitions accessed #1-#2

    1 TABLE ACCESS FULL TABLE ARIBA_STAR2. Z_SALES cost: 4 bytes: 156 cardinality: 4 Partition #: 3 Partitions accessed #1-#2

    3 INDEX UNIQUE INDEX (SINGLE) ARIBA_STAR2 SCAN. SYS_C003391336 cost: cardinality 0: 1

    TABLE 5 ACCESS BY INDEX ROWID TABLE ARIBA_STAR2 OVERALL. Z_CUSTOMERS cost: 1 bytes: cardinality 15: 1 Partition #: 6 Partitions accessed #1

    Two partitions in z_sales are presented.

    In fact, I tried this on the application I support (with tables of course) and it seems to have the same problem: all partitions are accessible.

    Any ideas on what I'm doing wrong here?

    Thank you!

    You are not the full story. There is an overall index, according to the execution you plan posted. In any case, works OK for me:

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    AMT for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    SQL > explain the plan for
    2 Select * from sales where cust_id in (select cust_id from customers where the rating = 'A')
    3.

    He explained.

    SQL > select * from table (dbms_xplan.display);

    PLAN_TABLE_OUTPUT
    ---------------------------------------------------------------------------------------------------------
    Hash value of plan: 864604532

    ---------------------------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |
    ---------------------------------------------------------------------------------------------------
    |  0 | SELECT STATEMENT |           |    2.   108.    5 (0) | 00:00:01 |       |       |
    |  1.  SIMPLE LIST OF PARTITION.           |    2.   108.    5 (0) | 00:00:01 |     1.     1.
    |  2.  NESTED LOOPS |           |    2.   108.    5 (0) | 00:00:01 |       |       |
    |  3.    TABLE ACCESS FULL | CUSTOMERS |    1.    15.    3 (0) | 00:00:01 |     1.     1.
    |*  4 |    TABLE ACCESS FULL | SALES |    2.    78.    2 (0) | 00:00:01 |     1.     1.
    ---------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT
    ---------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    4 - filter ("CUST_ID" ="CUST_ID")

    Note
    -----
    -dynamic sample used for this survey (level = 2)

    20 selected lines.

    SQL >

    SY.

  • table partitioned and unique keys

    I really don't understand why Oracle does not apply in some cases, unique keys.

    Let's say I have a table

    create table t (t_type not null, t_key not null, id not null, not null value)

    list partition (t_type)

    (

    type1 partition values ('ppp1"),

    rest of partition (default) values

    ) as

    Select "ppp" | rownum, rownum, rownum, rownum of double connect by rownum < = 100;

    And following changes in the indices for unique keys

    -1

    create index idx_1 on t (t_key, id);

    ALTER table t add constraint t_uk unique (t_key) using index idx_1;

    ALTER table drop constraint t_uk drop index;

    -2

    create index idx_1 on t (t_key, id, t_type);

    ALTER table t add constraint t_uk unique (t_key) using index idx_1;

    ALTER table drop constraint t_uk drop index;

    -3

    create index idx_1 on t (t_key, id, t_type) local;

    ALTER table t add constraint t_uk unique (t_key) using index idx_1;

    Drop index idx_1;

    -4

    create an index only idx_1 on t (t_key, id);

    ALTER table t add constraint t_uk unique (t_key) using index idx_1;

    Drop index idx_1;

    -5

    create an index only idx_1 on t (t_key, id, t_type);

    ALTER table t add constraint t_uk unique (t_key) using index idx_1;

    Drop index idx_1;

    -6

    create an index only idx_1 on t (t_key, id, t_type) local;

    ALTER table t add constraint t_uk unique (t_key) using index idx_1;

    Drop index idx_1;

    -7

    create index idx_1 on t (t_key, t_type, id) local;

    ALTER table t add t_uk unique constraint (t_key, t_type) using index idx_1;

    ALTER table drop constraint t_uk drop index;

    -8

    create an index only idx_1 on t (t_key, t_type, id) local;

    ALTER table t add t_uk unique constraint (t_key, t_type) using index idx_1;

    Drop index idx_1;

    I got the set of questions:

    1. first and second cases were performed with success while 4th and 5th failed.

    The only difference is that the overall index in 4th and 5th cases are unique.

    It is unclear why ' ORA-14196: specified index cannot be used to apply the constraint. ' has occurred.

    2. in the third case index is similar to that in second place with the only difference that it is local.

    Still, it is not clear why it failed with ORA-14196.

    3 and the last question why ORA-14196 arose in 8 cases, while the 7th, it didn't.

    The only difference is the local index in 8 cases is unique.

    Thank you

    Hi Alex

    (1) index 4 and 5 cannot be used to police the unique constraint as a unique index must have the same list of column under duress. Index 4, to establish in a non-unique index or to remove the column id of the index. To index 5, you will need to make a non-unique index or remove the columns id and index t_type.

    (2) 3 index cannot be used to the unique constraint of police that it is a local index and is not partitioned column (t_type) in both the definition of index/constraint. If allowed, this would require Oracle having to visit each partition to ensure that any new value of t_key is truly unique, that would not scale. Include the t_type column in the constraint and the index to both t_type and t_key as of the columns (so move the id column 3rd position) and it would be successful.

    (Index 3) 8 fails for the same reason as in 1). It's a unique index with a different column from the constraint list. Remove the id column of the index or to make it a non-unique index and it will be successful.

    In summary, a unique index MUST have the same list of column than the constraint and a local index MUST have the partitioning columns in both the definition of index/constraint.

    See you soon

    Richard Foote

    http://richardfoote.WordPress.com/

  • partition table

    When we need to use the partition table?

    Partitioning defined

    The concept of divide and conquer has been around since the time of Sun Tzu (500 BC). Recognizing the wisdom of this concept, Oracle applied to management of large tables and indexes. Oracle has continued to evolve and refine its capabilities of partitioning since its first implementation of the Oracle 8 range partitioning. Oracle 8i and 9i, Oracle has continued to add features and new methods of partitioning. The current version of Oracle 9i Release 2 continues this tradition by adding new features to the list partitioning and partitioning method new range-list.

    When the partition

    There are two main reasons to use partitioning in an environment of VLDB (very large database). These reasons are related to improving the management and performance.

    Partitioning offers:

    • Management at the level of individual partition for data loads, creating indexes and reconstruction, and backup/restore. This may cause more quickly down, because only actively managed individual partitions are not available.
    • Performance of the queries increased by selecting only the relevant partitions. This process of weeding out the partitions that do not contain the data required by the application via a technique called the size of the partition.

    Use the partitioning:

    • When a table reaches a size "large". Large being defined according to your environment. Greater than 2 GB should always be considered for partitioning of tables.
    • What performance benefits outweigh the extra management issues related to partitioning.
    • When the archive data is on a calendar and repetitive. For example, data warehouses are usually given for a certain period of time (rolling window). Old data is then output to archive.
  • Order by in a partitioned table

    Hi all

    I recently list partitioned table. After the partition, the existing query result was completely different from that of a non-partitioned table.

    CREATE TABLE 'BALANCE_TMP '.

    ("BRANCHID" VARCHAR2 (10 CHAR) NOT NULL,)

    VARCHAR2 (1 CHAR) 'ACCOUNTTYPE' NOT NULL,

    VARCHAR2 (20 CHAR) 'ACCOUNTID' NOT NULL,

    "BUSINESSDATE" DATE NOT NULL,

    'BALANCETYPE' VARCHAR2 (1 CHAR) NOT NULL,

    ("BALANCE" NUMBER (18.3) NOT NULL)

    LIST PARTITION (BRANCHID)

    (

    PARTITION bal_100 VALUES ("100")

    PARTITION bal_101 VALUES ('101')

    PARTITION bal_102 VALUES ('102')

    );

    The query:

    SELECT * OF balance b WHERE ROWNUM < = 1 AND BranchID = '100' AND

    AccountType = 'N' AND AccountID = "100999999613USD" AND BusinessDate <= May 12, 2014 ' AND

    BalanceType = 'A' ORDER BY BusinessDate DESC

    "The account has dates of business March 12, 2003 '-may 12, 2014. The SQL above on partitioned table gives me the folder that has the date of the company March 12, 2013 "and when partitioned may 12, 2014".

    Please let me know what I'm missing here. I'm assuming that partitioning atleast, in this case, is transparent to the SQL code.

    1543042 wrote:

    The same SQL on a non-partitioned table gives me the results expected is the last album of businessdate. On the partitioned table version, it gives me a record earlier.

    I believe you. Most likely date column is indexed. Optimizer decides to use the SORTED INDEX RANGE SCAN and first rank is rank of more recent date. That's why you get the desired result. But it's only because you're lucky optimizer chose a plan where the last line is read first. It is a time bomb which had sooner or later go off.  And that's exactly what happened with the partitioned table. Optimizer realized account of the table is partitioned and probably the use parallel execution plan. Now you have several slave process every single partition handling and using the INDEX RANGE SCAN SORTED for that. So each slave will get the last row in a respective score but then master process will choose one of them when applying ROWNUM<= 1="" and="" here="" you="" are="" at="" the="" mercy="" of="" which="" row="" will="" it="" be.="" and,="" as="" you="" already="" know,="" you="" didn't="">

    SY.

Maybe you are looking for