1

I noticed that when the BACKUP DATABASE command is issued without the TO clause the backup file is stored to the working directory where the command is issued.

I'm wondering if it's possible to configure a default location for backups such that it's used when the location is not specified in the command.

What if the free space on the storage is not enough? Is there a setting to tell DB2 to automatically remove the oldest backup as for circular logging?

1 Answer 1

3

No, it's not possible to specify a default location. The best way to do this would be to write a shell script (which specifies your location of choice) to handle your backups.

You can have DB2 remove old backups (using the AUTO_DEL_REC_OBJ database configuration parameter with proper values for NUM_DB_BACKUPS and REC_HIS_RETENTN), but that will only occur after a successful backup.

So you'll need to ensure that there is enough space for the backup to complete successfully.

3
  • And archiving logs to disk..... From what I have experienced even logretain doesn't clean up logs. Just a point I figured worth mentioning. Commented Jun 20, 2016 at 12:45
  • @ChrisAldrich Yes, that's correct. Setting LOGRETAIN does just what it says - retains logs. :-) Commented Jun 21, 2016 at 18:01
  • 1
    Yup. That's why I thought I would mention it. I first assumed AUTO_DEL_REC_OBJ would clean up logs as well when LOGRETAIN was set. Nope. Took me a bit to figure out I needed to set logs to DISK. Just figured it was worth mentioning here for others to not get caught on that one. Commented Jun 22, 2016 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.