Oracle DB Monitoring

Skip Prerequisites, Web and LPAR2RRD tabs in case of configuring Virtual Appliance, Docker or a Container

  • LPAR2RRD can be hosted on any Unix or Linux Operating system
  • Perl: arbitrary version coming with the OS with some additional modules, more below
  • Apache or any other Web server
Skip it in case of configuring Virtual Appliance
HW sizing

User creation

  • create lpar2rrd user under root:
    # useradd -c "LPAR2RRD user" -m lpar2rrd
    # chmod 755 /home/lpar2rrd
    
  • Increase limits for user lpar2rrd and the WEB server user (under root)
    • AIX
      # chdev -l sys0 -a maxuproc=2000
      # chuser  nofiles=32768 data=-1  stack=-1 rss=-1 lpar2rrd
      # chuser  data=-1  stack=-1 rss=-1 apache
      
    • Linux
      # vi /etc/security/limits.conf
      
      lpar2rrd        hard    stack           -1
      lpar2rrd        soft    stack           -1
      lpar2rrd        hard    data            -1
      lpar2rrd        soft    data            -1
      lpar2rrd        hard    nofile          32768 
      lpar2rrd        soft    nofile          32768 
      lpar2rrd        hard    nproc           5000
      lpar2rrd        soft    nproc           5000
      
      apache          hard    stack           -1
      apache          soft    stack           -1
      apache          hard    data            -1
      apache          soft    data            -1
      
If you have already running STOR2RRD on the same host then skip to Web tab.

Linux RedHat, CentOS

  • RHEL 8: enable the codeready-builder-for-rhel-8-*-rpms repository
    # ARCH=$( /bin/arch )
    # subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"
    
  • CentOS 8: enable the PowerTools repository
    # yum config-manager --set-enabled PowerTools
    or
    # dnf config-manager --set-enabled powertools
    
    You can also just open /etc/yum.repos.d/CentOS-Linux-PowerTools.repo with a text editor and set enabled= to 1 instead of 0

  • RHEL 9: enable config-manager and the PowerTools repository
    dnf install 'dnf-command(config-manager)'
    dnf config-manager --enable crb
    
  • RedHat, CentOS: all versions
    # umask 0022 
    # yum install perl rrdtool rrdtool-perl httpd mod_ssl
    # yum install epel-release
    # yum install perl-TimeDate perl-HTTP-Date perl-Env perl-CGI perl-Data-Dumper perl-LWP-Protocol-https perl-libwww-perl perl-Time-HiRes perl-IO-Tty
    # yum install perl-PDF-API2 perl-JSON-XS perl-XML-Simple perl-XML-NamespaceSupport perl-URI perl-XML-SAX-Base perl-XML-SAX perl-XML-LibXML
    # yum install ed bc libxml2 sharutils
    
    Follow this for installing perl-PDF-API2 on RHEL/CentOS 8
    Note that rrdtool-perl and epel-release (this is necessary only for PDF reporting) might not be in your RedHat base repository especially for RHEL 6.x and olders.
    Install CentOS package instead rrdtool-perl-1.4.8-9.el7.x86_64.rpm and epel-release-7-11.noarch.rpm

Linux Debian, Ubuntu

    # umask 0022 
    # apt-get install apache2 perl rrdtool ed bc
    # apt-get install librrdp-perl libxml-sax-perl libxml-simple-perl libtimedate-perl libenv-sanctify-perl libcgi-pm-perl libdata-dumper-simple-perl libpdf-api2-perl libxml2-utils
    # apt-get install liblwp-protocol-https-perl libcrypt-ssleay-perl libio-socket-ssl-perl libmozilla-ldap-perl libxml-parser-perl libjson-xs-perl
    

SuSE

    # zypper install rrdtool perl-rrdtool apache2
    # zypper install perl-TimeDate perl-XML-Simple perl-XML-SAX perl-XML-LibXML perl-CGI perl-LWP-Protocol-https perl-libwww-perl perl-IO-Tty
    # zypper install perl-PDF-API2 perl-JSON-XS
    # zypper install ed bc libxml2-2 sharutils
    

AIX

Solaris

    # /opt/csw/bin/pkgutil -y -i pm_xml_simple pm_libxml_perl pm_xml_sax rrdtool
    
Skip it in case of configuring Virtual Appliance
Optional configuration of authorization in Apache. You can proceed it after Apache access works without authorization prompt as per below cfg.

Apache download

  • Linux CentOS, RedHat
    # yum install httpd
    
  • Linux Debian, Ubuntu
    # apt-get install httpd
    

Apache configuration

Apache start / restart

    Command depends on Apache version, one of these should work:
    # apachectl restart
    # /opt/freeware/apache/sbin/apachectl restart
    # /etc/init.d/httpd restart
    # service apache2 restart
    
    If you have firewall enabled then enable LPAR2RRD communication by:
    # firewall-cmd --add-service=http --permanent
    # firewall-cmd --add-service=https --permanent
    # firewall-cmd --add-port=8162/tcp --permanent
    
    # firewall-cmd --reload
    

Test web pages

    Point your web browser to http://<your lpar2rrd host>/lpar2rrd/ as soon as you configure LPAR2RRD
    Do not forget to ensure that Apache starts after the OS reboot (there must be a starting script in /etc/rc.... )

Apache configuration per platform and version

  • Linux CentOS, RedHat


    Append at the end of /etc/httpd/conf/httpd.conf following
    # vi /etc/httpd/conf/httpd.conf
    
    AddHandler cgi-script .sh
    # DocumentRoot  "/home/lpar2rrd/lpar2rrd/www/"
    Alias /lpar2rrd  "/home/lpar2rrd/lpar2rrd/www/"
    <Directory "/home/lpar2rrd/lpar2rrd/www/">
        AllowOverride 
        Options Indexes FollowSymLinks
        Require all granted
    </Directory>
    # CGI-BIN
    ScriptAlias /lpar2rrd-cgi/ "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi/"
    <Directory "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi">
        AllowOverride 
        SetHandler cgi-script
        Options ExecCGI FollowSymLinks
        Require all granted
    </Directory>
    
  • Linux Debian, Ubuntu : Apache2 (2.4+)


    Enable CGI-BIN and optionally even SSL if it is required
    # a2enmod cgi
    # a2enmod ssl
    
    Append this at the end of /etc/apache2/apache2.conf
    # vi /etc/apache2/apache2.conf
    
    AddHandler cgi-script .sh
    Alias /lpar2rrd  "/home/lpar2rrd/lpar2rrd/www/"
    <Directory "/home/lpar2rrd/lpar2rrd/www/">
        Options Indexes FollowSymLinks 
        Require all granted
    </Directory>
    # CGI-BIN
    ScriptAlias /lpar2rrd-cgi/ "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi/"
    <Directory "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi">
        AllowOverride None
        Options +ExecCGI +SymLinksIfOwnerMatch
        Require all granted
        SetHandler cgi-script
    </Directory>
    
  • SuSE

    Append at the end of /etc/apache2/httpd.conf following
    # vi /etc/apache2/httpd.conf
    
    AddHandler cgi-script .sh
    Alias /lpar2rrd  "/home/lpar2rrd/lpar2rrd/www/"
    <Directory "/home/lpar2rrd/lpar2rrd/www/">
        Options Indexes FollowSymLinks
        Require all granted
    </Directory>
    # CGI-BIN
    ScriptAlias /lpar2rrd-cgi/ "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi/"
    <Directory "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi">
        AllowOverride None
        Options +ExecCGI +SymLinksIfOwnerMatch
        Require all granted
        SetHandler cgi-script
    </Directory>
    
  • Apache 2.4+ generally


    Configure httpd.conf, it might be in different locations (depends of distribution)
    • /etc/httpd/httpd.conf
    • /etc/httpd/conf/httpd.conf
    • /etc/opt/freeware/apache/httpd.conf (AIX)
    • /opt/freeware/etc/httpd/httpd.conf (AIX)
    • /opt/freeware/etc/httpd/conf/httpd.conf (AIX)
    • /etc/apache2/apache2.conf

    1. Verify alias_module and cgi_module is loaded (uncommented it, the path can be different)
      LoadModule alias_module /opt/freeware/lib/httpd/modules/mod_alias.so
      LoadModule cgi_module /opt/freeware/lib/httpd/modules/mod_cgi.so
      
    2. cgi_module could depend on mpm_prefork_module like here.
      Allow it as well (uncomment it) and disable mpm_worker_module, mpm_event_module
      LoadModule mpm_prefork_module /opt/freeware/lib/httpd/modules/mod_mpm_prefork.so
      # LoadModule mpm_worker_module /opt/freeware/lib/httpd/modules/mod_mpm_worker.so
      # LoadModule mpm_event_module modules/mod_mpm_event.so
      <IfModule mpm_prefork_module>
           LoadModule cgi_module /opt/freeware/lib/httpd/modules/mod_cgi.so
      </IfModule>
      
    3. Append this at the end of httpd.conf
      AddHandler cgi-script .sh
      Alias /lpar2rrd  "/home/lpar2rrd/lpar2rrd/www/"
      <Directory "/home/lpar2rrd/lpar2rrd/www/">
          Options Indexes FollowSymLinks 
          Require all granted
      </Directory>
      # CGI-BIN
      ScriptAlias /lpar2rrd-cgi/ "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi/"
      <Directory "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi">
          AllowOverride None
          SetHandler cgi-script
          Options ExecCGI FollowSymLinks
          Require all granted
      </Directory>
      
      Sometimes appears necessary to remove "Require all granted" lines in both directives.

  • Apache 1.3 - 2.3


    Configure httpd.conf, it might be in different locations (depends of distribution)
    • /etc/httpd/httpd.conf
    • /etc/httpd/conf/httpd.conf

    # vi /etc/opt/freeware/apache/httpd.conf
    
    Alias /lpar2rrd  "/home/lpar2rrd/lpar2rrd/www/"
    <Directory "/home/lpar2rrd/lpar2rrd/www/">
        Options Indexes FollowSymLinks 
        Order allow,deny
        Allow from all
    </Directory>
    # CGI-BIN
    ScriptAlias /lpar2rrd-cgi/ "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi/"
    <Directory "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi">
        AllowOverride None
        Options ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
    
  • SELinux changes


    You need to disable the SELinux service protection to be able to utilize basic web services.
    You must do it in case you get "(13)Permission denied:" in Apache error_log.
    You have 2 options:

    • Disable SELinux only for Apache
      Step 1. Query for the Boolean value you need to change:
      # getsebool -a | grep httpd_dis
        httpd_disable_trans --> off
      
      Step 2. Disable the SELinux protection:
      # setsebool -P httpd_disable_trans=1
      
      Step 3. Verify that the Boolean has changed:
      # getsebool -a | grep httpd_dis
        httpd_disable_trans --> on
      
    • Globally disable SELinux
      # setenforce Permissive
      # vi /etc/sysconfig/selinux
        SELINUX=disabled
      
    Follow SELinux configuration in case you want to enable SELinux with our tools

Oracle DB monitoring schema
LPAR2RRD obtains data through SQL (SQL*Plus). Oracle client must be installed on LPAR2RRD server.
Monitoring implementation does not require any Oracle licensed features like Oracle Diagnostics Pack or Oracle Tuning Pack .

LPAR2RRD requires a database user with the following view only permissions to collect monitoring data:
  • create session
  • select rights on specific sys.* tables
Note a bug in Oracle Database 19.11.0.0 and 19.12.0.0

Oracle Instant Client and SQL*Plus installation

Oracle Instant Client and SQL Plus are used for collecting information from an Oracle DB instance.
Oracle DB user is needed with sufficient privileges.
Version compatibility: OIC 19c supports Oracle DB versions 11.2.0.4 and newer.
If you are using previously installed SQL Plus, make sure it is version 12.2 and above.
Oracle Instant Client (OIC) can be deployed from a ZIP file or installed as an RPM package.
Installation steps are performed under root account

  • Linux: libaio prerequisite Skip this step if you are using XoruX Virtual Appliance
    # yum -y install libaio.x86_64
  • Linux CentOS8/RHEL8: libnsl.so.1 might not have been in the OS present, install it:
    # dnf install libnsl.x86_64
    
  • Installation from ZIP files (Linux and AIX)
    • AIX: note that Oracle Client packages does not work on AIX 6.1. It works on AIX 7.1 and newer.

    • Download ZIP packages from Oracle Download website Linux x86-64, AIX
      OIC basic: instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
      SQL*Plus: instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip

      Create /opt/oracle directory and unzip
      # umask 022
      # mkdir /opt/oracle
      # cd /opt/oracle
      # unzip /<download_dir>/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
      # unzip /<download_dir>/instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip
      
      ZIP files will be unpacked into /opt/oracle/instantclient_<version>

    • ldconfig (Linux)
      # echo "/opt/oracle/instantclient_<version>" > /etc/ld.so.conf.d/oracle-instantclient.conf
      # ldconfig
      
  • RPM installation - Linux
  • AIX: missing iocp
    You may get the following err when running sqlplus on AIX.
    # cd /opt/oracle/instantclient_<version>
    # export LIBPATH=`pwd`
    # ./sqlplus
      exec(): 0509-036 Cannot load program sqlplus because of the following errors:
      rtld: 0712-001 Symbol CreateIoCompletionPort was referenced
          from module /opt/oracle/instantclient_19_5/libttsh19.so(), but a runtime definition
          of the symbol was not found.
      rtld: 0712-001 Symbol GetMultipleCompletionStatus was referenced
          from module /opt/oracle/instantclient_19_5/libttsh19.so(), but a runtime definition
          of the symbol was not found.
      rtld: 0712-002 fatal error: exiting.
    # lsdev | grep iocp
      iocp0      Defined         I/O Completion Ports
    
    Configure iocp without AIX reboot:
    # smitty iocp
      Select: Change / Show Characteristics of I/O Completion Ports ➡ se to available ➡ confirm ➡ it prints error that reboot is necessary, ignore it for now
    # lsdev | grep iocp
      iocp0      Defined         I/O Completion Ports
    # lsattr -El iocp0
      autoconfig defined STATE to be configured at system restart True
    
    Enable iocp0 now and at restart:
    # mkdev -l iocp0
      iocp0 Available
    # chdev -l iocp0 -a autoconfig='available' -P
      iocp0 changed
    # lsdev | grep iocp
      iocp0      Available         I/O Completion Ports
    

Create DB user for LPAR2RRD

Database user in each Oracle instance must be created, it will be used for LPAR2RRD access.
You can choice whatever user name (below examle show "lpar2rrd" user, then specify it in LPAR2RRD Database properties.
  • Standalone / RAC
    $ sqlplus sys"/as sysdba"
      create user lpar2rrd_check identified by "<password>" default tablespace USERS temporary tablespace TEMP;
      grant create session to lpar2rrd_check;
      grant select on sys.v_$instance_ping to lpar2rrd_check;
      grant select on sys.v_$resource_limit to lpar2rrd_check;
      grant select on sys.gv_$resource_limit to lpar2rrd_check;
      grant select on sys.v_$sysmetric_summary to lpar2rrd_check;
      grant select on sys.gv_$sysmetric_summary to lpar2rrd_check;
      grant select on sys.v_$sysmetric_history to lpar2rrd_check;
      grant select on sys.gv_$sysmetric_history to lpar2rrd_check;
      grant select on sys.v_$datafile to lpar2rrd_check;
      grant select on sys.gv_$datafile to lpar2rrd_check;
      grant select on sys.v_$filestat to lpar2rrd_check;
      grant select on sys.gv_$filestat to lpar2rrd_check;
      grant select on sys.v_$instance to lpar2rrd_check;
      grant select on sys.gv_$instance to lpar2rrd_check;
      grant select on sys.v_$database to lpar2rrd_check;
      grant select on sys.gv_$database to lpar2rrd_check;
      grant select on sys.v_$osstat to lpar2rrd_check;
      grant select on sys.gv_$osstat to lpar2rrd_check;
      grant select on sys.v_$session to lpar2rrd_check;
      grant select on sys.gv_$session to lpar2rrd_check;
      grant select on sys.v_$sgainfo to lpar2rrd_check;
      grant select on sys.gv_$sgainfo to lpar2rrd_check;
      grant select on sys.v_$containers to lpar2rrd_check;
      grant select on sys.gv_$containers to lpar2rrd_check;
      grant select on sys.v_$pgastat to lpar2rrd_check;
      grant select on sys.gv_$pgastat to lpar2rrd_check;
      grant select on sys.v_$system_wait_class to lpar2rrd_check;
      grant select on sys.gv_$system_wait_class to lpar2rrd_check;
      grant select on sys.v_$system_event  to lpar2rrd_check;
      grant select on sys.gv_$system_event  to lpar2rrd_check;
      grant select on sys.v_$cluster_interconnects  to lpar2rrd_check;
      grant select on sys.gv_$cluster_interconnects to lpar2rrd_check;
      grant select on sys.v_$sysstat to lpar2rrd_check;
      grant select on sys.gv_$sysstat to lpar2rrd_check;
      grant select on sys.v_$service_stats to lpar2rrd_check;
      grant select on sys.gv_$service_stats to lpar2rrd_check;
      grant select on sys.v_$event_histogram to lpar2rrd_check;
      grant select on sys.gv_$event_histogram to lpar2rrd_check;
      grant select on dba_free_space to lpar2rrd_check;
      grant select on dba_temp_free_space to lpar2rrd_check;
      grant select on dba_data_files to lpar2rrd_check;
      grant select on dba_registry to lpar2rrd_check;
      grant select on dba_temp_files to lpar2rrd_check;
      grant select on sys.registry$history to lpar2rrd_check;
      grant select on sys.REGISTRY$SQLPATCH to lpar2rrd_check;
      grant select on sys.v_$recovery_file_dest to lpar2rrd_check;
      grant select on sys.v_$log to lpar2rrd_check;
      grant select on sys.v_$controlfile to lpar2rrd_check;
      grant select on dba_alert_history_detail to lpar2rrd_check;
      exit;
    
  • Multitenant
    $ sqlplus sys"/as sysdba"
      create user lpar2rrd_check identified by "<password>" default tablespace USERS temporary tablespace TEMP CONTAINER = ALL;
      grant create session to lpar2rrd_check CONTAINER = ALL;
      grant SET CONTAINER to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$instance_ping to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$resource_limit to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$resource_limit to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$sysmetric_summary to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$sysmetric_summary to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$sysmetric_history to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$sysmetric_history to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$datafile to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$datafile to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$filestat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$filestat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$instance to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$instance to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$database to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$database to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$osstat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$osstat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$session to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$session to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$sgainfo to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$sgainfo to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$containers to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$containers to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$pgastat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$pgastat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$system_wait_class to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$system_wait_class to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$system_event  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$system_event  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$con_sysmetric_summary  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$con_sysmetric_summary  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$con_sysmetric_history   to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$con_sysmetric_history  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$cluster_interconnects  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$cluster_interconnects to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$sysstat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$sysstat to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$service_stats to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$service_stats to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$event_histogram to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.gv_$event_histogram to lpar2rrd_check CONTAINER = ALL;
      grant select on dba_free_space to lpar2rrd_check CONTAINER = ALL;
      grant select on dba_temp_free_space to lpar2rrd_check CONTAINER = ALL;
      grant select on dba_data_files to lpar2rrd_check CONTAINER = ALL;
      grant select on dba_registry to lpar2rrd_check CONTAINER = ALL;
      grant select on dba_temp_files to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.registry$history to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.REGISTRY$SQLPATCH to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$recovery_file_dest to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$log to lpar2rrd_check CONTAINER = ALL; 
      grant select on sys.v_$controlfile to lpar2rrd_check CONTAINER = ALL;
      grant select on dba_alert_history_detail to lpar2rrd_check CONTAINER = ALL;
      exit;
    
  • DataGuard: Standalone/RAC
    Note: DG is not supported yet (as per v7.00), let us know if you want to test it.
    Enhance user priviledges on primary database. DG instance does not need lpar2rrd user.
      grant select on sys.v_$dataguard_config  to lpar2rrd_check;
      grant select on sys.v_$ARCHIVE_DEST to lpar2rrd_check;
      grant select on sys.v_$archive_dest_status to lpar2rrd_check;
    
  • DataGuard: Multitenant/RAC Multitenant
    Note: DG is not supported yet (as per v7.00), let us know if you want to test it.
    Enhance user priviledges on primary database. DG instance does not need lpar2rrd user.
      grant select on sys.v_$dataguard_config  to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$ARCHIVE_DEST to lpar2rrd_check CONTAINER = ALL;
      grant select on sys.v_$archive_dest_status to lpar2rrd_check CONTAINER = ALL;
    
Note that for older databases than 12c you get errors like this, ignore them (you do not get this data from database: PSU,patches info)
SQL> grant SET CONTAINER to lpar2rrd;      
     ORA-00990: missing or invalid privilege
SQL> grant select on sys.REGISTRY$SQLPATCH to lpar2rrd;
     ORA-00942: the table does not exist  

Connectivity check

Allow access from the LPAR2RRD host to Oracle DB host.
Make sure you are using correct port.
Default port for Oracle DB sessions is 1521.

Check connectivity:
$ perl /home/lpar2rrd/lpar2rrd/bin/conntest.pl 192.168.1.1 1521
  Connection to "192.168.1.1" on port "1521" is ok

Attach Oracle Databases

  • Oracle environment
    Set Oracle environment variables in etc/lpar2rrd.cfg, modify existing setup
    # Oracle DB client setup
    # Adjust ORACLE_HOME & ORACLE_BASE as necessary, "instantclient_X" is only example
    # Do not use ORACLE_HOME variable as part of ORACLE_HOME, use always full path!
      ORACLE_BASE=/opt/oracle
      ORACLE_HOME=/opt/oracle/instantclient_XY
    
    Note ORACLE_HOME must be directory where sqlplus binary is, like in this example when it is in /usr/lib/oracle/19.6/client64/bin/sqlplus
    ORACLE_BASE=/usr/lib/oracle
    ORACLE_HOME=/usr/lib/oracle/19.6/client64/bin
    
    There can be a problem when sqlplus is in "bin" subdir as such ORACLE_HOME do not have to acceptable for Oracle client.
    Either use ORACLE_HOME without "bin" and copy/symlink sqlplus to ORACLE_HOME or upgrade to LPAR2RRD 7.04+ (release in Dec 2020) where it is fixed (you do not need to put "bin" into ORACLE_HOME)

  • LPAR2RRD UI ➡ Settings icon ➡ Oracle DB ➡ New :
    Oracle DB configuration

    Oracle service: to list Oracle service use this cmd on the server where DB is running: lsnrctl status
    Oracle RAC: Do not use SCAN IP in the configuration, add Virtual IP for each RAC node/instance separately. These instances should use the same listener service
    Make sure that connection test passes without errors or warnings.

  • Number of attached Oracle RAC instances is limited to 1 in the Free edition.
    However you can attach Oracle RAC nodes even as stand-alone instances if you reach the limitation, there is no limit for attaching of Oracle stand-alone DB instances.

  • Make sure cron jobs for Oracle DB are in place (upgrade script might do it for you automatically)
    Skip this step if you install the Virtual Appliance - it is already taken care of.
    $ crontab -l | grep "load_oracledb.sh"
    $
    
    Add following lines to crontab if necessary
    $ crontab -e
    
    # Oracle DB support
    0,5,10,15,20,25,30,35,40,45,50,55 * * * *  /home/lpar2rrd/lpar2rrd/load_oracledb.sh > /home/lpar2rrd/lpar2rrd/load_oracledb.out 2>&1
    
  • Wait 30 minutes and then go to the web UI: http://<your web server>/lpar2rrd/
    Use Ctrl-F5 to refresh the web browser cache.


Skip it in case of configuring Virtual Appliance

Install LPAR2RRD server

  • Download the latest LPAR2RRD server
    Upgrade your already running LPAR2RRD instance.

  • Install it:
    # su - lpar2rrd
    $ tar xvf lpar2rrd-7.XX.tar
    $ cd lpar2rrd-7.XX
    $ ./install.sh
    $ cd /home/lpar2rrd/lpar2rrd
    
  • Schedule to run it from lpar2rrd crontab (it might already exist there)
    $ crontab -l | grep load.sh
    $
    
    Add if it does not exist as above
    $ crontab -e
    
    # LPAR2RRD UI
    0,30 * * * * /home/lpar2rrd/lpar2rrd/load.sh > /home/lpar2rrd/lpar2rrd/load.out 2>&1 
    
    Assure there is just one such entry in crontab.

  • You might need to add lpar2rrd user into /var/adm/cron/cron.allow (/etc/cron.allow on CentOS 8) if crontab command fails
    Allow it for lpar2rrd user as root user.
    # echo "lpar2rrd" >> /var/adm/cron/cron.allow
    
  • Assure you have a cron jobs for Oracle DB in place (upgrade script might do it automatically) Skip it on the Virtual Appliance, it is already there.
    $ crontab -l | grep "load_oracledb.sh"
    $
    
    Add it if it does not exist like above
    $ crontab -e
    
    # Oracle DB support
    0,5,10,15,20,25,30,35,40,45,50,55 * * * *  /home/lpar2rrd/lpar2rrd/load_oracledb.sh > /home/lpar2rrd/lpar2rrd/load_oracledb.out 2>&1
    
  • Initial start from cmd line:
    $ cd /home/lpar2rrd/lpar2rrd
    $ ./load.sh
    
  • Go to the web UI: http://<your web server>/lpar2rrd/
    Use Ctrl-F5 to refresh the web browser cache.

Troubleshooting

  • If you have any problems with the UI then check:
    (note that the path to Apache logs might be different, search apache logs in /var)
    tail /var/log/httpd/error_log             # Apache error log
    tail /var/log/httpd/access_log            # Apache access log
    tail /var/tmp/lpar2rrd-realt-error.log    # STOR2RRD CGI-BIN log
    tail /var/tmp/systemd-private*/tmp/lpar2rrd-realt-error.log # STOR2RRD CGI-BIN log when Linux has enabled private temp
    
  • Test of CGI-BIN setup
    umask 022
    cd /home/lpar2rrd/lpar2rrd/
    cp bin/test-healthcheck-cgi.sh lpar2rrd-cgi/
    
    go to the web browser: http://<your web server>/lpar2rrd/test.html
    You should see your Apache, LPAR2RRD, and Operating System variables, if not, then check Apache logs for connected errors