Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / SQL reference.pdf
Скачиваний:
24
Добавлен:
12.05.2015
Размер:
11.92 Mб
Скачать

ALTER CLUSTER

ALTER CLUSTER

Purpose

Use the ALTER CLUSTER statement to redefine storage and parallelism characteristics of a cluster.

Note: You cannot use this statement to change the number or the name of columns in the cluster key, and you cannot change the tablespace in which the cluster is stored.

See Also:

CREATE CLUSTER on page 13-2 for information on creating a cluster

DROP CLUSTER on page 16-67 and DROP TABLE on page 17-6 for information on removing tables from a cluster

Prerequisites

The cluster must be in your own schema or you must have the ALTER ANY

CLUSTER system privilege.

Syntax

alter_cluster::=

 

 

 

physical_attributes_clause

 

 

 

 

 

 

K

 

 

 

 

 

M

 

schema

.

SIZE

integer

parallel_clause

 

 

 

 

ALTER

CLUSTER

 

cluster

 

;

 

 

 

allocate_extent_clause

 

 

 

 

deallocate_unused_clause

 

 

 

 

CACHE

 

 

 

 

NOCACHE

 

9-6 Oracle9i SQL Reference

ALTER CLUSTER

physical_attributes_clause::=

PCTFREE integer

PCTUSED integer

INITRANS integer

MAXTRANS integer

storage_clause

(storage_clause on page 7-56) allocate_extent_clause::=

 

 

 

 

 

K

 

 

 

 

 

 

 

M

 

 

 

 

SIZE

integer

 

 

 

(

DATAFILE

filename

)

 

 

INSTANCE

 

integer

 

 

ALLOCATE

EXTENT

 

 

 

 

 

 

deallocate_unused_clause::=

K

M

KEEP integer

DEALLOCATE UNUSED

parallel_clause::=

NOPARALLEL

integer

PARALLEL

SQL Statements: ALTER CLUSTER to ALTER SEQUENCE 9-7

ALTER CLUSTER

Semantics

schema

Specify the schema containing the cluster. If you omit schema, Oracle assumes the cluster is in your own schema.

cluster

Specify the name of the cluster to be altered.

physical_attributes_clause

Use this clause to change the values of the PCTUSED, PCTFREE, INITRANS, and MAXTRANS parameters of the cluster.

Use the STORAGE clause to change the storage characteristics of the cluster.

Restriction on Physical Attributes You cannot change the values of the storage parameters INITIAL and MINEXTENTS for a cluster.

See Also:

physical_attributes_clause on page 7-52 for a full description of this clause

storage_clause on page 7-56 for a full description of the storage parameters

SIZE integer

Use the SIZE clause to specify the number of cluster keys that will be stored in data blocks allocated to the cluster.

Restriction on SIZE You can change the SIZE parameter only for an indexed cluster, not for a hash cluster.

See Also: CREATE CLUSTER on page 13-2 for a description of the SIZE parameter and "Modifying a Cluster: Example" on page 9-10

allocate_extent_clause

Specify the allocate_extent_clause to explicitly allocate a new extent for the cluster.

9-8 Oracle9i SQL Reference

ALTER CLUSTER

When you explicitly allocate an extent with this clause, Oracle does not evaluate the cluster’s storage parameters and determine a new size for the next extent to be allocated (as it does when you create a table). Therefore, specify SIZE if you do not want Oracle to use a default value.

Restriction on Allocating Extents You can allocate a new extent only for an indexed cluster, not for a hash cluster.

See Also: allocate_extent_clause on page 7-2 for a full description of this clause and "Deallocating Unused Space: Example" on page 9-10

deallocate_unused_clause

Use the deallocate_unused_clause to explicitly deallocate unused space at the end of the cluster and make the freed space available for other segments.

See Also: deallocate_unused_clause on page 7-37 for a full description of this clause

CACHE | NOCACHE

CACHE Specify CACHE if you want the blocks retrieved for this cluster to be placed at the most recently used end of the least recently used (LRU) list in the buffer cache when a full table scan is performed. This clause is useful for small lookup tables.

NOCACHE Specify NOCACHE if you want the blocks retrieved for this cluster to be placed at the least recently used end of the LRU list in the buffer cache when a full table scan is performed. This is the default behavior.

parallel_clause

Specify the parallel_clause to change the default degree of parallelism for queries and DML on the cluster.

Restriction on Parallelized Clusters If the tables in cluster contain any columns of LOB or user-defined object type, this statement as well as subsequent INSERT, UPDATE, or DELETE operations on cluster are executed serially without notification.

SQL Statements: ALTER CLUSTER to ALTER SEQUENCE 9-9

ALTER CLUSTER

Note: The syntax of the parallel_clause supersedes syntax appearing in earlier releases of Oracle. Superseded syntax is still supported for backward compatibility, but may result in slightly different behavior than that documented.

NOPARALLEL Specify NOPARALLEL for serial execution. This is the default.

PARALLEL Specify PARALLEL if you want Oracle to select a degree of parallelism equal to the number of CPUs available on all participating instances times the value of the PARALLEL_THREADS_PER_CPU initialization parameter.

PARALLEL integer Specification of integer indicates the degree of parallelism, which is the number of parallel threads used in the parallel operation. Each parallel thread may use one or two parallel execution servers. Normally Oracle calculates the optimum degree of parallelism, so it is not necessary for you to specify integer.

See Also: "Notes on the parallel_clause" for CREATE TABLE on page 15-54

Examples

The following examples modify the clusters that were created in the "Examples" section of CREATE CLUSTER on on page 13-9.

Modifying a Cluster: Example The next statement alters the personnel cluster:

ALTER CLUSTER personnel

SIZE 1024 CACHE;

Oracle allocates 1024 bytes for each cluster key value and turns on the cache attribute. Assuming a data block size of 2 kilobytes, future data blocks within this cluster contain 2 cluster keys in each data block, or 2 kilobytes divided by 1024 bytes.

Deallocating Unused Space: Example The following statement deallocates unused space from the language cluster, keeping 30 kilobytes of unused space for future use:

ALTER CLUSTER language

DEALLOCATE UNUSED KEEP 30 K;

9-10 Oracle9i SQL Reference

Соседние файлы в папке Oracle selected docs