Difference between revisions of "ALTER INDEX"

From Lianjapedia
Jump to: navigation, search
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Rebuilds an existing index file for the specified table
 
Rebuilds an existing index file for the specified table
 
  
 
==Syntax==
 
==Syntax==
 
ALTER INDEX <index> ON &#060;table&#062; REBUILD [SHARED | EXCLUSIVE]
 
ALTER INDEX <index> ON &#060;table&#062; REBUILD [SHARED | EXCLUSIVE]
 
  
 
==See Also==
 
==See Also==
 
[[ALTER TABLE]], [[CLOSE DATABASES]], [[CREATE INDEX]], [[CREATE TABLE]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[OPEN DATABASE]]
 
[[ALTER TABLE]], [[CLOSE DATABASES]], [[CREATE INDEX]], [[CREATE TABLE]], [[DROP DATABASE]], [[DROP INDEX]], [[DROP TABLE]], [[OPEN DATABASE]]
 
  
 
==Description==
 
==Description==
Line 15: Line 12:
  
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
!Keywords||Description
+
!width=20%|Keywords||Description
 
|-
 
|-
|index||This is the name of the index being rebuilt.
+
|valign="top"|index||This is the name of the index being rebuilt.
 
|-
 
|-
|table||This is the name of the table for which the index will be rebuilt on.
+
|valign="top"|table||This is the name of the table for which the index will be rebuilt on.
 
|-
 
|-
|REBUILD||Create the index anew using the existing index
+
|valign="top"|REBUILD||Create the index anew using the existing index
 
|-
 
|-
|SHARED||Allows read-only transactions on the table while the index is being rebuilt.
+
|valign="top"|SHARED||Allows read-only transactions on the table while the index is being rebuilt.
 
|-
 
|-
|EXCLUSIVE||Prevents any transactions on the table while the index is being rebuilt.
+
|valign="top"|EXCLUSIVE||Prevents any transactions on the table while the index is being rebuilt.
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
Line 41: Line 37:
  
  
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Latest revision as of 11:03, 30 January 2013

Purpose

Rebuilds an existing index file for the specified table

Syntax

ALTER INDEX <index> ON <table> REBUILD [SHARED | EXCLUSIVE]

See Also

ALTER TABLE, CLOSE DATABASES, CREATE INDEX, CREATE TABLE, DROP DATABASE, DROP INDEX, DROP TABLE, OPEN DATABASE

Description

The ALTER INDEX command is used to rebuild an existing index file for the specified table. The table must be able to be locked for exclusive use during the operation.


Keywords Description
index This is the name of the index being rebuilt.
table This is the name of the table for which the index will be rebuilt on.
REBUILD Create the index anew using the existing index
SHARED Allows read-only transactions on the table while the index is being rebuilt.
EXCLUSIVE Prevents any transactions on the table while the index is being rebuilt.

Example

// Rebuild the index staff_no index on staff table
ALTER INDEX staff_no;
  ON staff;
  REBUILD;
  SHARED