Previous Topic: Maintaining SchemasNext Topic: Modifying a Schema


Dropping an Existing Schema

DROP SCHEMA Statement

To drop a schema, use an SQL DDL DROP SCHEMA statement. This removes the named schema only if no tables or views are associated with it.

CASCADE Option

If you specify the CASCADE option, you also delete:

Considerations

If all tables and indexes on those tables are in a segment in which no other table or index from another schema resides, then you can use the FORMAT utility to erase rows and indexes before using DROP SCHEMA. This will enable more efficient execution.

Example

In the following example, a schema and its associated tables are dropped.

drop schema demoempl cascade;