| Ocsinventory::Agent::Modules::Databases::Oracle::Instances(3pm) | User Contributed Perl Documentation | Ocsinventory::Agent::Modules::Databases::Oracle::Instances(3pm) |
Oracle::Instances - Lib for Oracle instances and versions retrieval
This module provides a function to retrieve information about Oracle instances on the current server.
To do so, the function reads the /etc/oratab file to find instances and then:
This information is found by executing the "tnsping" command and by reading the following XML file:
$ORACLE_HOME/inventory/Components21/oracle.server/*/context.xml
The following bundles are known: SE1 (Standard Edition One), SE (Standard Edition), EE (Enterprise Edition), XE (Express Edition).
{
'SID' => {
'BUNDLE' => 'Standard',
'AUTOSTART' => 0,
'ORA_HOME' => '/home/oracle/oracle/product/11.2.0',
'VERSION' => '11.2.0.4.0'
}
};
Optionally, you can call "getInstances()" to return only the hash of versions and bundles, instead of the complete instances hash:
{
'/home/oracle/oracle/product/11.2.0' => {
'BUNDLE' => 'Standard',
'VERSION' => '11.2.0.4.0'
}
};
In that case, you just have to pass parameter 1 (integer one) when calling the function.
The module exports the "getInstances()" function.
Synopsis
getInstances($version_only)
where $versions_only is a integer (tested as a bool)
my $database = getInstances()
my $versions = getInstances(1)
Return values
The function returns a hash reference containing the instances or versions.
| 2023-01-29 | perl v5.36.0 |