Creating Local index on an existing partitioned table

I have an existing table partitioned by list. I'm supposed to create local indexes on this subject.

I'm using Oracle 11 g.

I have an existing table partitioned by list. I'm supposed to create local indexes on this subject.

I'm using Oracle 11 g.

The skill the MOST IMPORTANT you can learn, is at present, how to find information.

A search on the SIMPLE web for 'local index of oracle 11g' returns this as the FIRST link

https://docs.Oracle.com/CD/B28359_01/server.111/b28286/statements_5011.htm

The "local_partitioned_index" section has all the information you need and it has code example showing you how do it.

Tags: Database

Similar Questions

  • Partitioning of an existing partitioned table

    Dear Experts,

    I have a problem with redefinition of partitioning of an existing partitioned table. I have a parent table separated by a virtual column by range:

    CREATE THE PARENT TABLE

    (

    PARENT_ID NUMBER NOT NULL,

    INSERT_TIMESTAMP TIMESTAMP (6) NOT NULL,

    CLOB PARENT_DATA NOT NULL,

    BATCH NUMBER,

    DATE of INSERT_DATE generated always as (TRUNC("INSERT_TIMESTAMP"))

    )

    LOB (PARENT_DATA) AS STORE NAVIGATION (ACTIVATE ONLINE STORAGE)

    PARTITION BY RANGE (INSERT_DATE)

    (

    P2015_11 PARTITION VALUES LESS THAN (TO_DATE (' 2015-12-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN '))

    CRAFT STORE (PARENT_DATA) AS (SECUREFILE

    ACTIVATE THE ONLINE STORAGE),

    P2015_12 PARTITION VALUES LESS THAN (TO_DATE (' 2016-01-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN '))

    CRAFT STORE (PARENT_DATA) AS (SECUREFILE

    ACTIVATE THE ONLINE STORAGE),

    P2016_01 PARTITION VALUES LESS THAN (TO_DATE (' 2016-02-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN '))

    CRAFT STORE (PARENT_DATA) AS (SECUREFILE

    ALLOW ONLINE STORAGE,

    PARTITION P_DEFAULT VALUES LESS THAN (MAXVALUE)

    CRAFT STORE (PARENT_DATA) AS (SECUREFILE

    ALLOW ONLINE STORAGE

    ))

    );

    and a child table partitioned by reference:

    CREATE ACCOUNTS FROM THE TABLE. CHILD

    (

    PARENT_ID NUMBER NOT NULL,

    DATAACC DATAACC_TBL,

    CREATION_DATE DATE,

    CONSTRAINT PARENT_D_E_PRT_FK

    FOREIGN KEY (PARENT_ID)

    (PARENT_ID) REFERENCES PARENT

    ENABLE VALIDATE

    )

    NESTED TABLE, STORE DATAACC AS DATAACC_NT

    PARTITION OF REFERENCE (PARENT_D_E_PRT_FK)

    (

    P2015_11 PARTITION,

    P2015_12 PARTITION,

    P2016_01 PARTITION,

    PARTITION P_DEFAULT);

    However, now in Oracle 12 c I am able to use the reference interval partitioning. How can I redefine the partitioning of the parent table so that there can be scope-level?

    Thank you for your help.

    Best regards, Atanas.

    To change range partition to partition interval, the table should not have MAXVALUE partition... Follow the steps below to convert to partition interval

    (1) check if all data of the MAXVALUE partition (p_default) using query below

    SELECT COUNT (*) FROM parent PARTITION (p_default).

    (2) if there is no trace in the p_default partition, drop the help below

    ALTER TABLE DROP PARTITION parent p_default;

    (3) use the clause SET INTERVAL to convert the range partition partition interval as below

    ALTER TABLE parent SET INTERVAL (NUMTOYMINTERVAL(1,'MONTH'));

    I guess, you have the range partition up to until, so there should not be any folder in p_default partition.

  • Local primary key on reference partitioned Table

    Oracle running on Red Hat Linux Rel6 11.2.0.3.

    I'm on a closed network, so the following must be typed manually.

    I have a table of documents which is essentially the following:

    (entire annual <-primary key)

    whole Source_ID,

    load_dt date,

    date of doc_dt,

    doc_info clob,

    ...)

    which is partitioned on column source_id.

    I created a partitioned table of reference as follows:

    create table doc_entities_prt)

    whole doc_entity_id

    all annual,

    whole entity_id,

    forced doc_ent_fk (annual) references to documents (annual)

    tablespace...

    allow the movement of the line

    benchmark score (doc_ent_fk);

    The annual column in the child table is not unique.  The doc_entity_id column is unique.  I want to set the primary key on doc_entities_prt as a local index on the doc_entity_id column.  I was not able to find the proper syntax to get there, and now I'm wondering if this is even possible? Any ideas appreciated.

    Oops, I missed part that you want to base the PK of this index. No, it is not possible and has nothing to do with the partitoning reference. A unique index can be partitioned only if it includes a partitioning column. You can create a non-unique without partitioning column partitioned index, but then you can't create PK supported by such an index for the same reason - oracle would not be able to verify uniquenes based on this index partition and controls of the cross-partition are not supported:

    SQL > create table documents)
    2 whole annual,
    3 whole source_id,
    load_dt date 4.
    date of doc_dt 5.
    6 doc_info clob
    7                        )
    8 partition by range (source_id)
    9      (
    10 partition p1 values less than (10),
    11 partition p2 values less than (100)
    12)
    13.

    Table created.

    SQL > create index unique documents_pk
    2 on documents (annual)
    (3) local
    partition 4 p1,
    5 partition p2
    6         )
    7.
    on documents (annual)
    *
    ERROR on line 2:
    ORA-14039: partitioning columns must be a subset of the columns of a unique key
    index

    SQL > create index documents_pk
    2 on documents (annual)
    (3) local
    partition 4 p1,
    5 partition p2
    6         )
    7.

    The index is created.

    SQL > alter table documents
    2 Add the constraint documents_pk
    3 key (annual) elementary school
    4 using index documents_pk
    5.
    change the documents table
    *
    ERROR on line 1:
    ORA-14196: specified Index cannot be used to apply the constraint.

    SQL >

    SY.

  • Create no partition Table partitioning

    Dear all,

    I have a table that is not partition, and it has about 20 G data... If I want that table with say DATE_M partition column

    Please can anyone suggest the best way to do it.

    Thank you

    To create a partitioned table

    (1) you must make a backup of the existing one you can take expdp or DEC

    (2) remove the table and create the same table now with partitions (a minimum score is required)

    you want a range of ex-based partition if you use a date column

    (3) loading data from the previous table into the new partitioned table, either by DEC or impdp, the inserts will be automatically in their respective partitions and you don't mention explicitly.

    Their is no other possible way to partition a non partitioned table, you can do than workarounds to minimize the downtime of the table trying different ways to load data into the partitioned table.

    You can use the enable row movement clause of create table and also use local indexes for easy maintenance partition.

  • Conversion of non partitioned in partitioned table


    Hi gurus,

    I need to convert the partition table not in the partition.  More flexible way is to use the DBMS_REDEFINITION package for this.
    I do not have access to run this package, when I asked the EXECUTE permission for my dev
    CUSTOMER rejected suggestion that
    "DBMS_REDEFINITION is a method very slow migration that has never been used before here for these migrations.
    so I do not recommend using it as it can trigger bugs and unexpected side effects.


    is this true?

    What will be the alternative method, I can go away?

    Please suggest

    S

    I don't think DBMS_REDEFINITION has bugs.  However, you (and the client) should be familiar with the steps involved.

    Other that that, you will need to create a partitioned table and insert data to the existing table.  You can speed up integration through parallel direct-path insert.

    You will also need to build indexes on the new (partitioned) table.  Define constraints if necessary.  Run grants to other patterns, if necessary.

    Hemant K Collette

  • Possible to Exchange temporary table with composite range-hash partitioned table?

    Hello

    Using oracle 11.2.0.3

    We want to clean up the data in some of our existing partitioned table.

    Afetr updates check spped that is too slow for us.

    Current table is partitioned the inetrval compoiste range-hash table.  Also it is compressed - enabled for compression of basis as well

    An interval of 1 month and 1 partition by month and 4 secondary partitions in the partition of ecah.

    You want to create tenp table with the data of celan and exchange the data in this table in the 'dirty' uisng existing partitions partition exchnage.

    Is this possible?

    The plan is

    1) create temporary table containing data for 1 partition (1 month worth of data)

    (2) clean the data here

    (3) create new temporary table with these specific data which compressed and discovered partitioned with 4 secondary partitions

    (4) table 3 for swap partition dirty using partition excahnge.

    Thaks

    I think that this can be done with a combination of Exchange and Split partition partitions. Prior to Oracle 11 g, only way of redefining tables online was DBMS_REDEFINITION package. Now, you can redefine the use of partitions for Exchange & Split. Check

    http://www.Oracle-base.com/articles/Misc/partitioning-an-existing-table-using-Exchange-partition.php

    Maintenance of Partitions

    Kind regards

  • Migration to a new transportable tablespace partition table

    I created a table that is partitioned with 2 partitions (2010 & 2011) and transportable tablespace to migrate data to a new envionment. My question is, if I decide to add a partition (2012) in the future, can I simply move as new portable partition as well as the associated through tablespace data file or I have to spend all the partitions (2010, 2011, 2012).

    user564785 wrote:
    I created a table that is partitioned with 2 partitions (2010 & 2011) and transportable tablespace to migrate data to a new envionment. My question is, if I decide to add a partition (2012) in the future, can I simply move as new portable partition as well as the associated through tablespace data file or I have to spend all the partitions (2010, 2011, 2012).

    Yes, why not.
    (1) create a table like new Tablespace on source 2012 DEC
    (2) transport the tablespace
    (3) add the existing partition table partition or swap partition

    Oracle has also documented this procedure:
    http://docs.Oracle.com/CD/B28359_01/server.111/b28310/tspaces013.htm#i1007549

  • Local index: prefix or no prefix

    Hello

    I understand that in order to effectively use the local index, WHERE the sql clause must have the partition column
    as a predicate.

    in general, the partition column will not be a very selective specific column to the individual partition (even at the level of the table).

    in which case, with the local index prefix (where the partition column will be the leading index) will benefit?
    in my case, I partitioned tables list with 2 partitions, 1) 2) obsolete current.

    Thank you
    Charles

    Uwe Hesse wrote:

    Uwe,

    In short: If you manage to include the partition key of the table to your where condition, size of the partition to the level of the index for the index is possible. But maybe it's not always possible.

    But if the where clause does not contain the partition key, then you need to visit each partition of the index (and, possibly, table) anyway - and the index cannot be used for high precision range scans because it begins with a column that is not in the where clause (you might get lucky with skip scans However).

    There are four conditions to study once you have chosen a possible local index and think that you are supposed to decide whether or not the index should include:

    When the clause includes partition key, index is not prefixed (even to the extent where the partition key is not part of the index)
    Partition elimination can occur

    When the clause includes partition key, the index is prefixed
    Partition elimination can occur

    When the clause does not partition key, index is not prefixed (even to the extent where the partition key is not part of the index)
    Partition elimination cannot take place-, but the index could still be very accurate and very effective

    When the clause does not partition key, the index is prefixed
    Partition elimination cannot take place, and the index cannot be used by a jump search or complete analysis because it begins with a column that is not the case clause.

    The first pair of options shows that there is no inherent advantage to the addition of the prefix, the second pair shows that there is a potential threat.

    Since something like 8.1.6 the only factors including the key partitioning in all indexes them are that the standard ones - how does improve accuracy, where - in the index, the column order - is this is a most useful position. The concept of all prefix/non-prefixe has been buried years ago.

    Concerning
    Jonathan Lewis

  • Creating / deleting indexes using a Package

    In SchemaA:
    CREATE OR REPLACE PACKAGE TESTPACKAGE AS
    PROCEDURE Create_Indexes;
    PROCEDURE Drop_Indexes;
    END TESTPACKAGE;
    /
    
    CREATE OR REPLACE PACKAGE BODY TESTPACKAGE AS
    PROCEDURE Create_Indexes
    IS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE UNIQUE INDEX SCHEMAB.IDX1 ON SCHEMAB.TABLEA (COLUMN_PK) NOLOGGING NOPARALLEL';
    COMMIT;
    EXCEPTION
       WHEN NO_DATA_FOUND THEN
           DBMS_OUTPUT.PUT_LINE('NO DATA FOUND IN BASE TABLES' );
       WHEN OTHERS THEN
          DBMS_OUTPUT.PUT_LINE('ERROR MESSAGE:' || SQLERRM );
    END;
    
    PROCEDURE Drop_Indexes
    IS
    BEGIN
    EXECUTE IMMEDIATE 'DROP INDEX SCHEMAB.IDX1';
    COMMIT; 
    
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('NO DATA FOUND IN BASE TABLES' );
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR MESSAGE:' || SQLERRM );
    END;
    
    END;
    {code}
    I have granted the following on SCHEMAB.TABLEA to SCHEMAA
    
    GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER, INDEX ON TABLEA TO SCHEMAA;
    
    The problem is that when i am logged into Oracle 10g I can execute any of the commands i have put into the execute immediate and they work. However when I execute the package it tells me it has completed but the index has not been created nor has it been dropped in SchemaB. I am not getting any error messages displayed.
    
    The reason before anyone asks why is that there is a nightly load of data happening from scratch so the process is basically Schema A will drop the indexes , execute a truncate table statement on the tables in schema B. The populate will happen and then the create indexes will be executed. This is being done for speed.
    
    Any help would be greatly appreciated.
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    (1) A ONCE OTHER exception that does not again raise an exception handler is almost certainly a mistake. In your case, you write DBMS_OUTPUT via error message, but unless your front end comes to try to read and display the DBMS_OUTPUT buffer, the error will be ignored. You really want to remove this exception handler.

    (2) creating an index will not trigger a NO_DATA_FOUND if there is no data in the table, this exception handler is superfluous.

    (3) If you want that the user has to be able to create an index in the schema of the user B, the user must be granted the CREATE ANY INDEX privilege (directly, not through a role). If you get a permissions error after removing incorrect exception handlers, create the index, this is probably the problem. If you get an error of permissions deleting the index after removing incorrect exception handlers, you need to ensure that the user is granted the privilege to DEPOSIT ANY CLUE.

    (4) since the different PRIVILEGES (CREATE ANY INDEX, DROP ALL INDEXES, etc.) are powerful enough and not limited to a particular schema, is there a logical reason does not put this code in detail b. first?

    Justin

  • What happens to the existing after the partition of table index and created with local index

    Hi guys,.

    / / DESC part id name number, varchar2 (100), number of wage

    In an existing table PART I add 1 column DATASEQ MORE. I wonder the part of table based on dataseq.now, the table is created with this logic of partition

    create the part table partition (identification number, name varchar2 (100), number of salary, number DATASEQ) in list (dataseq) (values partition PART_INITIAL (1));

    Suggestionn necessary. given that the table is partitioned based on DATASEQ I wonder to add local indexes on dataseq. to dataseq, I have added a local index create index idx on share (dataseq) LOCAL; Now my question is, already, there are the existing index is the column ID and salary.

    (1) IDX for dataseq is created locally so that it will be partition on each partition on the main table. Please tell me what is happening to the index on the column ID and salary... it will create again in local?

    Please suggest

    S

    Hello

    first of all, in reality 'a partition table' means create a new table a migration of existing data it (although, theoretically, you can use dbms_redefinition to partition an existing table - however, it's just doing the same thing behind the scenes). This means that you also get to decide what to do with the index - index will be local, who will be global (you can also reassess some of existing indexes and decide that they are not really necessary).

    Second of all, the choice of the partitioning key seems weird. Partitioning is a data management technique more that anything else, in order to be eligible, you must find a good partitioning key. A column recently added, named "data_seq" is not a good candidate. Can you give us more details about this column and why it was chosen as a partitioning key?

    I suspect that the person who proposed this partitioning scheme made a huge mistake. A non-partitioned table is much better in all aspects (including the ease of management and performance) that divided one wrongly.

    Best regards

    Nikolai

  • Partition key would exist in local index, if so it should be first or last or is not serious?

    Hello

    I'm trying to find the rule for:

    -J' have a partitioned table every day and each partition has about 10 GB.

    -J' need to keep the data in 3 months.

    -I need to partition cutting happens.

    I'm trying to find if I need to use the local index the partition key or not.

    I am currently adding as the first column of the index.

    In my research on the web and with colleagues, I find three different answers:

    -It is not required to add local index the partition key.

    -It is compulsory and must be the first position.
    -It is necessary and should be the last position.

    I share below the criation of table as an example:

    CREATE TABLE MY_BIG_TABLE
    (
      MY_SOURCE             VARCHAR2(50 CHAR)       NOT NULL,
      MY_FILENAME           VARCHAR2(255 CHAR)      NOT NULL,
      MY_DATE               DATE                    NOT NULL,
      MY_ID                 VARCHAR2(50 CHAR)       NOT NULL,
      MY_ORIG_GROUP         VARCHAR2(50 CHAR)       NOT NULL,
      MY_DEST_GROUP         VARCHAR2(50 CHAR)       NOT NULL,
      MY_DURATION           NUMBER,
      MY_NR_EVENT           NUMBER
    )
    TABLESPACE MY_BIG_TABLESPACE_1
    PARTITION BY RANGE (MY_DATE)
    INTERVAL (NUMTODSINTERVAL(1,'DAY'))
    (  
      PARTITION P_FIRST VALUES LESS THAN (TO_DATE(' 2014-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        LOGGING
        NOCOMPRESS 
        TABLESPACE MY_BIG_TABLESPACE_1
    )
    LOGGING 
    NOCOMPRESS 
    NOCACHE
    NOPARALLEL
    MONITORING
    /
    CREATE UNIQUE INDEX I_MY_BIG_TABLE
     ON MY_BIG_TABLE (
       MY_DATE,           
       MY_SOURCE,    
       MY_FILENAME,       
       MY_ID,             
       MY_ORIG_GROUP,     
       MY_DEST_GROUP     
     )
     TABLESPACE MY_BIG_IDX_TABLESPACE_1
     LOGGING
     NOCOMPRESS
     NOPARALLEL
     LOCAL
    /
    

    Best regards

    Ricardo Tomas

    Well, I don't like this example because I would tell you to use on your text string to_date and to_char on your column.

    Let's say if you have a partition of the range with a value of one month of data in the partition and you want to select the data for a given day. Oracle must be able plum of the score, but then you have to complete the partition scanning unless there was an index containing the day (assuming it's the partition key)

  • Create index partition in the partition table tablespace

    Hello

    I am running a work custom that

    * Creates a tablespace by day
    * Creates the daily table partition in the created tablespace
    * Removes the days tablepartition X
    * Removes the storage space for this partition of X + 1 day.

    The work above works perfectly, but it has problems with the management of the index for these partitioned tables. In the old database (10g - single node), all indexes and partitions exist in a BIG tablespace and when I imported the table creation script in the new database, I changed all the partitions table & index to go in their respective space.

    For example:

    Table_name... Nom_partition... Index_Part_name... Tablespace_name
    ============...================............====================...........=================
    TABL1... TABL1_2012_07_16... TABL1_IDX_2012_07_16... TBS_2012_07_16
    TABL1... TABL1_2012_07_15... TABL1_IDX_2012_07_15... TBS_2012_07_15


    But now, when the job is run, it creates the index in the tablespace TBS_DATA default.

    Table_name... Nom_partition... Index_Part_name... Tablespace_name
    ============...================.............====================...........=================
    TABL1... TABL1_2012_08_16... TABL1_IDX_2012_08_16... TBS_DATA
    TABL1... TABL1_2012_08_15... TABL1_IDX_2012_08_15... TBS_DATA


    I can issue alter index rebuild to move the index to its tablespace default, but how can I make sure that the index is created in the designated tablespace?

    NOTE: the partition/tablespace management work that I run only creates the partition of the table and not the index.


    The new env is a cluster of CARS of 2 nodes 11 GR 2 on Linux x86_64.


    Thanks in advance,
    aBBy.

    try something like this

    ALTER table tab_owner.tab_name add the partition v_new_part_nm
    values less (to_date('''|| v_new_part_dt_formatted ||'') ((', "DD-MON-YYYY)) tablespace ' | part_tbs
    update the index (ind1_name (partition ind_partition_name tablespace ind_part_tbs)
    ind2_name (partition tablespace ind_part_tbs ind_partition_name))
    ;

  • creating indexes on partitioned tables...

    Hi all
    I use 11g. creates a table with partition on transaction_dt. Now I have to create index based on the combination of the column below.
    can anyone suggest the best method to create the partioned indexes based on the underside of the columns?

    enjoyed the great suggestions...
    CREATE INDEX TB_PRCHS_SALE_TRANS_BASE_IDX1 ON TB_PRCHS_SALE_TRANS_BASE
    (TRANSACTION_DT, VENDOR_ACCT_NBR, VENDOR_SECURITY_NBR);
    
    
    CREATE INDEX TB_PRCHS_SALE_TRANS_BASE_IDX2 ON TB_PRCHS_SALE_TRANS_BASE
    (TRANSACTION_DT, ING_ACCT_NBR, ING_SECURITY_NBR);
    
    
    CREATE INDEX TB_PRCHS_SALE_TRANS_BASE_IDX3 ON TB_PRCHS_SALE_TRANS_BASE
    (TRADE_DT, SETTLEMENT_DT, VENDOR_ACCT_NBR, VENDOR_SECURITY_NBR);
    
    
    CREATE UNIQUE INDEX TB_PRCHS_SALE_TRANS_BASE_PK ON TB_PRCHS_SALE_TRANS_BASE
    (TRANS_CONTROL_ID);
    
    
    CREATE INDEX TB_PRCHS_SALE_TRANS_INDX3 ON TB_PRCHS_SALE_TRANS_BASE
    (OLD_TRANSACTION_ID);
    
    
    ALTER TABLE TB_PRCHS_SALE_TRANS_BASE ADD (
      CONSTRAINT TB_PRCHS_SALE_TRANS_BASE_PK
     PRIMARY KEY
     (TRANS_CONTROL_ID));
    
    
    Table
    ====================
    
    CREATE TABLE TB_PRCHS_SALE_TRANS_BASE
    (
      TRANSACTION_DT              DATE              NOT NULL,
      TRANS_CONTROL_ID            NUMBER            NOT NULL,
      VENDOR_CD                   CHAR(3 BYTE)      NOT NULL,
      ING_ACCT_NBR                NUMBER(10)        NOT NULL,
      ING_ACCT_TYPE_CD            CHAR(1 BYTE)      NOT NULL,
      ING_SECURITY_NBR            NUMBER(10)        NOT NULL,
      VENDOR_ACCT_NBR             VARCHAR2(10 BYTE) NOT NULL,
      VENDOR_ACCT_TYPE_CD         CHAR(1 BYTE)      NOT NULL,
      VENDOR_ACCT_CHCK_CD         CHAR(1 BYTE)      NOT NULL,
      VENDOR_SECURITY_NBR         VARCHAR2(10 BYTE),
      BUY_SELL_CD                 CHAR(1 BYTE)      NOT NULL,
      TRADE_DT                    DATE,
      SETTLEMENT_DT               DATE,
      CREATE_USER                 VARCHAR2(50 BYTE),
      UPDATE_TS                   DATE,
      UPDATE_USER                 VARCHAR2(50 BYTE),
      OLD_TRANSACTION_ID          NUMBER(10)
    partition by range (TRANSACTION_DT)
    interval (numtoyminterval(1,'YEAR'))
    (
       partition p001 values less than (date '2002-01-01'),
       partition p002 values less than (date '2003-01-01'),
       partition p003 values less than (date '2004-01-01'),
       partition p004 values less than (date '2005-01-01'),
       partition p005 values less than (date '2006-01-01'),
       partition p006 values less than (date '2007-01-01'),
       partition p007 values less than (date '2008-01-01'),
       partition p008 values less than (date '2009-01-01'),
       partition p009 values less than (date '2010-01-01'),
       partition p010 values less than (date '2011-01-01'),
      );
     
    CREATE INDEX TB_PRCHS_SALE_TRANS_INDX3 ON TB_PRCHS_SALE_TRANS_BASE
    (OLD_TRANSACTION_ID)
    LOCAL
    (
    partition p001,
    partition p002,
    partition p003,
    partition p004,
    partition p005,
    partition p006,
    partition p007,
    partition p008,
    partition p009,
    partition p010
    )
    /
    -- Since PK column set does not include partitioning colums
    -- you can't create LOCAL partitioned index.
    ALTER TABLE TB_PRCHS_SALE_TRANS_BASE ADD
     CONSTRAINT TB_PRCHS_SALE_TRANS_BASE_PK
    PRIMARY KEY
    (TRANS_CONTROL_ID)
    USING INDEX
    GLOBAL
    (
    partition p001,
    partition p002,
    partition p003,
    partition p004,
    partition p005,
    partition p006,
    partition p007,
    partition p008,
    partition p009,
    partition p010
    )
    /
    

    SY.

  • Global and local index with respect to table partitioned

    Hello
    I am very confused about local and global index in a partitioned table.
    In addition, local index can be partitioned and unpartitioned.
    In addition, what is the difference between global partitioned and unpartitioned
    the index?

    As far as I know,
    If there is local index then there will be as many partitions as the partition table
    and local parition will index contains the index of only the lines of their corresponding scores.
    In addition, the local index maintananence is easier because drop us or create a partition, only index corresponding partition is affected then that in the case of the overall index,
    If we create a new partition of the table, to rebuild the global index.
    Am I wrong?

    Concerning

    Hello

    This means that when you add/drop/split/merge table any partition (maintaiance) lying below, its corresponding partition in index is automatically added/deleted/split/merged. Oracle takes care of it internally without user intervention.

    Concerning
    Anurag

  • Can I create an index on a partitioned table bitmap?

    Can I create an index on a partitioned table bitmap?

    Yes, you can. But an index on a partitioned table bitmap must be a local index.
    Image bitmap index on non partitioned tables cannot be partitioned.

Maybe you are looking for