Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup after large deletion extremely slow/looping?

Status
Not open for further replies.

Filer

MIS
Jun 19, 2002
5
US
I am having problems deleting 1.6 million records from my Interbase 4.0 database. The records contain BLOB data.

A backup run before the deletion completed in an hour. After the deletion, the backup ran for four hours and then I had to kill it. I ran data validations before and after the deletion and there was no corruption found. The deletion took 20 minutes to complete and showed no problems. I cannot determine whether there is a problem with the backup process or it just takes that long.

Any help is greatly appreciated.
 
Hi,

Turn OFF garbage collection during the backup process - it will speed up the backup. However, "garbage" (old record data) needs to be deleted - this will be done when the user does, for example, a SELECT * FROM tablewhereyoudeletedalargenumberofrows ... InterBase 6 and 7 have several improvements related to the garbage collection process.

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
Thank you for your response.

Does that mean that the backup after the purge is working correctly, even though it is taking forever?
 
Yes, it should work... But the problem is the time - if you want "just" to back up, turn OFF garbage collection. The database will continue to function...

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
Thank you!

The goal is to reduce the size of the database. As long as I know the backup with garbage collection is working, I will schedule time to allow it to finish.
 
But the size will only decrease if you restore afterwards. Garbage collection does not shrink your db - it merely "flags" removed records as "empty space" - ready to be reused by new records.

To shrink the file, you have to restore your db - but in order to restore, you don't need to garbage collect anyway (as you will be using a completely new file, with no garbage in it)

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
Sorry it wasn't clear, but I was always planning to do a restore after the backup.

You are saying I can do a backup with garbage collection off (it will run quicker) and a restore and this will shrink my database.

Wonderful!

Thank you for all your help.

 
Yes, you can - garbage collection is only useful when you continue working with that particular db file. If you plan on destroying it anyway, turn off garbage collection when creating the backup.


Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top