.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Ocsinventory::Agent::Modules::Databases::Oracle::Instances 3pm" .TH Ocsinventory::Agent::Modules::Databases::Oracle::Instances 3pm "2020-09-14" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Oracle::Instances \- Lib for Oracle instances and versions retrieval .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a function to retrieve information about Oracle instances on the current server. .PP To do so, the function reads the /etc/oratab file to find instances and then: .IP "1." 4 Checks the existence of the \s-1ORACLE_HOME\s0 directory. .IP "2." 4 Add (\s-1ORACLE_SID, ORACLE_HOME, AUTOSTART\s0) to the databases hash. .IP "3." 4 Go and find server version and bundle for each \s-1ORACLE_HOME.\s0 .Sp This information is found by executing the \f(CW\*(C`tnsping\*(C'\fR command and by reading the following \s-1XML\s0 file: .Sp .Vb 1 \& $ORACLE_HOME/inventory/Components21/oracle.server/*/context.xml .Ve .Sp The following bundles are known: \s-1SE1\s0 (Standard Edition One), \s-1SE\s0 (Standard Edition), \s-1EE\s0 (Enterprise Edition), \s-1XE\s0 (Express Edition). .IP "4." 4 Returns the database hash as follows: .Sp .Vb 8 \& { \& \*(AqSID\*(Aq => { \& \*(AqBUNDLE\*(Aq => \*(AqStandard\*(Aq, \& \*(AqAUTOSTART\*(Aq => 0, \& \*(AqORA_HOME\*(Aq => \*(Aq/home/oracle/oracle/product/11.2.0\*(Aq, \& \*(AqVERSION\*(Aq => \*(Aq11.2.0.4.0\*(Aq \& } \& }; .Ve .PP Optionally, you can call \f(CW\*(C`getInstances()\*(C'\fR to return only the hash of versions and bundles, instead of the complete instances hash: .PP .Vb 6 \& { \& \*(Aq/home/oracle/oracle/product/11.2.0\*(Aq => { \& \*(AqBUNDLE\*(Aq => \*(AqStandard\*(Aq, \& \*(AqVERSION\*(Aq => \*(Aq11.2.0.4.0\*(Aq \& } \& }; .Ve .PP In that case, you just have to pass parameter 1 (integer one) when calling the function. .SS "Exports" .IX Subsection "Exports" The module exports the \f(CW\*(C`getInstances()\*(C'\fR function. .SS "\fBgetInstances()\fP" .IX Subsection "getInstances()" \fISynopsis\fR .IX Subsection "Synopsis" .PP .Vb 1 \& getInstances($version_only) .Ve .PP where \f(CW$versions_only\fR is a integer (tested as a bool) .PP .Vb 2 \& my $database = getInstances() \& my $versions = getInstances(1) .Ve .PP \fIReturn values\fR .IX Subsection "Return values" .PP The function returns a hash reference containing the instances or versions.