Tuesday, October 16, 2007

How to drop the database?

To drop the target database using RMAN
--------------------------------------
In 10G, it is possible to drop the target database using
RMAN command "DROP DATABASE".
Its complete syntax is as follows:
DROP DATABASE;
DROP DATABASE NOPROMPT;
DROP DATABASE INCLUDING BACKUPS;
DROP DATABASE INCLUDING BACKUPS NOPROMPT;

Note: When "NOPROMPT" is specified RMAN does not prompt
you for confirmation before deleting the database.
By default, RMAN prompts for confirmation.
Usage of "DROP DATABASE" command:
Without recovery catalog:
-------------------------

1) RMAN> DROP DATABASE;
Deletes the target database.
Following database files are removed at Operating system level:
Datafiles
Logfiles
Controlfiles
Spfile

2) RMAN> DROP DATABASE INCLUDING BACKUPS;
In addition to (1), the above command also removes the following files:
Archivelogs
Backup pieces generated by RMAN for the target database

With recovery catalog:
----------------------
When you executed the "DROP DATABASE" command with RMAN connected to
recovery catalog, RMAN also unregisters the target database.
Restrictions and Usage Notes:
-----------------------------
* Execute this command only at the RMAN prompt.
* You must be connected to the target database, which must mounted
exclusive and not open.
* If you want RMAN to delete archived logs, copies, and backups belonging
to the database, then you must use the DROP DATABASE INCLUDING BACKUPS
syntax of the command.
* This command doesn't remove following files:
init.ora
password file
* If the operating system is Windows NT/2000, then it does not delete the
windows NT service for the target database instance.
.