From 2d73e1b3b064ff7e6c1c80e8ef7c40ac928451b0 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 15 Feb 2017 10:12:36 +0100 Subject: [PATCH] + fix oracle request --- database/oracle/mode/rmanbackupage.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/database/oracle/mode/rmanbackupage.pm b/database/oracle/mode/rmanbackupage.pm index c949ea44a..df6e53076 100644 --- a/database/oracle/mode/rmanbackupage.pm +++ b/database/oracle/mode/rmanbackupage.pm @@ -85,12 +85,12 @@ sub run { $self->{sql}->connect(); my $query; if (defined($self->{option_results}->{incremental_level})) { - $query = q{SELECT v$rman_status.object_type, + $query = q{SELECT v$rman_status.object_type, ((max(v$rman_status.start_time) - date '1970-01-01')*24*60*60) as last_time, - NVL(v$backup_set_details.incremental_level, 0) + SUM(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 + GROUP BY object_type, v$backup_set_details.session_recid ORDER BY last_time DESC }; } else { $query = q{SELECT object_type, @@ -114,13 +114,12 @@ sub run { foreach my $row (@$result) { if (defined($self->{option_results}->{incremental_level})) { # 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 + if (/db full/ && $$row[0] =~ /db incr/i && (!defined($$row[2]) || $$row[2] == 0)) { # it's a full. we get $$row[0] = 'DB FULL'; } else { - next if (/db incr/ && $$row[0] =~ /db incr/i && defined($$row[2]) && $$row[2] == 0); # it's a full. we skip. + next if (/db incr/ && $$row[0] =~ /db incr/i && (!defined($$row[2]) || $$row[2] == 0)); # it's a full. we skip. next if ($$row[0] !~ /$_/i); } - } else { next if ($$row[0] !~ /$_/i); }