Difference between revisions of "Delete / drop database"

From dbawiki
Jump to: navigation, search
(Created page with "==Windows== ===Check where the ORACLE_HOME for this instance is=== <pre> Start:Run... services.msc </pre> Double click on OracleService<SID>, the first part of "Path to execut...")
 
Line 27: Line 27:
 
Delete the files and directories shown by above queries
 
Delete the files and directories shown by above queries
 
</pre>
 
</pre>
<pre>
 
 
Check in Registry to make sure entries have gone from HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<home>
 
Check in Registry to make sure entries have gone from HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<home>
 
==Unix==
 
==Unix==

Revision as of 08:31, 17 May 2017

Windows

Check where the ORACLE_HOME for this instance is

Start:Run... services.msc

Double click on OracleService<SID>, the first part of "Path to executable" is the home or regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE See list of homes

Find location of files to delete

Connect as sys and

select name from v$datafile;
select member from v$logfile;
show parameter control
show parameter dump
show parameter archive_dest

Stop the services related to the instance

set ORACLE_HOME=<oracle home>
oradim -delete -sid <SID>
*Clean up database files:
delete %ORACLE_HOME%\database\PWD<SID>.ora and any pfile, spfile and .dat files
Delete the files and directories shown by above queries

Check in Registry to make sure entries have gone from HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_<home>

Unix

Clean up RMAN repository

rman target sys/sys@DBTOGO catalog rman/rman@rmancat
RMAN> unregister database;
. oraenv
DBTOGO
dbca -silent -deleteDatabase -sourceDB DBTOGO
Connecting to database
4% complete
…
100% complete