文档课题:Oracle查看和修改时区.
Oracle时区分两类:数据库时区和session时区.
1、查询时区
查数据库时区.
sys@ORCL 2022-10-13 11:43:39> select dbtimezone from dual;

DBTIM
------
+00:00
查看session时区.
sys@ORCL 2022-10-13 11:40:52> select sessiontimezone from dual;

SESSIONTIMEZONE
---------------------------------------------------------------------------
+08:00
2、修改时区
2.1、数据库时区
sys@ORCL 2022-10-13 11:41:03> alter database set time_zone='+8:00';

Database altered.
sys@ORCL 2022-10-13 11:44:26> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORCL 2022-10-13 11:45:17> startup
ORACLE instance started.

Total System Global Area 2522038272 bytes
Fixed Size 2255872 bytes
Variable Size 1291846656 bytes
Database Buffers 1207959552 bytes
Redo Buffers 19976192 bytes
Database mounted.
Database opened.
sys@ORCL 13-OCT-22> select dbtimezone from dual;

DBTIME
------
+08:00
2.2、session时区
session的timezone修改.
sys@ORCL 13-OCT-22> alter session set time_zone='+5:00';

Session altered.

sys@ORCL 13-OCT-22> select sessiontimezone from dual;

SESSIONTIMEZONE
---------------------------------------------------------------------------
+05:00

参考网址:https://blog.csdn.net/weixin_38618988/article/details/124427257