Wednesday, December 06, 2017

Zabbix 3.4 for Postgresql 9.6 installation in Centos 7

This installation extended to my home hour, since both Postgresql and Zabbix are new to me.

Followed few articles without much difficulty.
follow above, but replace 'mysql' with 'pgsql' 
yum install zabbix-server-pgsql
yum install zabbix-proxy-pgsql
yum install zabbix-web-pgsql 
below is my final packages started with zabbix
[oracle@hmc-P55A-UD3 zabbix]$ rpm -qa |grep zabbix

Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5

database creation

postgres createuser --pwprompt zabbix
postgres createdb -O zabbix zabbix
logon as postgres
 zcat /usr/share/doc/zabbix-proxy-pgsql*/schema.sql.gz |  psql -U zabbix -d zabbix
-- /etc/httpd/conf.d/zabbix.conf. 
set php_value date.timezone accordingly 

Problem starts when I started in web page installation step.

Problem  1  
"system error occurred. please contact zabbix administrator"

Then I realized the agent was not installed and started, but this didn't solve the problem.

Problem  2
From the agent logfile /var/log/zabbix/zabbix_agentd.log, it says zabbix-agent failed to connect to 10051

Then I realized the

problem 3  - the zabbix-server failed to start

although the systemctl start zabbix-server.service return 0 , and didn't show any errror on screen.

Errors in var/log/zabbix/zabbix_serverd.log are :

7676:20171206:223117.081 Starting Zabbix Server. Zabbix 3.4.4 (revision 74338).
7676:20171206:223117.081 ****** Enabled features ******
7676:20171206:223117.081 SNMP monitoring: YES
7676:20171206:223117.081 IPMI monitoring: YES
7676:20171206:223117.081 Web monitoring: YES
7676:20171206:223117.081 VMware monitoring: YES
7676:20171206:223117.081 SMTP authentication: YES
7676:20171206:223117.081 Jabber notifications: YES
7676:20171206:223117.081 Ez Texting notifications: YES
7676:20171206:223117.081 ODBC: YES
7676:20171206:223117.081 SSH2 support: YES
7676:20171206:223117.081 IPv6 support: YES
7676:20171206:223117.081 TLS support: YES
7676:20171206:223117.081 ******************************
7676:20171206:223117.081 using configuration file: /etc/zabbix/zabbix_server.conf
7676:20171206:223117.090 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR: relation "users" does not exist
LINE 1: select userid from users limit 1
[select userid from users limit 1]
7676:20171206:223117.090 cannot use database "zabbix": database is not a Zabbix database
zabbix_server [7686]: cannot open log: cannot create semaphore set: [28] No space left on device
zabbix_server [7691]: cannot open log: cannot create semaphore set: [28] No space left on device

Problem 4 -  PGRES_FATAL_ERROR:ERROR: relation "users" does not exist

Googled this crucial article to my final successwhich tell me should leave default (blank) for DBSchema inside the /etc/zabbix/zabbix_server.conf

Next I attempted to solve  "cannot create semaphore set", but even the zabbix-server is stopped, the tail of logfile still moved on. I guess something not clean with IPC, to safe time , I rebooted my PC, which worked!

The zabbix-server is up without error.

Next, I almost faced no challenges with web page installation steps, as shown below.

Again , there Database schema is important, leave as blank. both public and named as zabbix not working. 

The default login ID is Admin (case sensitive) and password is zabbix

empty dashboard at first logon

enable local serer for moniting

Finally see something.

Tuesday, November 28, 2017

key settings for jmeter3.3 JDBC connection to Oracle database (

Tested both URL works:

JDBC URL takes forms:
  • jdbc:oracle:thin:@host:port /databaseName
  • jdbc:oracle:thin:@host:port :serviceName
Note that the "validation query" in my case should choose "select 1 from dual", otherwise I was getting "Cannot create PoolableConnectionFactory (ORA-00923: FROM
keyword not found where expected"

ojdbc8.jar is the jdbc driver downloaded from

For SQL query , note that
1. There is no semi-colon (;) at the end of the sql statment, otherwise there is ora error code saying "ORA-00911: invalid character"

Above are key things I encountered when first time playing jmeter & oracle.

Also tested okay for 12.2c PDB.

Friday, September 01, 2017

apply APEX patch 5.1.2 for 5.1.1

alter session set container=pdb1;

Session altered.

SQL> @apxpatch.sql

PL/SQL procedure successfully completed.

...Validating Application Express
...(12:25:48) Starting validate_apex for APEX_050100
...(12:25:51) Checking missing sys privileges
...(12:25:51) Recompiling
...(12:25:53) Checking for objects that are still invalid
...(12:25:53) Key object existence check
...(12:25:53) Setting DBMS Registry for APEX to valid
...(12:25:53) Exiting validate_apex

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

timing for: Complete Patch
Elapsed: 00:04:48.58

SQL> !ls apxldimg.sql

SQL> @apxldimg.sql  /home/oracle/Downloads/patch

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

1 row selected.

1 row selected.

1 row selected.

PL/SQL procedure successfully completed.

1 row selected.

PL/SQL procedure successfully completed.

. Loading images directory: /home/oracle/Downloads/patch/images

Directory created.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Commit complete.

Directory dropped.

timing for: Load Images
Elapsed: 00:05:12.92
SQL> select VERSION from dba_registry where comp_id='APEX';


1 row selected.

Wednesday, August 23, 2017

some links for APEX 5.0 upgrade to 5.1

How to upgrade from Apex 5.0 to 5.1


Apply These 5 Steps to Upgrade Oracle Apex from 5.0 to 5.1


Upgrade Oracle APEX 5.1 – Grant Issues


Upgrading Oracle Application Express within Oracle Database 11g Express Edition (XE)








something new related AWR setting in 12c multitenant DB

12c Consolidated AWR report with PDBs

Enabling Automatic AWR Snapshots on PDB 


below is not unique to 12c, but advanced ...

To see AWR settings query DBA_HIST_WR_CONTROL






Create stacked bar in APEX 5.1

It seems no "stacked bar" chart in APEX 5.1.

Here is my key steps after few tries.

1. add two series, with same test SQL query.

select * from "EVENT_RT"

2. here is the key setting. Inside Chart > Attribute > choose YES for Stacked. Default is NO, which means two bars side by side displayed.

The other method (should be prior to 5.1) uses one serie data only together with below sample query formed by UNION ALL. I guess it may still work in 5.1

select id,
       project as label,
       NVL((select sum(t.budget) from eba_demo_chart_tasks t where t.project = and t.budget > t.cost),0) as value,
       'under budget' as series ,
       'green' as color
  from eba_demo_chart_projects p
union all
select id,
       project as label,
       NVL((select sum(t.budget) from eba_demo_chart_tasks t where t.project = and t.budget <= t.cost),0) as value,
       'over budget' as series ,
       'red' as color
  from eba_demo_chart_projects p

Sunday, August 20, 2017

install sql server 2017 RC2 in CentOS 7.3

Here is the link as of writing time, and follow it without difficulty.

[oracle@hmc-P55A-UD3 bin]$ sudo su -
[sudo] password for oracle:
Last login: Sat Aug 19 10:48:19 EDT 2017 on pts/1
[root@hmc-P55A-UD3 ~]#  curl -o /etc/yum.repos.d/mssql-server.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   220  100   220    0     0    445      0 --:--:-- --:--:-- --:--:--   446
[root@hmc-P55A-UD3 ~]# ls -lrt /etc/yum.repos.d/
total 52
-rw-r--r--. 1 root root  535 Oct 14  2015 CentOS-OpenStack-kilo.repo
-rw-r--r--. 1 root root 2893 Nov 29  2016 CentOS-Vault.repo
-rw-r--r--. 1 root root 1331 Nov 29  2016 CentOS-Sources.repo
-rw-r--r--. 1 root root  630 Nov 29  2016 CentOS-Media.repo
-rw-r--r--. 1 root root  314 Nov 29  2016 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  649 Nov 29  2016 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1309 Nov 29  2016 CentOS-CR.repo
-rw-r--r--. 1 root root 1664 Nov 29  2016 CentOS-Base.repo
-rw-r--r--. 1 root root 1050 Jun 24 11:04 epel-testing.repo
-rw-r--r--. 1 root root  951 Jun 24 11:04 epel.repo
-rw-r--r--. 1 root root 2142 Jul 23 15:07 elrepo.repo
-rw-r--r--. 1 root root  193 Aug 19 10:49 msprod.repo
-rw-r--r--. 1 root root  220 Aug 19 12:07 mssql-server.repo
[root@hmc-P55A-UD3 ~]# yum update
Loaded plugins: fastestmirror, langpacks
packages-microsoft-com-mssql-server                      | 2.9 kB     00:00    
packages-microsoft-com-mssql-server/primary_db             |  12 kB   00:00    
Loading mirror speeds from cached hostfile
 * base:
 * elrepo:
 * epel:
 * extras:
 * updates:
No packages marked for update
[root@hmc-P55A-UD3 ~]# yum install -y mssql-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base:
 * elrepo:
 * epel:
 * extras:
 * updates:
Resolving Dependencies
--> Running transaction check
---> Package mssql-server.x86_64 0:14.0.900.75-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package      Arch   Version          Repository                           Size
 mssql-server x86_64 14.0.900.75-1    packages-microsoft-com-mssql-server 165 M

Transaction Summary
Install  1 Package

Total download size: 165 M
Installed size: 165 M
Downloading packages:
mssql-server-14.0.900.75-1.x86_64.rpm                      | 165 MB   00:10    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mssql-server-14.0.900.75-1.x86_64                            1/1

Please run 'sudo /opt/mssql/bin/mssql-conf setup'
to complete the setup of Microsoft SQL Server

  Verifying  : mssql-server-14.0.900.75-1.x86_64                            1/1

  mssql-server.x86_64 0:14.0.900.75-1                                          

[root@hmc-P55A-UD3 ~]#  /opt/mssql/bin/mssql-conf setup
The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from:

The privacy statement can be viewed at:

Do you accept the license terms? [Yes/No]:Yes

Choose an edition of SQL Server:
  1) Evaluation (free, no production use rights, 180-day limit)
  2) Developer (free, no production use rights)
  3) Express (free)
  4) Web (PAID)
  5) Standard (PAID)
  6) Enterprise (PAID)
  7) I bought a license through a retail sales channel and have a product key to enter.

Details about editions can be found at

Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.

Enter your edition(1-7): 2
Enter the SQL Server system administrator password:
The specified password does not meet SQL Server password policy requirements because it is too short. The password must be at least 8 characters
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
Configuring SQL Server...

This is an evaluation version.  There are [157] days left in the evaluation period.
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/mssql-server.service.
Setup has completed successfully. SQL Server is now starting.

As I have disabled the firewalld in my desktop and installed command line tools in previous blog, I can directly connect locally.

[oracle@hmc-P55A-UD3 bin]$ sqlcmd -S localhost -U sa
1> create database testdb;
2> go
1> select name from sys.databases;
2> go

(5 rows affected)