Oracle8i SQL Reference
Release 2 (8.1.6)

A76989-01

Library

Product

Contents

Index

Prev Up Next

SQL Statements (continued), 28 of 30


DROP USER

Syntax


Purpose

To remove a database user and optionally remove the user's objects. For information on creating a user, see "CREATE USER". For information on modifying the definition of a user, see "ALTER USER".

Prerequisites

You must have the DROP USER system privilege.

Keywords and Parameters

user 

is the user to be dropped. Oracle does not drop users whose schemas contain objects unless you specify CASCADE, or unless you first explicitly drop the user's objects. 

CASCADE 

drops all objects in the user's schema before dropping the user. You must specify this clause to drop a user whose schema contains any objects.

  • If the user's schema contains tables, Oracle drops the tables and automatically drops any referential integrity constraints on tables in other schemas that refer to primary and unique keys on these tables.

  • If this clause results in tables being dropped, Oracle also drops all domain indexes created on columns of those tables, and invokes appropriate drop routines.

    See Also: Oracle8i Data Cartridge Developer's Guide for more information on these routines.

  • Oracle invalidates, but does not drop, the following objects in other schemas: views or synonyms for objects in the dropped user's schema; and stored procedures, functions, or packages that query objects in the dropped user's schema.

  • Oracle does not drop materialized views on tables or views in the dropped user's schema, but if you specify CASCADE, the materialized views can no longer be refreshed.

  • Oracle drops all triggers in the user's schema.

  • Oracle does not drop roles created by the user.

 

 

WARNING: Oracle also drops with FORCE all types owned by the user. See the FORCE keyword of "DROP TYPE". 

Examples

If user BRADLEY's schema contains no objects, you can drop BRADLEY by issuing the statement:

DROP USER bradley; 

If BRADLEY's schema contains objects, you must use the CASCADE clause to drop BRADLEY and the objects:

DROP USER bradley CASCADE; 

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index