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.
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.
- 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.
Attachments with updated timezone data will be provided with this note.
Updated data is applied by the following:
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,
To reconfigure the system execute as SYSTEM user:
The SAP HANA configuration parameter [sql] use_startup_timezone is an internal parameter and may only be used in the context of this SAP Note. Using such a parameter requires that the SAP HANA system has the revision specified in the SAP Note, the described error situation has occurred, and that SAP support or services has instructed the customer to set/change the parameter. Using internal parameters outside of this given scope is not supported.
- HANA Database Revision 69 or above
- Create HANA timezone tables in SYSTEM schema.
- Apply SAP Note 1791342 if ABAP application servers run on top of HANA database.
- 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_2015_V08.zip" to the work directory of master node ( /usr/sap/<SID>/HDB<INSTNO>/work )
- cd /usr/sap/<SID>/HDB<INSTNO>/work
- unzip HANATimezoneTables_2015_V08.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_2015_V08' WITH REPLACE AT LOCATION '<master_node_name>:<indexserver_port>';
- In a single-node system, import the attached timezone configuration tables into SYSTEM schema.
- 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.
- HANA Database Revision from Rev65 to Rev68
- 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.
- 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;
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,
- Create HANA timezone tables in SYSTEM schema.
- Apply SAP Note 1791342 if ABAP application servers run on top of HANA database.
- 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_2015_V08.zip" to the work directory of master node ( /usr/sap/<SID>/HDB<INSTNO>/work )
- cd /usr/sap/<SID>/HDB<INSTNO>/work
- unzip HANATimezoneTables_2015_V08.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_2015_V08' WITH REPLACE AT LOCATION '<master_node_name>:<indexserver_port>';
- In a single-node system, import the attached timezone configuration tables into SYSTEM schema.
- The configuration parameter use_startup_timezone does not exist in Revision 64 or below.
To reconfigure the system execute as SYSTEM user:
- ALTER SYSTEM RECONFIGURE SERVICE( 'indexserver', '', 0 )
- ALTER SYSTEM RECONFIGURE SERVICE( 'statisticsserver', '', 0 )
- ALTER SYSTEM RECONFIGURE SERVICE( 'xsengine', '', 0 )
For multi-tenant systems, each tenant
database and the SystemDB are completely separate systems. They can and
should have separate tables each, although the contents can be
identical.
If cross-database queries are used, it is
strongly recommended that all databases involved use the same set of
timezone data, otherwise unforeseen issues may occur.
How to check the current timezone:
Current timezone value in HANA is taken from <sidadm> user's OS environmental variable, TZ, during startup.
You can check the current timezone information using the following query:
SELECT * FROM M_HOST_INFORMATION WHERE KEY = 'timezone_name';
If the timezone environmental variable is
found from HANA timezone tables in SYSTEM schema, then HANA timezone
conversion tables are used. If no timezone information is found in
timezone tables in SYSTEM schema, then HANA internal data structures are
used as fallback. If the system timezone cannot be found in the
timezone information, operating system conversion functionality will be
used for some time functionality (e.g. CURRENT_TIME/CURRENT_TIMESTAMP
but not LOCALTOUTC/UTCTOLOCAL). Since HANA timezone tables are
compatible with ABAP timezone tables, please check if the timezone
information is defined in TZONE in TTZZ table.
Presence of the timezone can be checked using the following query:
SELECT TZONE FROM TTZZ;
If the local OS timezone is found in TTZZ
but produces unexpected results (e.g. due to identical identifiers for
different timezones, different application of DST rules, ...), you can
set use_startup_timezone = false to get the timezone data from OS. This
applies to HANA revisions 65 or newer.
After applying the change, please check with the following queries:
SELECT CURRENT_TIMESTAMP FROM DUMMY;
SELECT LOCALTOUTC('2014-11-02 01:00:00', '<Timezone>') FROM DUMMY;
DISCLAIMER:The SAP HANA configuration parameter [sql] use_startup_timezone is an internal parameter and may only be used in the context of this SAP Note. Using such a parameter requires that the SAP HANA system has the revision specified in the SAP Note, the described error situation has occurred, and that SAP support or services has instructed the customer to set/change the parameter. Using internal parameters outside of this given scope is not supported.
Header Data
Released On | 18.12.2015 18:21:55 | ||
Release Status | Released for Customer | ||
Component | HAN-DB SAP HANA Database | ||
Other Components |
| ||
Priority | Recommendations / Additional Info | ||
Category | Program error |
No comments:
Post a Comment