Based on this question and the respective answers I made the next table:
Then I have the next questions:
- What is the role of the Database time in this?
- There is a way of obtain the time zone of the Database OS?
There is a way of obtain the time zone of the Database OS?
Yes, you can do
SELECT TO_CHAR(SYSTIMESTAMP, 'TZR') FROM dual;
or
SELECT EXTRACT(TIMEZONE_REGION FROM SYSTIMESTAMP) FROM dual;
What is the role of the Database time in this?
Actually this is not relevant in daily use, it is used only for TIMESTAMP WITH LOCAL TIME ZONE
data type columns and defines the storage format.
Take following analogy to understand DBTIMEZONE
and TIMESTAMP WITH LOCAL TIME ZONE
: Whenever you have to work with time zones a common approach is to store all times in UTC and convert the time at application layer according to current user settings.
That is exactly how TIMESTAMP WITH LOCAL TIME ZONE
works but on SQL-Level. Only difference: Oracle does not store TIMESTAMP WITH LOCAL TIME ZONE
times fixed at UTC time but at DBTIMEZONE time. Hence you cannot change DBTIMEZONE
on your database if the database contains a table with a TIMESTAMP WITH LOCAL TIME ZONE
column and the column contains data.