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

DISASSOCIATE STATISTICS

DISASSOCIATE STATISTICS

Purpose

Use the DISASSOCIATE STATISTICS statement to disassociate a statistics type (or default statistics) from columns, standalone functions, packages, types, domain indexes, or indextypes.

See Also: ASSOCIATE STATISTICS on page 12-50 for more information on statistics type associations

Prerequisites

To issue this statement, you must have the appropriate privileges to alter the base object (table, function, package, type, domain index, or indextype).

16-64 Oracle9i SQL Reference

DISASSOCIATE STATISTICS

Syntax

disassociate_statistics::=

DISASSOCIATE

STATISTICS

FROM

 

 

 

 

 

,

 

 

 

schema

 

.

 

 

COLUMNS

 

 

table

.

column

 

 

 

,

 

 

 

schema

.

 

 

FUNCTIONS

 

 

function

 

 

 

 

 

,

 

 

 

schema

 

.

 

 

PACKAGES

 

 

package

 

 

 

,

 

 

 

FORCE

 

 

 

 

;

 

 

 

 

 

 

schema

.

 

 

 

TYPES

 

 

type

 

 

 

 

,

 

 

 

 

schema

 

.

 

 

INDEXES

 

 

index

 

 

 

 

 

,

 

 

 

schema

.

 

 

INDEXTYPES

 

 

indextype

 

Semantics

FROM COLUMNS | FUNCTIONS | PACKAGES | TYPES | INDEXES | INDEXTYPES

Specify one or more columns, standalone functions, packages, types, domain indexes, or indextypes from which you are disassociating statistics.

If you do not specify schema, Oracle assumes the object is in your own schema.

If you have collected user-defined statistics on the object, the statement fails unless you specify FORCE.

SQL Statements: CREATE TYPE to DROP ROLLBACK SEGMENT 16-65

DISASSOCIATE STATISTICS

FORCE

Specify FORCE to remove the association regardless of whether any statistics exist for the object using the statistics type. If statistics do exist, the statistics are deleted before the association is deleted.

Note: When you drop an object with which a statistics type has been associated, Oracle automatically disassociates the statistics type with the FORCE option and drops all statistics that have been collected with the statistics type.

Example

Disassociating Statistics: Example This statement disassociates statistics from the pack package in the hr schema:

DISASSOCIATE STATISTICS FROM PACKAGES oe.emp_mgmt;

16-66 Oracle9i SQL Reference

DROP CLUSTER

DROP CLUSTER

Purpose

Use the DROP CLUSTER clause to remove a cluster from the database.

You cannot uncluster an individual table. Instead you must perform these steps:

1.Create a new table with the same structure and contents as the old one, but with no CLUSTER clause.

2.Drop the old table.

3.Use the RENAME statement to give the new table the name of the old one.

4.Grant privileges on the new unclustered table, as grants on the old clustered table do not apply.

See Also: CREATE TABLE on page 15-7, DROP TABLE on page 17-6, RENAME on page 17-86, GRANT on page 17-29 for information on these steps

Prerequisites

The cluster must be in your own schema or you must have the DROP ANY CLUSTER system privilege.

Syntax

drop_cluster::=

 

 

 

 

CASCADE

CONSTRAINTS

 

schema

.

INCLUDING

TABLES

 

DROP

CLUSTER

cluster

 

 

;

Semantics

schema

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

SQL Statements: CREATE TYPE to DROP ROLLBACK SEGMENT 16-67

DROP CLUSTER

cluster

Specify the name of the cluster to be dropped. Dropping a cluster also drops the cluster index and returns all cluster space, including data blocks for the index, to the appropriate tablespace(s).

INCLUDING TABLES

Specify INCLUDING TABLES to drop all tables that belong to the cluster.

CASCADE CONSTRAINTS

Specify CASCADE CONSTRAINTS to drop all referential integrity constraints from tables outside the cluster that refer to primary and unique keys in tables of the cluster. If you omit this clause and such referential integrity constraints exist, Oracle returns an error and does not drop the cluster.

Example

Dropping a Cluster: Examples The following examples drop the clusters created in the "Examples" section of CREATE CLUSTER on on page 13-9.

The following statements drops the language cluster:

DROP CLUSTER language;

This statement drops the personnel cluster as well as tables dept_10 and dept_ 20 and any referential integrity constraints that refer to primary or unique keys in those tables:

DROP CLUSTER personnel

INCLUDING TABLES

CASCADE CONSTRAINTS;

16-68 Oracle9i SQL Reference

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