Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-7874

Use OCIStmtPrepare2 instead of depcrecated OCIStmtPrepare to support Oracle RAC

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 6.0.6
    • Server (S)
    • None
    • Zabbix Server on RHEL8 and Oracle database using Oracle Real Application Cluster (RAC).

      We have a Zabbix Server running on RHEL8 connected to an Oracle Database which works with the capability of Real Application Cluster (Oracle RAC).

      Oracle RAC means that you have 2 instances of the database running on different machines at the same time, and the query that Zabbix Server sends to the database can be replied by any of the instances.

      In a typical database intervention, all the sessions are moved from one instance to the other one (called drain-sessions), so you can stop one instance without affect the application because the other one is giving service. To intervene the other instance, you can do the same procedure.

      We have tested this behavior and we weren't able to do this kind of intervention without getting a Zabbix Server crash.

      So, with the database configured in TAC (used by RAC, means "Transparent Application Continuty"), Zabbix shows the next errors when you stop one instance (after trying to move the sessions to the other instance with no success):

      2432930:20220630:114827.542 [Z3005] query failed: [-1] ORA-25412: transaction replay disabled by call to OCIStmtPrepare [select min(t.nextcheck) from httptest t,hosts h where t.hostid=h.hostid and mod(t.httptestid,1)=0 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.maintenance_status=0 or h.maintenance_type=0)]
      2432936:20220630:114827.725 [Z3005] query failed: [-1] ORA-25412: transaction replay disabled by call to OCIStmtPrepare [select escalationid,actionid,triggerid,eventid,r_eventid,nextcheck,esc_step,status,itemid,acknowledgeid,servicealarmid,serviceid from escalations where triggerid is null and itemid is not null and nextcheck<=1656582510 order by actionid,triggerid,itemid,escalationid]
      2432910:20220630:114926.455 [Z3005] query failed: [-1] ORA-25412: transaction replay disabled by call to OCIStmtPrepare [select service_status_ruleid,serviceid,type,limit_value,limit_status,new_status from service_status_rule order by serviceid]
      2432960:20220630:114927.752 [Z3005] query failed: [-1] ORA-25412: transaction replay disabled by call to OCIStmtPrepare [select eventid from problem where source=0 and object=0 and not exists (select NULL from triggers where triggerid=objectid)]
      2432929:20220630:115000.597 [Z3008] query failed due to primary key constraint: [-1] ORA-25412: transaction replay disabled by call to OCIStmtPrepare
      2432950:20220630:115024.984 [Z3005] query failed: [-1] ORA-25412: transaction replay disabled by call to OCIStmtPrepare [select null from actions where eventsource=2 and status=0]
      2432950:20220630:115024.984 cannot process queries: database is closed
      zabbix_server [2432898]: Error waiting for process with PID 2432950: [10] No child processes
      2432898:20220630:115025.144 syncing history data...
      2432898:20220630:115025.147 syncing history data... 100.000000%
      2432898:20220630:115025.147 syncing history data done
      2432898:20220630:115025.147 syncing trend data...
      2432898:20220630:115026.487 syncing trend data done
      2432907:20220630:115026.537 HA manager has been stopped
      2432898:20220630:115026.540 Zabbix Server stopped. Zabbix 6.0.6 (revision 3f7597e3ea3). 

      So, the error "ORA-25412: transaction replay disabled by call to OCIStmtPrepare" is documented here: https://docs.oracle.com/en/database/oracle/oracle-database/19/lnoci/deprecated-oci-functions.html#GUID-FD74B639-8B97-4A5A-BC3E-269CE59345CA

      So talking about "OCIStmtPrepare", it says the next:

      "This call does not support Application Continuity and if this call is used, it returns the following error: Error - ORA-25412: transaction replay disabled by call to OCIStmtPrepare. Use the OCIStmtPrepare2() call to support the use of Application Continuity in an HA infrastructure."

       

      On the Oracle deprecated documentation, we also find the next one:

      "The following function is deprecated beginning with Oracle 12c Release 2 (12.2.0.1): OCIStmtPrepare().
      Oracle strongly encourages use of OCIStmtPrepare2() in all OCI applications instead of the deprecated call OCIStmtPrepare().
      Use the OCIStmtPrepare2() call to support the use of Application Continuity in an HA infrastructure.
      Applications that use OCIStmtPrepare() return the following error: Error - ORA-25412: transaction replay disabled by call to OCIStmtPrepare."

      So, it is possible to change the call to use OCIStmtPrepare2() insted of the deprecated OCIStmtPrepare()?

      You can improve the HA behavior of Zabbix for those customers that uses Oracle backend database.

      Thanks for reading.

      Kind Regards, Francisco.

            wiper Andris Zeila
            FranD Francisco Denis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: