Oracle DB Monitoring
Consider usage of our brand new full-stack infrastructure monitoring tool XorMon Next Generation as LPAR2RRD replacement.
It brings a new level of infrastructure monitoring by relying on a modern technology stack.
In particular, reporting, exporting, alerting and presentation capabilities are unique on the market.
# yum -y install libaio.x86_64
# dnf install libnsl.x86_64
# 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.zipZIP files will be unpacked into /opt/oracle/instantclient_<version>
# echo "/opt/oracle/instantclient_<version>" > /etc/ld.so.conf.d/oracle-instantclient.conf # ldconfig
wget https://download.oracle.com/otn_software/linux/instantclient/19600/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/19600/oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm
yum install oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm
apt-get update apt-get -y install alien alien --to-deb --scripts oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm alien --to-deb --scripts oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm apt-get install -y libaio1 # Oracle client prerequisite apt-get install -y ./oracle-instantclient19.6-basic_19.6.0.0.0-2_amd64.deb apt-get install -y ./oracle-instantclient19.6-sqlplus_19.6.0.0.0-2_amd64.deb apt list --installed| grep orac oracle-instantclient19.6-basic/now 19.6.0.0.0-2 amd64 [installed,local] oracle-instantclient19.6-sqlplus/now 19.6.0.0.0-2 amd64 [installed,local] ls -l /usr/lib/oracle/19.6/client64/bin/sqlplus -rwxr-xr-x 1 root root 24472 Dec 17 2019 /usr/lib/oracle/19.6/client64/bin/sqlplus
# 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 PortsConfigure 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 TrueEnable 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
$ 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; grant select on sys.v_$logfile to lpar2rrd_check; exit;
$ 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; grant select on sys.v_$logfile to lpar2rrd_check CONTAINER = ALL; exit;
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;
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;
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
$ perl /home/lpar2rrd/lpar2rrd/bin/conntest.pl 192.168.1.1 1521 Connection to "192.168.1.1" on port "1521" is ok
# 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_XYNote 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/binThere can be a problem when sqlplus is in "bin" subdir as such ORACLE_HOME do not have to acceptable for Oracle client.
$ crontab -l | grep "load_oracledb.sh" $
$ 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
# su - lpar2rrd $ tar xvf lpar2rrd-7.XX.tar $ cd lpar2rrd-7.XX $ ./install.sh $ cd /home/lpar2rrd/lpar2rrd
cd /home/lpar2rrd/lpar2rrd . etc/lpar2rrd.cfg; $PERL bin/perl_modules_check.plIf there is missing "LWP::Protocol::https" then check this docu to fix it
su - lpar2rrd umask 022 cd /home/lpar2rrd/lpar2rrd cp html/.htaccess www cp html/.htaccess lpar2rrd-cgi
$ crontab -l | grep load.sh $
$ crontab -e # LPAR2RRD UI 0,30 * * * * /home/lpar2rrd/lpar2rrd/load.sh > /home/lpar2rrd/lpar2rrd/load.out 2>&1Assure there is just one such entry in crontab.
# echo "lpar2rrd" >> /etc/cron.allow
$ crontab -l | grep "load_oracledb.sh" $
$ 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
$ cd /home/lpar2rrd/lpar2rrd $ ./load.sh
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
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