"UPDATE GLOBAL INDEXES"를 사용하여, DDL 처리와 동시에 GLOBAL INDEX를 자동 관리하는 방안

제품 : ORACLE SERVER
작성날짜 :
"UPDATE GLOBAL INDEXES"를 사용하여, DDL 처리와 동시에 GLOBAL INDEX를 자동 관리하는 방안
==========================================================================================
PURPOSE
이 문서에서는 다음과 같은 사항을 기술한다.
1. 새로 추가된 기능으로, 테이블 파티션에 대한 DDL 수행시
지정 가능한 "UPDATE GLOBAL INDEXES" 절에 대한 설명
2. UPDATE GLOBAL INDEXES를 사용하는 것 보다는 REBUILD INDEX를
사용하여야 하는 성능상의 고려사항.
SCOPE
Oracle Partitioning Option은 8~10g Standard Edition에서는 지원하지
않는다.
Explanation
테스트를 위해 먼저 4개의 테이블을 생성한다.
1. RANGE partitioned table을 생성한 후 GLOBAL index를 만든다:
SQL> create table orders (
2 order_no number,
3 part_no varchar2(40),
4 ord_date date
5 )
6 partition by range (ord_date)
7 (partition Q1 values less than (TO_DATE('01-APR-1999','DD-MON-YYYY')),
8 partition Q2 values less than (TO_DATE('01-JUL-1999','DD-MON-YYYY')),
9 partition Q3 values less than (TO_DATE('01-OCT-1999','DD-MON-YYYY')),
10 partition Q4 values less than (TO_DATE('03-JAN-2000','DD-MON-YYYY'))
11 );
Table created.
SQL> create index orders_global_idx
2 on orders(ord_date)
3 global partition by range (ord_date)
4 (partition GLOBAL1 values less than (TO_DATE('01-APR-1999','DD-MON-YYYY')
5 partition GLOBAL2 values less than (TO_DATE('01-SEP-1999','DD-MON-YYYY')
6 partition GLOBAL3 values less than (TO_DATE('01-DEC-2000','DD-MON-YYYY')
7 partition GLOBAL4 values less than (MAXVALUE)
8 );
Index created.
SQL> select substr(index_name,1,20) index_name,
2 substr(partition_name,1,20) part_name,
3 status
4 from dba_ind_partitions
5 where index_name= 'ORDERS_GLOBAL_IDX' order by partition_name;
INDEX_NAME PART_NAME STATUS
ORDERS_GLOBAL_IDX GLOBAL1 USABLE
ORDERS_GLOBAL_IDX GLOBAL2 USABLE
ORDERS_GLOBAL_IDX GLOBAL3 USABLE
ORDERS_GLOBAL_IDX GLOBAL4 USABLE
SQL> insert into orders values (1,100,TO_DATE('02-FEB-1999','DD-MON-YYYY'));
2. HASH partitioned table을 생성 한 후 GLOBAL index를 만든다:
SQL> CREATE TABLE emp_hpart(
2 empno NUMBER(4) NOT NULL,
3 ename VARCHAR2(10),
4 sal NUMBER(7,2))
5 PARTITION BY HASH(sal)
6 (PARTITION H1, PARTITION H2, PARTITION H3, PARTITION H4);
Table created.
SQL> CREATE INDEX emp_global_HASH_idx ON emp_hpart(ename)
2 GLOBAL PARTITION BY RANGE (ename)
3 (PARTITION p1 VALUES LESS THAN ('N') ,
4 PARTITION p2 VALUES LESS THAN (MAXVALUE));
Index created.
SQL> select substr(index_name,1,20) index_name,
2 substr(partition_name,1,20) part_name,status
3 from dba_ind_partitions
4 where index_name= 'EMP_GLOBAL_HASH_IDX' order by partition_name;
INDEX_NAME PART_NAME STATUS
EMP_GLOBAL_HASH_IDX P1 USABLE
EMP_GLOBAL_HASH_IDX P2 USABLE
SQL> insert into emp_hpart values (1,'AAA',100);
3. COMPOSITE partitioned table을 생성한 후 GLOBAL index를 만든다:
SQL> CREATE TABLE emp_composite(
2 empno NUMBER(4) NOT NULL,
3 ename VARCHAR2(10),
4 sal NUMBER(6))
5 PARTITION BY RANGE(empno)
6 SUBPARTITION BY HASH(sal) SUBPARTITIONS 4
7 (PARTITION p1 VALUES LESS THAN (50),
8 PARTITION p2 VALUES LESS THAN (100),
9 PARTITION p3 VALUES LESS THAN (150),
10 PARTITION p4 VALUES LESS THAN (MAXVALUE));
Table created.
SQL> CREATE INDEX emp_global_composite_idx ON emp_composite(ename)
2 GLOBAL PARTITION BY RANGE (ename)
3 (PARTITION p1 VALUES LESS THAN ('N') ,
4 PARTITION p2 VALUES LESS THAN (MAXVALUE));
Index created.
SQL> select substr(index_name,1,20) index_name,
2 substr(partition_name,1,20) part_name,status
3 from dba_ind_partitions
4 where index_name= 'EMP_GLOBAL_COMPOSITE_IDX' order by
partition_name;
INDEX_NAME PART_NAME STATUS
EMP_GLOBAL_COMPOSITE P1 USABLE
EMP_GLOBAL_COMPOSITE P2 USABLE
SQL> insert into emp_composite values (1,'AAA',100);
4. LIST partitioned table을 생성 한 후 GLOBAL index를 만든다:
SQL> CREATE TABLE locations (
2 location_id NUMBER, street_address VARCHAR2(80), postal_code
CHAR(12),
3 city VARCHAR2(80), state_province CHAR(2), country_id
VARCHAR2(20))
4 PARTITION BY LIST (state_province)
5 (PARTITION region_east
6 VALUES ('MA','NY','CT','NH','ME','MD','VA','PA','NJ'),
7 PARTITION region_west
8 VALUES ('CA','AZ','NM','OR','WA','UT','NV','CO'),
9 PARTITION region_south
10 VALUES ('TX','KY','TN','LA','MS','AR','AL','GA'),
11 PARTITION region_central
12 VALUES ('OH','ND','SD','MO','IL','MI',NULL,'IA'));
Table created.
SQL> create index loc_global_idx
2 on locations (state_province)
3 global partition by range (state_province)
4 (partition p1 values less than ('NV'),
5 partition p2 values less than (maxvalue));
Index created.
SQL> INSERT INTO locations VALUES
2 ( 1000,'1297 Via Cola di Rie','00989','Roma',NULL,'IT');
1 row created.
SQL> select substr(index_name,1,20) index_name,
substr(partition_name,1,20)
2 part_name , status
3 from dba_ind_partitions
4 where index_name= 'LOC_GLOBAL_IDX' order by partition_name;
INDEX_NAME PART_NAME STATUS
LOC_GLOBAL_IDX P1 USABLE
LOC_GLOBAL_IDX P2 USABLE
*** 오라클 8/8i : UPDATE GLOBAL INDEXES 절을 사용하지 않았을 때
SQL> select substr(index_name,1,20) index_name,
2 substr(partition_name,1,20) part_name,status
3 from dba_ind_partitions
4 where index_name= 'ORDERS_GLOBAL_IDX' order by partition_name;
INDEX_NAME PART_NAME STATUS
ORDERS_GLOBAL_IDX GLOBAL1 USABLE
ORDERS_GLOBAL_IDX GLOBAL2 USABLE
ORDERS_GLOBAL_IDX GLOBAL3 USABLE
ORDERS_GLOBAL_IDX GLOBAL4 USABLE
SQL> ALTER TABLE orders DROP PARTITION q2;
Table altered.
SQL> select substr(index_name,1,20) index_name,
substr(partition_name,1,20)
2 part_name, status
3 from dba_ind_partitions
4 where index_name= 'ORDERS_GLOBAL_IDX' order by partition_name;
INDEX_NAME PART_NAME STATUS
ORDERS_GLOBAL_IDX GLOBAL1 UNUSABLE
ORDERS_GLOBAL_IDX GLOBAL2 UNUSABLE
ORDERS_GLOBAL_IDX GLOBAL3 UNUSABLE
ORDERS_GLOBAL_IDX GLOBAL4 UNUSABLE
=> Oracle 9i 이전 버젼에서는, partitioned table의 특정 파티션에 대해
DDL을 수행하면, 해당 파티션이 비어있는 상태가 아니라면,
GLOBAL index에 대한 상태를 invalidate 시킨다.
=> Oracle 9i에서 UPDATE GLOBAL INDEXES 절을 수행하면, 테이블의
파티션에 대한 DDL 작업을 수행하는 동안 GLOBAL INDEX에
대한 관리 작업을 자동으로 수행하게 된다.
그러나 일부 작업에 대해서는, 위와 같은 작업이 허용되지
않는다.
*** UPDATE GLOBAL INDEXES 절과 ADD PARTITION 절의 동시 사용
1. RANGE partitioned table:
SQL> ALTER TABLE orders ADD PARTITION q5
2 values less than (TO_DATE('03-JUN-2000','DD-MON-YYYY'))
3 UPDATE GLOBAL INDEXES;
ALTER TABLE orders ADD PARTITION q5
ERROR at line 1:
ORA-30564: Index maintainence clause not allowed for ADD partition to
RANGE
partitioned tables
UPDATE GLOBAL INDEXES 절은 다음 경우에만 사용할 수 있다.
=> HASH partitioned table에 partition 추가
=> Composite partitioned table에 subpartition 추가
| RANGE partitioned table에 일반적인 방식으로 작업 수행 |
SQL> ALTER TABLE orders ADD PARTITION q5
2 values less than (TO_DATE('03-JUN-2000','DD-MON-YYYY'));
Table altered.
SQL> @sel
INDEX_NAME PART_NAME STATUS
ORDERS_GLOBAL_IDX GLOBAL1 USABLE
ORDERS_GLOBAL_IDX GLOBAL2 USABLE
ORDERS_GLOBAL_IDX GLOBAL3 USABLE
ORDERS_GLOBAL_IDX GLOBAL4 USABLE
2. HASH partitioned table:
| UPDATE GLOBAL INDEXES절을 HASH partitioned table 에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_hpart ADD PARTITION q5
2 UPDATE GLOBAL INDEXES;
Table altered.
SQL> @sel
INDEX_NAME PART_NAME STATUS
EMP_GLOBAL_HASH_IDX P1 USABLE
EMP_GLOBAL_HASH_IDX P2 USABLE
3. COMPOSITE partitioned table:
| UPDATE GLOBAL INDEXES 절을 COMPOSITE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_composite MODIFY PARTITION p1 add subpartition h5
2 UPDATE GLOBAL INDEXES;
Table altered.
SQL> @sel
INDEX_NAME PART_NAME STATUS
EMP_GLOBAL_COMPOSITE P1 USABLE
EMP_GLOBAL_COMPOSITE P2 USABLE
4. LIST partitioned table
| LIST partitioned table에 대해서는 일반적인 방법 사용 |
SQL> alter table locations ADD
2 partition nomansland values ('XX');
Table altered.
SQL> @sel
INDEX_NAME PART_NAME STATUS
LOC_GLOBAL_IDX P1 USABLE
LOC_GLOBAL_IDX P2 USABLE
*** UPDATE GLOBAL INDEXES 절과 DROP PARTITION절의 동시사용
1. RANGE partitioned table:
| UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE orders DROP PARTITION q2 UPDATE GLOBAL INDEXES;
Table altered.
2. HASH partitioned table:
HASH partitioned table에서는 DROP 명령을 수행할 수 없으며,
COALESCE를 대신 사용함 (문서 마지막 부분을 참조)
3. COMPOSITE partitioned table:
| UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_composite DROP PARTITION p2
2 UPDATE GLOBAL INDEXES;
Table altered.
4. LIST partitioned table:
| UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> alter table locations DROP PARTITION
2 region_south
3 UPDATE GLOBAL INDEXES;
Table altered.
*** UPDATE GLOBAL INDEXES 절과 SPLIT PARTITION 절의 동시 사용
1. RANGE partitioned table
| UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE orders SPLIT PARTITION q3 AT
2 (TO_DATE('15-SEP-1999','DD-MON-YYYY'))
3 INTO (PARTITION q3_1, PARTITION q3_2)
4 UPDATE GLOBAL INDEXES;
Table altered.
2. HASH partitioned table
HASH partitioned table에서는 SPLIT 명령을 수행할 수 없으며,
ADD를 대신 사용함 (윗 부분에 기술하였음)
3. COMPOSITE partitioned table
| UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_composite SPLIT PARTITION p2 AT (80)
2 INTO (PARTITION p2_1, PARTITION p2_2)
3 UPDATE GLOBAL INDEXES;
Table altered.
4. LIST partitioned tables:
| UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> alter table locations SPLIT PARTITION region_east
2 VALUES ('MA','NJ')
3 INTO (PARTITION region_east_1, PARTITION region_east_2)
4 UPDATE GLOBAL INDEXES;
Table altered.
*** UPDATE GLOBAL INDEXES 절과 MERGE PARTITION 절의 동시 사용
1. RANGE partitioned table
| UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE orders MERGE PARTITIONS q2, q3 INTO PARTITION q3
2 UPDATE GLOBAL INDEXES;
Table altered.
2. HASH partitioned table
HASH partitioned table에서는 MERGE 명령을 수행할 수 없으며,
COALESCE를 대신 사용함 (문서 마지막 부분을 참조)
3. COMPOSITE partitioned table
| UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_composite MERGE PARTITIONS p1, p2
2 INTO PARTITION p2
3 UPDATE GLOBAL INDEXES;
Table altered.
4. LIST partitioned table:
| UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> alter table locations MERGE PARTITIONS region_east,region_west
2 INTO PARTITION region_north
3 UPDATE GLOBAL INDEXES;
Table altered.
*** UPDATE GLOBAL INDEXES 절과 EXCHANGE PARTITION 절의 동시사용
1. RANGE partitioned tables
| UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE orders EXCHANGE PARTITION q3 WITH TABLE t_orders
2 UPDATE GLOBAL INDEXES;
Table altered.
If GLOBAL indexes exist on the TABLE of exchange, they are left UNUSABLE:
SQL> create index t_orders_global_idx
2 on t_orders(ord_date)
3 global partition by range (ord_date)
4 (partition GLOBAL1 values less than (TO_DATE('01-APR-1999','DD-MON-YYY
Y')),
5 partition GLOBAL2 values less than (TO_DATE('01-SEP-1999','DD-MON-YYY
Y')),
6 partition GLOBAL3 values less than (TO_DATE('01-DEC-1999','DD-MON-YYY
Y')),
7 partition GLOBAL4 values less than (MAXVALUE) );
Index created.
SQL> ALTER TABLE orders EXCHANGE PARTITION q3 WITH TABLE t_orders
2 UPDATE GLOBAL INDEXES;
Table altered.
SQL> @sel
INDEX_NAME PART_NAME STATUS
T_ORDERS_GLOBAL_IDX GLOBAL1 UNUSABLE
T_ORDERS_GLOBAL_IDX GLOBAL2 UNUSABLE
T_ORDERS_GLOBAL_IDX GLOBAL3 UNUSABLE
T_ORDERS_GLOBAL_IDX GLOBAL4 UNUSABLE
ORDERS_GLOBAL_IDX GLOBAL1 USABLE
ORDERS_GLOBAL_IDX GLOBAL2 USABLE
ORDERS_GLOBAL_IDX GLOBAL3 USABLE
ORDERS_GLOBAL_IDX GLOBAL4 USABLE
2. HASH partitioned tables
| UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용하 |
| 지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_hpart EXCHANGE PARTITION H1 WITH TABLE t_emp_hpart
2 UPDATE GLOBAL INDEXES;
Table altered.
3. COMPOSITE partitioned tables
SQL> ALTER TABLE emp_composite EXCHANGE PARTITION p1 WITH TABLE t_emp_composi
te;
ALTER TABLE emp_composite EXCHANGE PARTITION p1 WITH TABLE t_emp_composite
ERROR at line 1:
ORA-14291: cannot EXCHANGE a composite partition with a non-partitioned table
| UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_composite EXCHANGE SUBPARTITION SYS_SUBP286
2 WITH TABLE t_emp_composite
3 UPDATE GLOBAL INDEXES;
Table altered.
4. LIST partitioned tables:
| UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE locations EXCHANGE PARTITION region_east
2 WITH TABLE t_locations
3 UPDATE GLOBAL INDEXES;
Table altered.
*** UPDATE GLOBAL INDEXES절과 MOVE PARTITION 절의 동시사용
1. RANGE partitioned table
| UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE orders MOVE PARTITION q3 TABLESPACE example
2 UPDATE GLOBAL INDEXES;
Table altered.
2. HASH partitioned table
| UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_hpart MOVE PARTITION H1 TABLESPACE example
2 UPDATE GLOBAL INDEXES;
Table altered.
3. COMPOSITE partitioned table
SQL> ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example;
ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example
ERROR at line 1:
ORA-14257: cannot move partition other than a Range or Hash partition
SQL> ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example
2 UPDATE GLOBAL INDEXES;
ALTER TABLE emp_composite MOVE PARTITION p1 TABLESPACE example
ERROR at line 1:
ORA-14257: cannot move partition other than a Range or Hash partition
4. LIST partitioned table
| UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE locations MOVE PARTITION region_east
2 TABLESPACE TS_DATA1
3 UPDATE GLOBAL INDEXES;
Table altered.
*** UPDATE GLOBAL INDEXES 절과 TRUNCATE PARTITION 절의 동시 사용
1. RANGE partitioned tables
| UPDATE GLOBAL INDEXES를 RANGE partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE orders TRUNCATE PARTITION q3
2 UPDATE GLOBAL INDEXES;
Table truncated.
2. HASH partitioned tables
| UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_hpart TRUNCATE PARTITION H1
2 UPDATE GLOBAL INDEXES;
Table truncated.
3. COMPOSITE partitioned table
| UPDATE GLOBAL INDEXES를 COMPOSITE partitioned table에서 사용하지|
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_composite TRUNCATE PARTITION p1
2 UPDATE GLOBAL INDEXES;
Table truncated.
4. LIST partitioned table
| UPDATE GLOBAL INDEXES를 LIST partitioned table에서 사용하지 |
| 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE locations TRUNCATE PARTITION region_east
2 UPDATE GLOBAL INDEXES;
Table truncated.
*** UPDATE GLOBAL INDEXES 절과 COALESCE PARTITION 절의 동시사용
1. RANGE partitioned table
Range partitioned table에는 coalesce 기능이 지원되지 않음.
2. HASH partitioned table
| UPDATE GLOBAL INDEXES를 HASH partitioned table에서 사용 |
| 하지 않을 경우 global index가 UNUSABLE 상태로 남음 |
SQL> ALTER TABLE emp_hpart COALESCE PARTITION
2 UPDATE GLOBAL INDEXES;
Table altered.
3. COMPOSITE partitioned table
Composite partitioned table에 대해서는 coalesce 기능이 지원되지 않음.
4. LIST partitioned table
List partitioned table에 대해서는 coalesce 기능이 지원되지 않음.
*** 성능상의 문제로 인해 UPDATE GLOBAL INDEXES 절을 사용하는 대신
*** REBUILD INDEX를 사용하여야 할 경우
UPDATE GLOBAL INDEXES절을 사용할 경우
1 이전 버전에서는 단순히 invalid 상태로 표시하고 종료되었던 작업이
인덱스 관리 작업까지 병행해 수행 되므로 partition DDL operation
작업 수행 시간이 더 오래 걸린다.
2 DROP, TRUNCATE, EXCHANGE 작업이 더 오래 걸린다. 이전에는 데이터
딕셔너리상의 정보만을 갱신하는데 반해, UPDATE GLOBAL INDEXES절을
사용할 경우, partition 내의 모든 row에 대한 scan 작업이 수행
되기 때문이다.
3 GLOBAL INDEX에 대한 갱신 작업을 통한 변경 사항이 redo log 및 rollback에
남게 된다.
4 row의 갯수가 작을 경우, update global index절을 사용하여 작업하는 것이
편리하다.
5 인덱스를 수동으로 rebuild 할 때 까지 애플리케이션 응답 속도가 현격
하게 저하되는 것을 피할 수 있다.
INDEX REBUILD를 사용할 경우
1 전체 인덱스를 rebuild 하면, index가 좀더 효과적으로 구성된다.
2 인덱스를 rebuild 하면, 사용자가 인덱스에 대한 구성을 수동으로
변경할 수 있다.
Example
Reference Documents
<Note:139707.1>

Similar Messages

  • Local Index vs Global Index

    Hi,
    I am aware that Local Index and Global Index methods are attached with Partitions, like local is pertaining to a particular partition. We need to update global index while dropping a partition or using exchange partitions.
    What I know is very little, please provide more details, thank you.

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#SQLRF01001
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2087440
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2131064
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2151566
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#CIHCAAGD
    Regards
    Etbin
    Edited by: Etbin on 13.3.2011 15:55
    First two links added in order to start with alter table

  • Local index vs global index in partitioned tables

    Hi,
    I want to know the differences between a global and a local index.
    I'm working with partitioned tables about 10 millons rows and 40 partitions.
    I know that when your table is partitioned and your index non-partitioned is possible that
    some database operations make your index unusable and you have tu rebuid it, for example
    when yo truncate a partition your global index results unusable, is there any other operation
    that make the global index unusable??
    I think that the advantage of a global index is that takes less space than a local and is easier to rebuild,
    and the advantage of a local index is that is more effective resolving a query isn't it???
    Any advice and help about local vs global index in partitioned tables will be greatly apreciatted.
    Thanks in advance

    here is the documentation -> http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/partconc.htm#sthref2570
    In general, you should use global indexes for OLTP applications and local indexes for data warehousing or DSS applications. Also, whenever possible, you should try to use local indexes because they are easier to manage. When deciding what kind of partitioned index to use, you should consider the following guidelines in order:
    1. If the table partitioning column is a subset of the index keys, use a local index. If this is the case, you are finished. If this is not the case, continue to guideline 2.
    2. If the index is unique, use a global index. If this is the case, you are finished. If this is not the case, continue to guideline 3.
    3. If your priority is manageability, use a local index. If this is the case, you are finished. If this is not the case, continue to guideline 4.
    4. If the application is an OLTP one and users need quick response times, use a global index. If the application is a DSS one and users are more interested in throughput, use a local index.
    Kind regards,
    Tonguç

  • Problem creating index on global temporary table

    Running Oracle DB Oracle9i Release 9.2.0.7.0.
    I'm trying to create 3 indexes on a temporary table, the first index creates fine but the other remaining 2 result in the following error:
    ERROR at line 1: ORA-00600: internal error code, arguments: [kftts2bz_many_files], [0], [20], [], [], [], [], []
    Have tried searching with not much success, any pointers, tips, hints would be appreciated, below is the table and the indexes:-
    create global temporary TABLE contacts (
    ID VARCHAR2(20) NOT NULL,
    DOB VARCHAR2(8),
    HH_LASTNAME VARCHAR2(90),
    PERSON VARCHAR2(10) NOT NULL,
    CONT_JOB VARCHAR2(90) NOT NULL,
    SOURCE VARCHAR2(8) NOT NULL,
    ADS VARCHAR2(8) NOT NULL,
    CONT VARCHAR2(8) NOT NULL,
    SRCPERSONID VARCHAR2(15),
    FIRSTNAME VARCHAR2(90),
    MIDDLENAME VARCHAR2(90),
    LASTNAME VARCHAR2(90),
    FULLNAME VARCHAR2(90),
    TITLE VARCHAR2(50),
    SALUTATION VARCHAR2(90),
    ) on commit delete rows;
    create index i_contact_1 on contacts(dob, soundex(hh_lastname ));
    create index i_contact_pk on contacts(id, person, cont_job, source, ads, cont);
    create index i_contact_2 on contacts(srcpersonid, source);

    Bug 3238525 - Upgrade from 9.0 can leave corruptdata for global temporary table indices
    ORA-600 [kftts2bz_many_files]
         Doc ID:      285592.1

  • Creating, updating and laying out an index

    Hello everybody,
    I have to create and lay out an index of several files in a book.
    What do I have to do?
    How can I update the index? (I use Framemaker 8)
    Thank you for your help.
    Bye
    Vreni

    Reading the Help file or Manual is a good suggestion, but in very simple form, this is what you do.
    Place Index marker in the text at the desired locations (Special>Markers set to index and enter text).
    After you have your marker in place, add a Standard Index (Add>Standard Index and select the index marker type).
    Once the Index is part of the book, it updates with the book, same as your TOC.

  • Update Parent Items Prices Globally Problem

    I am trying to run the Update Parent Item Prices Globally but keep getting an error.
    No Parent Item prices to be updated found [message 65020-3]
    This is running on 2007A SP:00 PL:06
    When I look at the BOM I can see that the total of the components is different than the parents price.  If I click the arrow it updates fine.  But I need to be able to run the global update as there are hundreds of parents.

    See if I am doing it right?
    I have 200 parent parts with price list BOM loaded as the price list in their parent records. I have another 1200 parts with Purchased Price loaded as the price list in their records.
    When I run the global update for the  Purchased Price parts it runs and gives me a list of those parts it is going to update.
    When I run the global update for the BOM parts I get the message No Parent Item prices to be updated found message 65020-3.
    I know that a number of these parts need to be updated.  When I look at the Bill of Material I can see that the sum of the component prices is different than the parents price.  If I click on the arrow on the display it updates the price. However due to the volume of parts thie manual process is not an option.

  • Bitmap index or Composite index better on a huge table

    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.
    Regars,
    Madhu K.

    Dear,
    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.First of all, bitmap indexes are not recommended for write intensive OLTP applications due to the locking threat they can produce in such a kind of applications.
    You told us that this table is never updated; I suppose it is not deleted also.
    Second, bitmap indexes are suitable for columns having low cardinality. The question is how can we define "low cardinality", you said that you have 100,000 distincts group_no on a table of 100,000,000 rows.
    You have a cardinality of 100,000/100,000,000 =0,001. Group_no column might be a good candidate for a bitmap index.
    You said that order_no is unique so you have a very high cardinality on this column and it might not be a candidate for your bitmap index
    Third, your query where clause involves only the group_no column so why are you including both columns when testing the bitmap and the b-tree index?
    Are you designing such a kind of index in order to not visit the table? but in your case the table is made only of those two columns, so why not follow Hermant advise for an Index Organized Table?
    Finally, you can have more details about bitmap indexes in the following richard foot blog article
    http://richardfoote.wordpress.com/2008/02/01/bitmap-indexes-with-many-distinct-column-values-wotsuh-the-deal/
    Best Regards
    Mohamed Houri

  • "analyze index"  vs  "rebuild index"

    Hi,
    I don't undestand the difference between "analyze index" and "rebuild index".
    I have a table where I do a lot of "insert" and "update" and "query", What is the best thing to do ??
    thanks
    Giordano

    When you use dbms_stats.gather_schema_stats package with cascade=>true option, you are also collecting stats for the indexes, no need to collects stats separately using dbms_stats.gather_index_stats.Of course, but I refered to the rebuild index question. Therefore I only mentioned the GATHER_INDEX_STATS.
    Auto_sample_size has many problems/bugs in 9iOk didn't know that - I'm using 10gR2.
    But this discussion made me curious. So I tried something (10gR2):
    CREATE TABLE BIG NOLOGGING AS
    WITH GEN AS (
    SELECT ROWNUM ID FROM ALL_OBJECTS WHERE ROWNUM <=10000)
    SELECT V1.ID,RPAD('A',10) C FROM GEN V1,GEN V2
    WHERE ROWNUM <=10000000;
    SELECT COUNT(*) FROM BIG;
    COUNT(*)
    10000000
    So I had a Table containing 10 Million rows. Now I indexed ID:
    CREATE INDEX BIG_IDX ON BIG(ID)
    I tested two different methods:
    1.) GATHER_TABLE_STATS with estimate 10%
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>10);
    It took about 6 seconds (I only set timing on in sqlplus, no 10046 trace) Now I checked the estimated values:
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'TABLE' OBJECT FROM USER_TABLES WHERE TABLE_NAME='BIG'
    UNION ALL
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'INDEX' OBJECT FROM USER_INDEXES WHERE INDEX_NAME='BIG_IDX';
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9985220 998522 ,1478 TABLE
    9996210 999621 ,0379 INDEX
    2.) GATHER_TABLE_STATS with DBMS_STATS.AUTO_SAMPLE_SIZE
    EXEC DBMS_STATS.DELETE_TABLE_STATS(OWNNAME=>'DIMITRI',TABNAME=>'BIG');
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE);
    It took about 1,5 seconds. Now the results:
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9826851 4715 1,73149 TABLE
    10262432 561326 2,62432 INDEX
    The estimate 10% was more exact - also a 1,7 and 2,6 percent variance is still ok. It's also very interesting, that using AUTO_SAMPLE_SIZE
    causes oracle to execute a estimate 5% for the index and a estimate 0.5 for the table.
    I tried again with a table containing only 1 Million records and oracle did an estimate with 100% for the index.
    So for me I will continue using AUTO_SAMPLE_SIZE. Its very flexible, fast and accurate.
    Dim
    PS: Is there a way to format code like one can do in HTML using <code> or <pre>?

  • Can't rebuid index for failed index

    Hi,
    I got a kind of indexing failure for certain reason, for example, using too long name of dot-notation to specifying a object attribute for indexing. Then I drop the failed index by the following statement:
    drop index myIdx force;
    Then try to re-create the index:
    CREATE INDEX myIdx on test(Descp.FUNC_SUM.FNAME)
    indextype is ctxsys.context
    parameters ('datastore ExpSeq_Summary_Dir
    filter ctxsys.null_filter');
    At this time, the following error happened:
    CREATE INDEX ESIdx on test(DESCP.FUNC_SUM.FNAME)
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-10516: failed to perform DDL operation due to an Oracle error
    DRG-50857: oracle error in driddl.PolicyCreate
    ORA-00001: unique constraint (CTXSYS.DRC$IDX_COLSPEC) violated
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 78
    ORA-06512: at line 1
    It seems always that way if an indexing failed, the index name can't be used any more, even if you do force to drop it.
    Do anybody ever got and know the answer?
    Thanks.

    You need to delete the entry in dr$index table owned by ctxsys for the index you are trying to rebuild. Under certain circumstances this gets left behind and the force option also fails to remove it. Just delete it and you should be able to rebuild the index ok.

  • Error message: User data is not indexed, yet. Index user data first

    Greeting All,
    Each time I try to index a 'Prepared' searchObjectConnector in the cockpit.. I get a message <
    User data is not indexed, yet. Index user data first>. even that I ran the z_ESH_AU_UPLOAD_AUTH_RFC_720 report in R/3 system.. and checked the auth /user data in the admin cockpit.. and it was indexed..
    1.any idea why I keep getting this error
    2.any idea how can I clean the buffer or the message Queu.. my guess this might  be not error but a q message..
    3. any suggestion please
    Thanks

    Hi Areege,
      I noticed that you created an OSS message on this issue. That was a good idea.
    There is an answer for you in OSS from yesterday.
    Kind regards, Klaus

  • Different b/w index rebuild and index rebuild online

    hi..guys could u plz tel me difference between index rebuild and index rebuild online

    There is no difference in both the commands. Both will rebuild the index structure from the scratch.But in the first case with only Rebuild, as long as the index, its temporary segment is not prepared and merged together, index is not available for the other users for use. The Online clause makes the index available for others even while being rebuild.
    Rebuilding index online has the same concept of creating them online to some extent,
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/indexes.htm#3062
    HTH
    Aman....

  • Rebuild index vs Analyze index

    Hi All,
    I am realy confused about rebuilding index versus Analyzing index.
    Could anyone plz help me out what is the diffrence between them.
    How to Perform analyze of indexes and Rebuld of Indexes for both Oracle 9i and 10g databases.
    Thanks a lot

    CKPT wrote:
    You can see the posts of experts by jonathan
    I am realy confused about rebuilding index versus Analyzing index. tell us you are getting confused why we need to ananlyze before reubild index? if so
    if index analyzed the whole statistics of index will be gathered.... then you can check what is the hieght of the index.. according to the height of the index you need to take step is index need to be really rebuild or not...
    lets see furhter posts from experts if not clear..Thanks OK, so you determine the height of an index is (say) 4. What then ? If you decide to rebuild the index and the index remains at a height of 4, what now ? Was it really worth doing and do you rebuild it again as the index height is still 4 and still within your index rebuild criteria ? At what point do you decide that rebuilding the index just because it has a height of 4 is a total waste of time in this case ?
    OK, so you determine the index only has a height of (say) 3, does that mean you don't rebuild the index ? But what if by rebuilding the index, the index now reduces to a height of just 1 ? Perhaps not rebuilding the index even though it has just a height of 3 and doesn't currently meet your index rebuild criteria is totally the wrong thing to do and a rebuild would result in a significantly leaner and more efficient index structure ?
    So what if it's pointless rebuilding an index with a height of 4 but another index with a height of 3 is a perfect candidate to be rebuilt ?
    Perhaps knowing just the height of an index leaves one totally clueless after all as to whether the index might benefit from an index rebuild ...
    Cheers
    Richard Foote
    http://richardfoote.wordpress.com/

  • Index series and index class in asset accounting

    Hi All,
    I have read in the SAP documentation that we need to assign index series to index class. I have not found the place where index class is configured/assigned. Could you please let me know what are the configuration steps for indexing in asset accounting for calculation of replacement value and purpose of each of these steps/fields?
    Regards
    Suresh

    Hi Suresh,
    Revaluation is calculated as follows:                                                                               
    ( KANSW  x Index / Basic ) - KANSW - KAUFW  
    In OAV5: Defining Index Series for Revaluation Posting
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/b0/99a504832f4f10ac6177397dc3a505/frameset.htm
    Store the index in the depreciation area.
    Please also check the button Indicator "posting revaluation" in OAYR and read the F1 Help
    Regards Bernhard

  • Missing Index there Unknown indexes in ABAP Dictionary in DB02

    Dear All,
    I am getting error in T-code DB02 >Missing Index there Unknown indexes in ABAP Dictionary.
    Please  find the following details. 
    Unknown indexes in ABAP Dictionary
        DB indexes                      11
            MARA_MEINS
            MARA_ZER
            MCHA_VFDAT
            VBRP_ARKTX
            VBRP_CHARG
            VBRP_FKIMG
            VBRP_KZWI1
            VBRP_MATKL
            VBRP_MATNR
            VBRP_SPART
            VBRP_WERKS
    Please suggest how to correct them and can caution we have to take before creating the
    Index.
    The process creating the index form se11 table and there index>database utility and than create .The same process can be use .
    Regards,

    Hi,
    Please use the below procdure:
    - Goto transaction SE11
    - Enter table name and press view
    - Click button "Indexes..."
    Please alse check with the below links for more information.
    Index:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb20446011d189700000e8322d00/content.htm
    Creating Secondary Index
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb47446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/1c/252640632cec01e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/c7/55833c4f3e092de10000000a114027/frameset.htm
    Check with this also......[click here|Steps for creating a database index;.
    With Regards,
    Krishna.

  • CDS-18010 Error:A Index and a index with the same name

    Hi
    I am facing strange error is some one expert there to help me to get rid of this error.
    CDS-18010 Error:A Index and a index with the same name 'LA_SP_FK_1' have been asked to be created.
    I am generating tables from Data model diagram & getting this error.
    Thanks,
    Vijay

    Your Right!!
    Designer does not like 2 of the same name.
    there are several bugs on the same name issue and CDS-18010
    Bug.3973155/3443005 (92) CDS-18010 IN CAPTURING A TYPE WITH CONSTRUCTOR FUNTIONS IN ITS BODY:
    Bug.2586582 (93) CDS-18010 A DOMAIN AND A DOMAIN WITH THE SAME NAME 'D1' BEEN ASKED TO CREATE:
    Bug.2561625 (15) CDS-18010 GENERATION OF TWO SYNONYMS WITH SAME NAME BUT DIFFERENT SCOPE:
    Bug.2072505 (93) CDS-18010 CAPTURING 2 TRIGGERS WITH SAME NAME ON ONE TABLE SHOULD BE A WARNING:
    Bug.1689800 (90) CDS-18010 PLSQL WITH THE SAME PROCEDURE NAME ALREADY EXISTS:
    Bug.1073311/1029997 (96) CDS-18010 ERROR ATTEMPTING TO CREATE 2 PROCEDURES WITH SAME NAME:
    Just to name a few.
    I would suggest you change the name.
    Michael

Maybe you are looking for

  • File not found during installation (WinXP)

    Well, I downloaded Oracle 11g for Windows (32 bit) from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html, and, basically, after having had some trouble configuring a new database, I selected the option to (simply) in

  • Access a main function from a child MXML

    Hi im just a beginner in flex.Someone please giude me. I have a main MXML which holds another MXML.Is there any possiblity to access the main MXML component from the child MXML.If there is no possiblity i just want to know how to access the main MXML

  • Convert previously converted raw files with Adobe DNG converter?

    It seems that i am not able to convert my raw files that have already been previously converted to dng with the dng converter.  I am wanting to start editing all over again with the raw image but before i can start editing a raw image, i have to conv

  • New firmware for the N97?

    Anybody know when a new firmware will be released for the N97? Thanks. Solved! Go to Solution.

  • Logic Express/Emagic emi6/2m problem

    I've recently started having a problem with my iBook/Logic Express (7.1.1) and Emagic emi6/2m audio interface. I'm getting regular audio pops and clicks when playing my synth plug-ins (it happens with all the ones I've got) and only happens when I pl