An Oracle Index is an object in a relational database used to store each record location in a table. It aims to speed up Data Reading and integrity checks. Index
An Oracle Index is an object in a relational database used to store each record location in a table. It aims to speed up Data Reading and integrity checks. Index
An Oracle Index is an object in a relational database used to store each record location in a table. It aims to speed up Data Reading and integrity checks. Indexing is a highly technical task.
Generally, we need to consider how to design and create indexes in the database design stage.
1. Create an index
Syntax for creating an index:
CREATE [UNIQUE] INDEX [schema.] index
ON [schema.] table (column [ASC | DESC], column [ASC | DESC]...)
[CLUSTER schema. cluster]
[INITRANS n]
[MAXTRANS n]
[PCTFREE n]
[STORAGE storage]
[TABLESPACE tablespace]
[No sort]
Keyword description:
Example: create a product table (tb_product) and create an index for the product_id column of the Table to improve the query efficiency when using this column.
Create table tb_product
(
Product_id number
, Product_name varchar2 (100)
, Product_type varchar2 (20)
, Product_unit varchar2 (50)
, Product_unit_price number (10, 4)
);
The following code creates a unique index on the product_id column:
Create unique index product_id_u1 on tb_product (product_id );
2. Modify the index
The modification of indexes is mainly done by the database administrator. Modifying indexes involves modifying the storage parameters of indexes, re-indexing, and merging useless index spaces.
Modify the index Syntax:
ALTER [UNIQUE] INDEX [user.] index
INITRANS n
MAXTRANS n
REBUILD
[STORAGE ]
Note:
Example:
Use the alter index statement to modify the INDEX parameters:
Alter index product_id_u1 rebuild storage (INITIAL 1 m next 512 K );
Use the alter index statement to change the INDEX to a reverse INDEX:
Alter index product_id_u1 rebuild reverse;
Use the alter index statement to merge the INDEX space:
Alter index product_id_u1 COALESCE;
3. delete an index
You can use the DROP statement to delete an index.
Drop index schema. index;
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian
Sharing pool for Oracle Performance Optimization
Author: David contact: david.louis.tian@outlook.com