Before dropping a user, it is recommended to first Lock the user.
Here below is the SQL statement to drop a user:
SQL> drop user <user>;
If user owns database objects the above command will not work and use CASCADE clause for users that have database objects.
SQL> drop user <user> CASCADE
Example:
1 2 3 4 5 6 7 8 9 10 11 | SQL> conn sys/orcl@to_primary as sysdba Connected. SQL> drop user mereba; drop user mereba * ERROR at line 1: ORA-01922: CASCADE must be specified to drop 'MEREBA' SQL> drop user mereba cascade ; User dropped. SQL> |
meda Edited answer 22/02/2022