Friday, November 28, 2008

How to DROP an Oracle Database?

You can do it at the OS level by deleting all the files of the database.
The files to be deleted can be found using:

1) select * from dba_data_files;
2) select * from v$logfile;
3) select * from v$controlfile;
4) archive log list
5) initSID.ora
6) In addition you can clean the UDUMP, BDUMP, scripts etc

Clean up the listener.ora and the tnsnames.ora.
Make sure that the oratab entry is also removed.
With dbca you can easily drop an oracle database.
However you may wish manually to delete a database. The following steps will help you to manually drop a database.

1)Set the Oracle SID of the database which you interested to drop.
On my system it is,

$export ORACLE_SID=dbase

2)Connect to SQL*Plus as SYSDBA privilege.

$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 13 02:41:24 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

3)Mount the database.

SQL> startup force mount

ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 2019288 bytes
Variable Size 92274728 bytes
Database Buffers 67108864 bytes
Redo Buffers 6369280 bytes
Database mounted.

4)Enable restricted session.

SQL> alter system enable RESTRICTED session;
System altered.

5)Drop the database.

SQL> drop database;
Database dropped.

4 comments:

oakleyses said...

nike air max, gucci handbags, ugg boots, louis vuitton outlet, polo ralph lauren, christian louboutin outlet, christian louboutin uk, cheap oakley sunglasses, nike free, tory burch outlet, burberry pas cher, polo outlet, jordan shoes, sac longchamp pas cher, oakley sunglasses, replica watches, louis vuitton, longchamp outlet, oakley sunglasses, nike free run, christian louboutin shoes, ray ban sunglasses, oakley sunglasses wholesale, louis vuitton outlet, nike air max, louis vuitton, louboutin pas cher, tiffany jewelry, prada handbags, nike roshe, oakley sunglasses, air max, prada outlet, ugg boots, nike outlet, tiffany and co, ray ban sunglasses, longchamp outlet, chanel handbags, michael kors pas cher, longchamp pas cher, jordan pas cher, replica watches, polo ralph lauren outlet online, uggs on sale, longchamp outlet, kate spade outlet, christian louboutin

oakleyses said...

ray ban uk, coach purses, polo lacoste, sac vanessa bruno, nike tn, hogan outlet, michael kors, michael kors outlet online, converse pas cher, nike air max uk, kate spade, michael kors outlet, hollister pas cher, uggs outlet, coach outlet, north face, michael kors outlet, north face uk, nike air max uk, ray ban pas cher, uggs outlet, nike air force, ralph lauren uk, mulberry uk, lululemon canada, nike free uk, true religion jeans, guess pas cher, replica handbags, timberland pas cher, nike blazer pas cher, coach outlet store online, michael kors outlet online, burberry handbags, abercrombie and fitch uk, michael kors, nike air max, michael kors outlet, vans pas cher, oakley pas cher, true religion outlet, hollister uk, nike roshe run uk, sac hermes, true religion outlet, new balance, michael kors outlet online, burberry outlet, true religion outlet

oakleyses said...

timberland boots, instyler, wedding dresses, mcm handbags, beats by dre, ghd hair, converse, oakley, herve leger, nike huaraches, hollister, valentino shoes, nfl jerseys, mac cosmetics, vans, abercrombie and fitch, insanity workout, mont blanc pens, hollister clothing, reebok outlet, bottega veneta, louboutin, lululemon, p90x workout, baseball bats, nike roshe run, celine handbags, vans outlet, converse outlet, north face outlet, hermes belt, new balance shoes, north face outlet, ray ban, longchamp uk, jimmy choo outlet, babyliss, ralph lauren, gucci, chi flat iron, soccer jerseys, asics running shoes, iphone cases, ferragamo shoes, hollister, nike trainers uk, soccer shoes, nike air max, giuseppe zanotti outlet, nike air max

oakleyses said...

canada goose, moncler outlet, canada goose outlet, toms shoes, montre pas cher, louis vuitton, moncler, canada goose, swarovski, juicy couture outlet, louis vuitton, replica watches, links of london, moncler, canada goose uk, moncler uk, hollister, wedding dresses, thomas sabo, karen millen uk, canada goose outlet, barbour uk, louis vuitton, ugg uk, ugg,ugg australia,ugg italia, moncler outlet, doudoune moncler, ugg,uggs,uggs canada, canada goose, supra shoes, coach outlet, canada goose outlet, ugg pas cher, ugg, pandora uk, louis vuitton, canada goose jackets, juicy couture outlet, moncler, marc jacobs, louis vuitton, pandora jewelry, lancel, swarovski crystal, pandora jewelry, pandora charms, barbour, moncler