Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to drop administrative user in oracle 12c

Tags:

oracle12c

I am not able to drop a user created by me which has administrative rights.

I am running below command:

drop user GOVIND CASCADE;

This is the error I am getting:

ERROR at line 1:
ORA-28014: cannot drop administrative users
like image 998
Govind Gupta Avatar asked Apr 09 '18 08:04

Govind Gupta


People also ask

Can not drop administrative users?

For dropping the user present in Container ROOT, we need to use the hidden parameter “_ORACLE_SCRIPT”. SQL> alter session set "_oracle_script"=true; Session altered.

How do I drop a DBA in Oracle?

You must have the DROP USER system privilege. Specify the user to be dropped. Oracle Database does not drop users whose schemas contain objects unless you specify CASCADE or unless you first explicitly drop the user's objects. Specify CASCADE to drop all objects in the user's schema before dropping the user.

Can not drop a user that is currently connected Oracle?

Cause: An attempt was made to drop a user that was currently logged in. Action: Make sure the user is logged out, then re-execute the command. The ORA-01940 can always be cured by bouncing the source and replicated instance. First, double-check to ensure that the user is not connected to the current instance.

How do I drop a user table?

Show activity on this post. BEGIN FOR c IN (SELECT table_name FROM user_tables) LOOP EXECUTE IMMEDIATE ('DROP TABLE "' || c. table_name || '" CASCADE CONSTRAINTS'); END LOOP; FOR s IN (SELECT sequence_name FROM user_sequences) LOOP EXECUTE IMMEDIATE ('DROP SEQUENCE ' || s.


1 Answers

set _oracle_script to TRUE and execute drop command as below.

alter session set "_oracle_script"=true;

Session altered

drop user APEX_050000 cascade;

User dropped.

like image 85
Govind Gupta Avatar answered Sep 18 '22 14:09

Govind Gupta