- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how can I drop a database
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 06:39 AM
тАО03-24-2003 06:39 AM
how can I drop a database
I would like to drop a database.
I did:
drop database namedatabase;
but it doesn't work.
How can I do?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 06:45 AM
тАО03-24-2003 06:45 AM
Re: how can I drop a database
- shutdown the database 'shutdown abort'
- delete all datafiles, init
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 06:56 AM
тАО03-24-2003 06:56 AM
Re: how can I drop a database
If your database is of oracle:
login as oracle
$ export DISPLAY=
$dbca (if oracle is 9i)
choose delete a database
if oracle 8i
$svrmgrl
svrmgrl> connect internal
svrmgrl> shudown database
svrmgrl> drop database
If database is DB2:
Login as DB2 user id
$db2 "force application all"
$db2 " drop database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 07:02 AM
тАО03-24-2003 07:02 AM
Re: how can I drop a database
Do the following:
01. Login as connect / as sysdba at svrmgrl
02. startup the database if it's not already started. The database must at least mounted.
03. spool /tmp/deletelist.lst
04. select name from v$datafile; (This will get all the datafiles; alternatively, you can select file_name from dba_data_files)
05. select member from v$logfile;
06. select name from v$controlfile;
07. archive log list (archive_log_dest is where the archived destination is)
08. locating ifile by issuing show parameter ifile (alternatively, check the content of init.ora)
09. spool off
10. Delete in O/S level the files listed in /tmp/deletelist.lst
11. remove all the entries which refer to the deleted database in tnsnames.ora and listener.ora (located in $ORACLE_HOME/network/admin)
12. remove all database links referring to the deleted database.
13. check "/var/opt/oracle/oratab" to make sure there is no entry of the database deleted. If yes, remove it.
14. DONE
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 09:24 PM
тАО03-24-2003 09:24 PM
Re: how can I drop a database
If you do not need this SID any more and do not intend to create a new one of the same name then the simple procedure is.
1. Shutdown the database.
2. Physically delete the data (.dbf) file, redo logs, control files (.ctl).
3. Physically remove the links for the init ora file and configuration files.
4. Remove the entry in the oratab file.
If you need to clean up this database and then intend to create a new one like this, please refer to the attachment which has a step by step procedure for delete a oracle database in UNIX environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 09:43 PM
тАО03-24-2003 09:43 PM
Re: how can I drop a database
Make sure that you are pointing the right ORACLE_SID
01. $svrmgrl
02. startup the database if it's not already started. The database must at least mounted.
svrmgrl>startup mount
03. spool /databasefiles.lst
svrmgrl>spool databasefiles.lst
04. select name from v$datafile; (This will get all the datafiles; alternatively, you can select file_name from dba_data_files)
svrmgrl>select name from v$datafile;
05. select member from v$logfile;
svrmgrl>select * from v$logfile;
06. select name from v$controlfile;
svrmgrl>select * from v$controlfile;
07. archive log list (archive_log_dest is where the archived destination is)
svrmgrl>archive log list;
Go to the destination directory of archive_log_dest parameter and remove all the files.
08. locating ifile by issuing show parameter ifile (alternatively, check the content of init.ora)
09. spool off
svrmgrl>spool off
10. Delete in O/S level the files listed in databasefiles.lst
11. remove all the entries which refer to the deleted database in tnsnames.ora and listener.ora (located in $ORACLE_HOME/network/admin)
12. remove all database links referring to the deleted database.
13. check "/var/opt/oracle/oratab" to make sure there is no entry of the database deleted. If yes, remove it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 09:44 PM
тАО03-24-2003 09:44 PM
Re: how can I drop a database
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2003 10:26 PM
тАО03-24-2003 10:26 PM
Re: how can I drop a database
to add to all those post above, i would recommend that you do a backup first, just in case...
so my steps would be:
Get an error free Export of the entire database before I dropped it. Just in case someone needs any data from that database after it's gone.
With the database running issue and spool the following select statements.
Make sure you are on the correct database:
SELECT name from v$database;
Get a list of all the data files for this database.
SELECT file_name from dba_data_files;
Find the control files for this database:
SELECT name, value from V$parameter
where lower(name) like '%control_files%';
Shutdown the database.
Use Database Configuration Assistant to drop the database
delete the datafiles.
hth
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2003 12:07 AM
тАО03-25-2003 12:07 AM
Re: how can I drop a database
the easiest way to drop database in oracle is do it through GUI.
login as a oracle(oracle owner) user
export your display and run dbassist
same tool u can use for creating databse also.
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2003 06:17 AM
тАО03-25-2003 06:17 AM
Re: how can I drop a database
You might find it handy to:
sqlplus
connect / as sysdba
spool destroy_the_world.sh
SELECT 'rm -f'||file_name from dba_data_files;
spool off
shutdown abort
quit
at the shell prompt, su to root. (After all, root should be the only one allowed to destroy the world)
chmod +x destroy_the_world.sh
destroy_the_world.sh
Using this technique with the other respondents' suggestions for finding files allows you to generate scripts of mass destruction so that if you are just playing with the database creation and destruction, things will be simplier. BTW I've found through years of screwing up, that it's always a good idea to make an off-line backup of the database. In case you change your mind.
Rule #1 in computer science.....
Never do _anything_ you can't undo.
-Good Luck