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:

  1. Checks the existence of the ORACLE_HOME directory. Basically a filesystem vibe check β€” does the directory exist? We love to see it. πŸ’–
  2. Adds (ORACLE_SID, ORACLE_HOME, AUTOSTART) to the databases hash. The little trio is in the hash, periodt.
  3. Goes and finds the server version and bundle for each ORACLE_HOME. 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). That’s the bundle lineup, bestie β€” know the roster. πŸ‘‘

  1. 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