add container tablespace

This commit is contained in:
garnier-quentin 2019-10-02 11:00:14 +02:00
parent a7e8fc34aa
commit 4928914de0
1 changed files with 123 additions and 125 deletions

View File

@ -122,7 +122,7 @@ sub new {
'free' => { name => 'free' },
'skip' => { name => 'skip' },
'notemp' => { name => 'notemp' },
'container' => { name => 'container' },
'add-container' => { name => 'add_container' },
});
return $self;
@ -137,11 +137,11 @@ sub prefix_tablespace_output {
sub manage_container {
my ($self, %options) = @_;
return if (!defined($self->{option_results}->{container}));
return if (!defined($self->{option_results}->{add_container}));
# request from check_oracle_health.
my $query;
if ($self->{sql}->is_version_minimum(version => '9')) {
return if (!$self->{sql}->is_version_minimum(version => '9'));
my $tbs_sql_undo = q{
-- freier platz durch expired extents
-- speziell fuer undo tablespaces
@ -203,7 +203,7 @@ sub manage_container {
1
};
$query = sprintf(
my $query = sprintf(
q{
SELECT /*+ opt_param('optimizer_adaptive_features','false') */
e.name||'_'||a.tablespace_name "Tablespace",
@ -261,9 +261,7 @@ sub manage_container {
defined($self->{option_results}->{notemp}) ? "AND (b.contents != 'TEMPORARY' AND b.contents != 'UNDO')" : '',
defined($self->{option_results}->{notemp}) ? "" : $tbs_sql_temp
);
} else {
return ;
}
$self->{sql}->query(query => $query);
my $result = $self->{sql}->fetchall_arrayref();
@ -633,7 +631,7 @@ Perfdata show free space
skip temporary or undo tablespaces.
=item B<--container>
=item B<--add-container>
Add tablespaces of container databases.