Identifying Netezza Backupsets

This is more a note to self than anything…

Each week we run FULL backups against our databases, and write the backup files to disk.  In the past we kept the most current backup on disk for a week, and deleted it after the backups have been saved to tape.

Then we start the cycle all over again, and write the latest backup to disk.  At most we never had more than one backup retained on disk.

To add to our vulnerability we deleted the previous week’s backup on Friday morning.  It takes about 6 hours to do the deletes… On Friday at midnight we start the next full backups. 

But we are particularly vulnerable between the DELETE and the next FULL backup.  There’s about an 18 hour period where we don’t have any backups on disk.

To mitigate that, we are going to keep 2 weeks of backups on disk.  But before we write the 3rd backup we need to delete the first (oldest) backup.

The following command will identify the 2nd oldest backupset.  Once we have the backup set, we have all the info we need to delete the directory structure of the 2nd oldest backup before running the next FULL backup.

nzbackup -history -db myDBName | grep FULL | tail -2 | head -1 | awk ‘{print $2}’

There’s nothing complicated going on here, though it looks like a lot.  To gain a better appreciation for this, just run the commands left to right to see the impact of the succeeding command in the pipeline.

Stay curious; keep learning.


Leave a Reply

You must be logged in to post a comment.

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>