|Oracle9i SQL Reference
Release 1 (9.0.1)
Part Number A90125-01
DROP SEQUENCE to ROLLBACK, 4 of 20
TABLE statement to remove a table or an object table and all its data from the database.
You cannot roll back a
For an external table, this statement removes only the table metadata in the database. It has no affect on the actual data, which resides outside of the database.
Dropping a table invalidates the table's dependent objects and removes object privileges on the table. If you want to re-create the table, you must regrant object privileges on the table, re-create the table's indexes, integrity constraints, and triggers, and respecify its storage parameters. Truncating has none of these effects. Therefore, removing rows with the
TRUNCATE statement can be more efficient than dropping and re-creating a table.
- CREATE TABLE for information on creating tables
- ALTER TABLE for information on modifying tables
for information on how to remove data from a table without dropping the table
The table must be in your own schema or you must have the
TABLE system privilege.
Text description of
Keywords and Parameters
Specify the schema containing the table. If you omit schema, Oracle assumes the table is in your own schema.
Specify the name of the table, object table, or index-organized table to be dropped. Oracle automatically performs the following operations:
- Removes all rows from the table.
- Drops all the table's indexes and domain indexes, regardless of who created them or whose schema contains them. If table is partitioned, any corresponding local index partitions are also dropped.
- Drops all the storage tables of table's nested tables and LOBs.
- If you drop a range-partitioned or hash-partitioned table, drops all the table partitions. If you drop a composite-partitioned table, all the partitions and subpartitions are also dropped.
- For an index-organized table, drops any mapping tables defined on the index-organized table.
- For a domain index, this statement invokes the appropriate drop routines.
Oracle9i Data Cartridge Developer's Guide for more information on these routines
- If any statistic types are associated with the table, Oracle disassociates the statistics types with the
FORCE clause and removes any user-defined statistics collected with the statistics type.
- If the table is not part of a cluster, Oracle returns all data blocks allocated to the table and its indexes to the tablespaces containing the table and its indexes.
To drop a cluster and all its the tables, use the
CLUSTER statement with the
TABLES clause to avoid dropping each table individually. See DROP CLUSTER.
- If the table is a base table for a view, a container or master table of a materialized view, or if it is referenced in a stored procedure, function, or package, Oracle invalidates these dependent objects but does not drop them. You cannot use these objects unless you re-create the table or drop and re-create the objects so that they no longer depend on the table.
- If you choose to re-create the table, it must contain all the columns selected by the subqueries originally used to define the materialized views and all the columns referenced in the stored procedures, functions, or packages. Any users previously granted object privileges on the views, stored procedures, functions, or packages need not be regranted these privileges.
- If the table is a master table for a materialized view, the materialized view can still be queried, but it cannot be refreshed unless the table is re-created so that it contains all the columns selected by the materialized view's subquery.
- If the table has a materialized view log, Oracle drops this log and any other direct-path
INSERT refresh information associated with the table.
Restriction: You cannot directly drop the storage table of a nested table. Instead, you must drop the nested table column using the
CONSTRAINTS to drop all referential integrity constraints that refer to primary and unique keys in the dropped table. If you omit this clause, and such referential integrity constraints exist, Oracle returns an error and does not drop the table.
The following statement drops the
DROP TABLE oe.orders;