If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Deleting Databases

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-03, 11:00
deastley deastley is offline
Registered User
 
Join Date: Oct 2003
Posts: 4
Deleting Databases

I need to completely delete a database from a DB2 8.1 install.

The database was a failed DB2 restore, when running the abort command for the restore, it failed. Trying to drop the database returned an error.

So I deleted the actual files for the database. but it still existed when running db2 list db directory. So I uncataloged it. But when trying to start again I end up with a message about the db being in the local directory. So I cataloged it again and tryed the drop command again. But still no luck - now I get a

SQL1036C An I/O error occurred while accessing the database. SQLSTATE=58030

Any ideas,

All I want to do is get rid of this damn database!!!!
Reply With Quote
  #2 (permalink)  
Old 10-27-03, 12:14
koganti koganti is offline
Registered User
 
Join Date: Jul 2002
Location: ATL
Posts: 170
Re: Deleting Databases

Try to Uncatalog the database you are trying to delete.
Also go to each directory of the containers of your database and delete them.
Make sure you cleaned up all the containers of all your tablespaces.Even if one container exist the restore will fail.

Good Luck

Quote:
Originally posted by deastley
I need to completely delete a database from a DB2 8.1 install.

The database was a failed DB2 restore, when running the abort command for the restore, it failed. Trying to drop the database returned an error.

So I deleted the actual files for the database. but it still existed when running db2 list db directory. So I uncataloged it. But when trying to start again I end up with a message about the db being in the local directory. So I cataloged it again and tryed the drop command again. But still no luck - now I get a

SQL1036C An I/O error occurred while accessing the database. SQLSTATE=58030

Any ideas,

All I want to do is get rid of this damn database!!!!
Reply With Quote
  #3 (permalink)  
Old 10-27-03, 13:03
deastley deastley is offline
Registered User
 
Join Date: Oct 2003
Posts: 4
yup done all that.

Now I'm left with the database listed in:

db2 list db directory on /home/db2inst1

and not in

db2 list db directory


any ideas how to get rid of it from the local database directory?
Reply With Quote
  #4 (permalink)  
Old 10-27-03, 13:45
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
catalog database <dbname> on /home/db2inst1

drop database <dbname>

This will help you to elegantly drop the databases ..

If you want to delete the files manually,

delete the directory structure under /home/db2inst1/db2inst1

But, remember you still will have stuff hanging around various places (for eg. /var/db2 ) ... Hence the best approach is to go the db2 way to get rid of the databases and instances

Sathyaram

Quote:
Originally posted by deastley
yup done all that.

Now I'm left with the database listed in:

db2 list db directory on /home/db2inst1

and not in

db2 list db directory


any ideas how to get rid of it from the local database directory?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On