[ZBX-15753] ORA-933 when using trends with zabbix plugin Created: 2019 Mar 04  Updated: 2019 Mar 05  Resolved: 2019 Mar 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Lefteris Tsekouras Assignee: Zabbix Support Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBX-13325 Trend.get doesn't work properly for ... Closed

 Description   

Grafana: 5.3.4
Zabbix plugin: 3.9.1
Zabbix: 3.2.4
Oracle DB with the zabbix repository:12.2

Hello.
I have enabled the trends option on my zabbix data source with after=30d and range=30d.

When I select the appropriate range on my dashboards to use trends (eg now -30d) I get “No data points” on my graphs.

In Oracle’s alert log, I get the following messages, relevant to this:
WARNING: too many parse errors, count=500 SQL hash=0x248f5006
PARSE ERROR: ospid=26861, error=933 for statement:
2019-02-28T13:06:49.851786+02:00
SELECT t.* FROM trends_uint AS t WHERE t.clock>=:“SYS_B_0” AND t.clock<=:“SYS_B_1” AND t.itemid=:“SYS_B_2”
Additional information: hd=0x1bb4211f0 phd=0x1c13b4ec0 flg=0x28 cisid=84 sid=84 ciuid=84 uid=84

These errors are:
ORA-00933: SQL command not properly ended

So, the above query is not executed in Oracle:

SQL> SELECT t.* FROM trends_uint AS t WHERE t.clock>=1536613200 AND t.clock<=1536614200 AND t.itemid=93624;
SELECT t.* FROM trends_uint AS t WHERE t.clock>=1536613200 AND t.clock<=1536614200 AND t.itemid=93624
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

“AS” should not be used for table aliases in Oracle.

The correct syntax is:
SQL> SELECT t.* FROM trends_uint t WHERE t.clock>=1536613200 AND t.clock<=1536614200 AND t.itemid=93624;

ITEMID CLOCK NUM VALUE_MIN VALUE_AVG VALUE_MAX
93624 1536613200 12 5843 7709 9779



 Comments   
Comment by Andrei Gushchin (Inactive) [ 2019 Mar 05 ]

Thank you for submitting the issue. It already fixed in ZBX-13325.
Upgrading zabbix solve the issue.

Generated at Thu Apr 18 19:11:56 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.