In previous queries to this forum somebody posted the following answer to
your question.
I have collected them and I am now sending here to you. Hope it helps.
Regards
Maria
Here is the one we use to show us nodes not backed up in two or more days:
/* */
/* macro file to select filespaces that haven't */
/* completed a backup in more than 2 days */
/* */
set sqldatetimeformat i
set sqldisplaymode w
set sqlmathmode r
commit
select left(node_name,16) as node_name, left(filespace_name,32) as
file_space, -
backup_end, current_date - date(backup_end) as days_delinquent from
filespaces -
where (days(current_date) - days(backup_end) >= 2)
how do you take care of selective backups? They are not reflected in the
"date of last backup" field. So, additionally to what has been suggested by
Phil Bone, I usually verify that there are no younger backups in the
filespace by looking through the backups table:
select min(days(current_timestamp)-days(backup_date)) -
from backups where node_name='$1' and filespace_name='$2'
This query is expensive, so I only do it for those candidates determined by
Phil Bone's query. If you can ignore selective backups (e.g. because of your
service level aggreements), fine. In my case, I detected several filespaces
containing actual backups which otherwise would have been deleted
|