文档课题: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
Oracle查看和修改时区
原创
©著作权归作者所有:来自51CTO博客作者Liujun_Deng的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
DBeaver连接oracle数据库oracle 监听器 数据库 DBeaver jdbc