From dd00c9b4e93680dff194d9725950bdcbaeffadb6 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 26 Sep 2019 15:26:11 +0200 Subject: [PATCH] update tablespace calc oracl --- database/oracle/mode/tablespaceusage.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/database/oracle/mode/tablespaceusage.pm b/database/oracle/mode/tablespaceusage.pm index aa6352ad4..ebe873c9a 100644 --- a/database/oracle/mode/tablespaceusage.pm +++ b/database/oracle/mode/tablespaceusage.pm @@ -385,16 +385,19 @@ sub manage_selection { } my ($percent_used, $percent_free, $used, $free, $size); - if ((!defined($bytes_max)) || ($bytes_max == 0)) { - $percent_used = ($bytes - $bytes_free) / $bytes * 100; - $size = $bytes; - $free = $bytes_free; - $used = $size - $free; - } else { + if ((!defined($bytes_max)) || ($bytes_max eq '')) { + $self->{output}->output_add(long_msg => "skipping '" . $name . "': bytes max not defined.", debug => 1); + next; + } elsif ($bytes_max > $bytes) { $percent_used = ($bytes - $bytes_free) / $bytes_max * 100; $size = $bytes_max; $free = $bytes_free + ($bytes_max - $bytes); $used = $size - $free; + } else { + $percent_used = ($bytes - $bytes_free) / $bytes * 100; + $size = $bytes; + $free = $bytes_free; + $used = $size - $free; } $self->{tablespace}->{$name} = {