+ fix rman incremental backup age

This commit is contained in:
garnier-quentin 2015-11-04 15:05:41 +01:00
parent c8c31b18c2
commit 27a6be829c
1 changed files with 7 additions and 5 deletions

View File

@ -87,10 +87,11 @@ sub run {
if (defined($self->{option_results}->{incremental_level})) {
$query = q{SELECT v$rman_status.object_type,
((max(v$rman_status.start_time) - date '1970-01-01')*24*60*60) as last_time,
v$backup_set_details.incremental_level,
FROM v$rman_status LEFT JOIN v$backup_set_details ON v$rman_status.session_stamp = v$backup_set_details.session_stamp
WHERE operation='BACKUP' and v$backup_set_details.incremental_level is not Null
GROUP BY object_type, incremental_level};
v$backup_set_details.incremental_level
FROM v$rman_status LEFT JOIN v$backup_set_details ON v$rman_status.session_recid = v$backup_set_details.session_recid
WHERE operation='BACKUP'
GROUP BY object_type, incremental_level ORDER BY last_time DESC
};
} else {
$query = q{SELECT object_type,
((max(start_time) - date '1970-01-01')*24*60*60) as last_time
@ -114,7 +115,8 @@ sub run {
next if (defined($already_checked->{$$row[0]}));
if (defined($self->{option_results}->{incremental_level})) {
if (defined($self->{option_results}->{incremental_level})) {
next if (!defined($$row[2])); # skip null incremental
# db incr with incremental level 0 = DB FULL
if (/db full/ && $$row[0] =~ /db incr/i && defined($$row[2]) && $$row[2] == 0) { # it's a full. we get
$$row[0] = 'DB FULL';