1932132- Large time difference between application server and HANA database.

Symptom

SAP applications are terminated due to time difference between application servers and database server with an ABAP runtime error, ZDATE_LARGE_TIME_DIFF or ZDATE_ILLEGAL_LOCTIME.

HANA Database SQL Function CURRENT_TIME, CURRENT_TIMESTAMP returns wrong value which is an hour earlier than the actual value.

Other Terms

SAP HANA Database, Timezone, timestamp, current_timestamp, ZDATE_ILLEGAL_LOCTIME

Reason and Prerequisites

1. Prerequisites

– SAP HANA Database Revision 65 or above

– Affected Period

Dailyight saving time start date and end date

– Affected Location

The location where the new DST rule changed after 2007 is applied.

 2. Reason

– Incorrect daylight saving time handling in HANA Database during the affected period mentioned in prerequisites.

 

Solution

Please maintain timezone tables on your databases regularly. This is done by the following:

  1. HANA Database Revision 69 or above
    1. Create HANA timezone tables in SYSTEM schema.
      1. Apply SAP Note 1791342 if ABAP application servers run on top of HANA database.
      2. Import attached timezone configuration tables into SYSTEM schema for HANA standalone database.
        • In a scale-out system, need to import the tables into the master node.
          • Copy the attached file “HANATimezoneTables_2014.zip” to the work directory of master node ( /usr/sap/<SID>/HDB<INSTNO>/work )
          • cd /usr/sap/<SID>/HDB<INSTNO>/work
          • unzip HANATimezoneTables_2014.zip
          • In HANA Studio, execute the import query as SYSTEM user
          • IMPORT “TTZZ”,”TTZD”,”TTZDF”,”TTZDV” AS CSV FROM ‘/usr/sap/<SID>/HDB<INSTNO>/work/HANATimezoneTables_2014’ WITH REPLACE AT LOCATION ‘<master_node_name>:<indexserver_port>’;
        • In a single-node system, import the attached timezone configuration tables into SYSTEM schema.
      3. Set the configuration parameter use_startup_timezone to true in indexserver.ini, statisticsserver.ini, xsengine.ini files if this parameter value had been set to false in previous releases. Be informed that the default value of this parameter is true, so there is no additional configuration needed if it was not set to false in previous releases.
  2. HANA Database Revision from Rev65 to Rev68
    1. Set the configuration parameter use_startup_timezone to false in indexserver.ini, statisticsserver.ini, xsengine.ini files, the parameter need to be set to false before the DST starts, and will need to be set back to true after DST ends.
    2. To set the parameter:
      alter system alter configuration (‘indexserver.ini’, ‘SYSTEM’) SET (‘sql’, ‘use_startup_timezone’) = ‘false’ with reconfigure;

      alter system alter configuration (‘statisticsserver.ini’, ‘SYSTEM’) SET (‘sql’, ‘use_startup_timezone’) = ‘false’ with reconfigure;

      alter system alter configuration (‘xsengine.ini’, ‘SYSTEM’) SET (‘sql’,’use_startup_timezone’) = ‘false’ with reconfigure;

Note: HANA Rev65 to Rev68, it is required to apply the solution specified in step 2.i. and 2.ii. for both HANA standalone and HANA with ABAP application servers.

3. HANA Database Revision 64 or below

There should not be any problem in current_timestamp value. However, if DST rules are not up-to-date, then it is possible for the SQL Function utctolocal does not return correct value.

    To resolve this, 

    1. Create HANA timezone tables in SYSTEM schema.
      1. Apply SAP Note 1791342 if ABAP application servers run on top of HANA database.
      2. Import attached timezone configuration tables into SYSTEM schema for HANA standalone database.
        • In a scale-out system, need to import the tables into the master node.
          • Copy the attached file “HANATimezoneTables_2014.zip” to the work directory of master node ( /usr/sap/<SID>/HDB<INSTNO>/work )
          • cd /usr/sap/<SID>/HDB<INSTNO>/work
          • unzip HANATimezoneTables_2014.zip
          • In HANA Studio, execute the import query as SYSTEM user
          • IMPORT “TTZZ”,”TTZD”,”TTZDF”,”TTZDV” AS CSV FROM ‘/usr/sap/<SID>/HDB<INSTNO>/work/HANATimezoneTables_2014’ WITH REPLACE AT LOCATION ‘<master_node_name>:<indexserver_port>’;
        • In a single-node system, import the attached timezone configuration tables into SYSTEM schema.
    2. The configuration parameter use_startup_timezone does not exist in Revision 64 or below.

4. Restart HANA Database to apply the changes made in HANA timezone configuration.

 

Leave a Reply