Ocsinve...stances(3)
πΈ NAME πΈ
okay so bestie, this is Ocsinve...stances(3) from User Contributed Perl Documentation, and the module is Oracle::Instances β Lib for Oracle instances and versions retrieval. Thatβs the whole name vibe: instances and versions, retrieved, slay. π
π¦ DESCRIPTION π¦
This module provides a function to retrieve information about Oracle instances on the current server. Itβs giving βI know whatβs running on this boxβ energy, no cap.
To do so, the function reads the /etc/oratab file to find instances and then:
- Checks the existence of the
ORACLE_HOMEdirectory. Basically a filesystem vibe check β does the directory exist? We love to see it. π - Adds
(ORACLE_SID, ORACLE_HOME, AUTOSTART)to the databases hash. The little trio is in the hash, periodt. - Goes and finds the server version and bundle for each
ORACLE_HOME. This information is found by executing thetnspingcommand 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). Thatβs the bundle lineup, bestie β know the roster. π
- Returns the database hash as follows:
{
'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. One little 1 and you get the versions-only cut. β¨
π Exports π
The module exports the getInstances() function. Thatβs the whole exports list β short, sweet, iconic. π«Ά
π getInstances() π
β¨ 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. Thatβs the return vibe, bestie β a hash ref with your instances or your versions depending on how you called it. π
xoxo, this page came from perl v5.32.1, dated 2026-06-05 β bye bestie! πβ¨
π¦ where this page comes from
- epel 9: perl-Ocsinventory-Agent 2.10.5-2.el9 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms