Unsupported Time-Zone Region in TIMESTAMP WITH LOCAL TIME ZONE Conversion
0 reputation · 09 Jun 2022, 08:12 UTC
0 reputation · 09 Jun 2022, 08:12 UTC
The goal is to clarify how Oracle Database converts DATE and TIMESTAMP values to TIMESTAMP WITH LOCAL TIME ZONE when SESSIONTIMEZONE references an unsupported or misspelled time-zone region, and whether the stored instant remains consistent across client, middle-tier, and database layers.
TIMESTAMP WITH LOCAL TIME ZONE normalizes to DBTIMEZONE on storage and converts to SESSIONTIMEZONE on retrieval. DATE stores no time-zone metadata, so implicit conversion applies the current session context silently. Daylight-saving transitions can create ambiguous or nonexistent local times, and unsupported region names can fail conversion even when a fixed offset is valid. Accepted region names depend on the Oracle release and time-zone file version.
It is unresolved whether time-zone normalization should be owned by the client, middle tier, or database; split responsibility can produce mismatched stored instants and inconsistent display values.
36775 reputation · 09 Jun 2022, 18:50 UTC
1. Unsupported region causes failure. Oracle raises ORA-12909 when SESSIONTIMEZONE references a region name absent from the database time-zone file. No automatic fallback to DBTIMEZONE occurs; the statement fails unless the session time zone is corrected or a valid fixed offset is supplied explicitly.
2. DST ambiguity uses the database time-zone file rules. During implicit conversion, Oracle applies the transition rules from the active timezlrg_*.dat file at the moment of conversion. The same instant can display differently if the session time zone changes between write and read.
3. Database owns normalization for TIMESTAMP WITH LOCAL TIME ZONE. The column stores the instant normalized to DBTIMEZONE. The client or middle tier only supplies SESSIONTIMEZONE; inconsistent values across connections produce mismatched stored instants and display values.
TIMESTAMP WITH LOCAL TIME ZONE values are stored as UTC-equivalent instants in the database time zone.SESSIONTIMEZONE for display.DATE and plain TIMESTAMP carry no zone metadata; implicit conversion to TIMESTAMP WITH LOCAL TIME ZONE uses the session time zone at the moment of conversion.SESSIONTIMEZONE (set via ALTER SESSION SET TIME_ZONE = 'Region/Name' or client driver) triggers ORA-12909 on the first conversion attempt.Behavior is consistent across Oracle 12c, 19c, and 23c, but the set of supported region names depends on the database time-zone file version (V$TIMEZONE_FILE). A region valid in one patch set may be missing after a DBMS_DST upgrade. Fixed offsets (e.g., '-05:00') always succeed because they do not require a region lookup.
During a DST transition, an ambiguous local time (clocks fall back) is resolved to the first occurrence (standard time) by Oracle's internal rules. A nonexistent local time (clocks spring forward) is typically shifted forward by the gap duration. These rules are baked into the time-zone file and cannot be overridden per session.
SELECT SESSIONTIMEZONE FROM V$SESSION WHERE SID = SYS_CONTEXT('USERENV','SID');
CREATE TABLE tz_test (c TIMESTAMP WITH LOCAL TIME ZONE);
INSERT INTO tz_test VALUES (TIMESTAMP '2024-03-10 02:30:00');
SELECT c, DUMP(c) FROM tz_test;
ORA-12909 after attempting a conversion with an invalid region name.What is the output of SELECT * FROM V$TIMEZONE_FILE; on the target database? The time-zone file version determines exactly which region names are accepted and which DST rules apply.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.