Sunday, January 27, 2013

Drop a database in oracle


are you sure you want to drop your database . Be careful........................

To drop a database DBA mostly use sql prompt. Steps are basically first mount the database in exclusive mode then drop the database.


Ex:-
sql> startup mount exclusive restrict
ORACLE instance started.

Total System Global Area 209715200 bytes
Fixed Size 1248164 bytes
Variable Size 142607452 bytes
Database Buffers 62914560 bytes
Redo Buffers 2945024 bytes
Database mounted.

sql> drop database;
we can also drop the database using RMAN prompt after mounting the database in exclusive mode.
(connect to rman and issue the following)

RMAN> drop database;

database name is "TEST" and DBID is 396604920
Do you really want to drop the database (enter YES or NO)?

so, if you really want to drop the database type yes and enter.
you can easily overstep the confirmation prompt by adding "noprompt" in the above mention command.

drop database command will delete all the datafiles,control files and redo files. if you want to delete all the corresponding backups also just issue the following command.

RMAN> drop database including backups ;

No comments:

Post a Comment

Followers