VBTK::DBI::OraTableSpace - Monitoring of Oracle database tablespaces
# If you like all the defaults, then there's no need to over-ride them. $o = new VBTK::DBI::OraTableSpace ( DSN => 'oracle.world', User => 'scott', Auth => 'tiger' ); $vbObj = $o->addVBObj (); VBTK::runAll;
This perl module is a front-end to the VBTK::DBI class. It supports the same public methods as the VBTK::DBI class, but with common defaults to simplify the setup of a process to monitor tablespace usage in an Oracle database.
The following methods are supported
This method calls 'new VBTK::DBI' after defaulting the parameters to best monitor tablespace usage in an Oracle database. For a detailed description of the parameters, see VBTK::DBI. The defaults are as follows. If you like all the defaults then you don't have to pass in any parms, except for the DSN, User, and Auth parameters, which are required. Not all allowed parameters are listed here, just those which are defaulted.
Interval => 120,
Attr => 'Oracle',
VBHeader => [ 'time tablespace tot_mb free_mb used max_ext', '------------------ --------------------- ------- ------- ---- -------' ],
VBDetail => [ '@<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<< @>>>>>> @>>>>>> @>>% @>>>>>>', '$time,$data[0],int($data[1]),int($data[2]),int($data[3]),int($data[4])' ],
Same as VBDetail, but for the log file.
SqlClause => q( select DT_TS_NAME, Sum_Alloc_Blocks * DB_BLOCK_FACTOR, Sum_Free_Blocks * DB_BLOCK_FACTOR, 100-(100*Sum_Free_Blocks/Sum_Alloc_Blocks) AS PCT_USED, Max_Blocks * DB_BLOCK_FACTOR from (select Tablespace_Name DT_TS_NAME, SUM(Blocks) Sum_Alloc_Blocks from DBA_DATA_FILES group by Tablespace_Name), (select Tablespace_Name FS_TS_NAME, MAX(Blocks) AS Max_Blocks, SUM(Blocks) AS Sum_Free_Blocks from DBA_FREE_SPACE group by Tablespace_Name), (select (value / 1024 / 1024) DB_BLOCK_FACTOR from v\$parameter where name = 'db_block_size') where DT_TS_NAME = FS_TS_NAME order by PCT_USED DESC ),
This method calls VBTK::DBI::addVBObj after defaulting unspecified parameters to best monitor tablespace usage in an Oracle database. For a detailed description of the addVBObj parameters, see VBTK::Parser. The defaults are as follows. If you like all the defaults then you don't have to pass in any parms. Note that in this case, a separate VBObject is setup for each tablespace.
Construct a VBObjName using the Host, User, and DSN strings. Note that the User and DSN strings are checked for '.' characters and any found are converted to '-', so that we don't mess up the object's place in the hierarchy.
VBObjName => ".<HOST>.db.<User>@<DSN>.dbspace.<tablespace-name>",
TextHistoryLimit => 50,
item ReverseText
ReverseText => 1,
Only show the rows for the current tablespace.
Filter => '$data[0] eq <tablespace-name>',
If the tablespace contains the work 'TEMP', then the following defaults are applied. Temp tablespace should never get very full, so we set the thresholds lower.
Rules => { '$data[3] > 30' => 'Warn', '$data[3] > 40' => 'Fail' },
Otherwise the following defaults are applied:
Rules => { '$data[3] > 92' => 'Warn', '$data[3] > 94' => 'Fail' },
Limit to storing the last 30 status changes
StatusHistoryLimit => 30,
ExpireAfter => '(<Interval> * 3) seconds',
Description = qq( This object monitors the tablespaces in <DSN>. );
Store the pct utiliziation in the Rrd db, so that it can be graphed.
RrdColumns => [ 'int($data[3])' ],
Use the 'MAX' consolidation function.
RrdCF => 'MAX',
In addition to passing these defaults on in a call to VBTK::Wrapper::addVBObj, this method captures the resulting VBTK::ClientObject pointer ($vbObj) and makes the following calls to '$vbObj->addGraphGroup':
$vbObj->addGraphGroup ( GroupNumber => 1, Labels => 'pct-full', Title => "Tablespace Utilization for <DSN>.<tablespace-name>", CF => 'MAX', );
Finally, a second graph group is added which combines all the tablespace usage into a single graph.
$vbObj->addGraphGroup ( GroupNumber => 2, DataSourceList => <list of tablespace-utilization object names>, Labels => <list of tablespace names>, Title => "Tablespace Utilization for <DSN>", CF => 'MAX', );
This defines two graphGroups for the VBObject. See VBTK::ClientObject for details on the 'addGraphGroup' method.
Brent Henry, vbtoolkit@yahoo.com
Copyright (C) 1996-2002 Brent Henry
This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation available at: http://www.gnu.org/copyleft/gpl.html
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
To install VBTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VBTK
CPAN shell
perl -MCPAN -e shell install VBTK
For more information on module installation, please visit the detailed CPAN module installation guide.