Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, santhoshreddy.

Asked: November 07, 2016 - 8:07 am UTC

Last updated: November 09, 2016 - 1:53 am UTC

Version: 11g

Viewed 10K+ times! This question is

You Asked

Hi,
If i Drop a shema with DROP SCHEMA <name> RESTRICT,Will oracle also drop tha USER associated with that Schema?

and Connor said...

SQL> drop schema XXX;
drop schema XXX
     *
ERROR at line 1:
ORA-00950: invalid DROP option



Not sure what you mean here.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Not about the RDBMS, maybe ?

J. Laurindo Chiappa, November 07, 2016 - 1:44 pm UTC

Probably santhoshreddy is talking about JAVADB, Oracle´s implementation of derby dbms , as http://docs.oracle.com/javadb/10.10.1.2/ref/rrefsqlj31648.html and http://www.oracle.com/technetwork/pt/java/javadb/overview/index.html refers : of course, for the mainline Oracle RDBMS product, no DROP SCHEMA exists...

Regards,

J. Laurindo Chiappa
Connor McDonald
November 09, 2016 - 1:47 am UTC

Thanks for the input

Santhosh, November 08, 2016 - 2:12 am UTC

For example I created a user santhosh and some objects in santhosh schema.
I dropped schema santhosh,then can I login to santhosh account.
Connor McDonald
November 09, 2016 - 1:53 am UTC

From the docs on CREATE SCHEMA

Use the CREATE SCHEMA statement to create multiple tables and views and perform multiple grants in your own schema in a single transaction.

To execute a CREATE SCHEMA statement, Oracle Database executes each included statement. If all statements execute successfully, then the database commits the transaction. If any statement results in an error, then the database rolls back all the statements.

Note:
This statement does not actually create a schema. Oracle Database automatically creates a schema when you create a user (see CREATE USER). This statement lets you populate your schema with tables and views and grant privileges on those objects without having to issue multiple SQL statements in multiple transactions.