|
How to Drop Database in Oracle 10g !!!!!!! |
Monday, June 30, 2008 |
It’s quite amazing that a database, healthy or otherwise, can be dropped in under a minute.” Gone in 60 seconds ..."
I knew about the feature, I just thought that I would never use it. Obviously, this is not a production system. It is useful for testing.
Oracle 10g dropping a database is a single command.
Make sure before to drop the DB. Database must be closed. Exclusively mounted Restricted
The DROP DATABASE, which will remove your datafiles, control files, redo logs, and spfile.ora. Your INIT.ora and any password file are retained.
The database should be mounted exclusive, if necessary to prevent others' logins.
I knew about the feature, I just thought that I would never use it. Obviously, this is not a production system. It is useful for testing backups, though.
In order to drop the database start the database in restrict mode and bring it in mount state as shown:
Steps to drop database
Sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 30 16:25:19 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate; oracle database closed oracle database dismounted oracle instance shutdown
SQL> startup mount exclusive restrict;
SQL> drop database; Database dropped
SQL> exit
Note: Thus u will find that all the files associated with the database will be deleted.
OR Run DBCA GUI tool (in ORACLE_HOME/bin subdirectory) and delete the database you do not want. |
posted by Jaswinder Singh @ 5:15 AM |
|
3 Comments: |
-
startup mount; alter system set enable restricted session; and disable resricted session
hope you will be knowing this
-
SQL> alter system enable restricted session;
System altered.
SQL>
-
To drop a table that you no longer need, use the DROP TABLE statement. The table must be contained in your schema or you must have the DROP ANY TABLE system privilege. Caution: Before dropping a table, familiarize yourself with the consequences of doing so:
1. Dropping a table removes the table definition from the data dictionary. All rows of the table are no longer accessible. 2. All indexes and triggers associated with a table are dropped. 3. All views and PL/SQL program units dependent on a dropped table remain, yet become invalid.
|
|
<< Home |
|
|
|
|
|
startup mount;
alter system set enable restricted session;
and disable resricted session
hope you will be knowing this