CREATE UNIQUE INDEX EMP_IDX ON EMPLOYEE (EMP_ID) ;
/* index create - table has sorted data */
CREATE UNIQUE INDEX IDX_INVOICE_ITEMS ON INVOICE_ITEMS
(INVOICE_ID,YEAR,FREQ_CODE,FREQ_NUMBER,FIELD_NUMBER,RECORD_SEQ)
TABLESPACE TS_07
NOLOGGING
NOSORT ;
/* create index - constraint */
ALTER TABLE INVOICE_FORMAT
ADD CONSTRAINT PK_INVOICE_FORMAT PRIMARY KEY(INVOICE_ID)
USING INDEX TABLESPACE PROD_IDX_01;
/* Get index information */
select
a.column_name, a.column_position,a.index_name, b.uniqueness
from user_ind_columns a, user_indexes b
where a.index_name=b.index_name and
a.table_name ='IDX_INVOICE_ITEMS'
order by a.index_name, a.column_position;
/* create bitmap index - table is fairly static,
and has less than 1000 distinct values in the indexed column */
CREATE BITMAP INDEX BIX_INVOICE_ARCHIVE
ON INVOICE_ARCHIVE (SALES_ID)
TABLESPACE PROD_IDX_01;
|
|