改时区

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:428

SQL> alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';

Session altered.

SQL> select sysdate from dual;

SYSDATE
-------------------
2018-11-12 16:18:50

SQL> select dbtimezone from dual;

DBTIME
------
+08:00

[root@target ~]# rm -rf /etc/localtime
[root@target ~]# ln -s /usr/share/zoneinfo/America/Kentucky/Monticello /etc/localtime
[root@target ~]# su - oracle
[oracle@target ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on 星期一 11月 12 03:33:18 2018

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2722467840 bytes
Fixed Size 2231472 bytes
Variable Size 1644168016 bytes
Database Buffers 1056964608 bytes
Redo Buffers 19103744 bytes
Database mounted.
Database opened.
SQL> alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';

Session altered.

SQL> select dbtimezone from dual;

DBTIME
------
+08:00

SQL> select sysdate from dual;

SYSDATE
-------------------
2018-11-12 03:34:19

[root@target ~]# date
Mon Nov 12 03:36:17 EST 2018

[oracle@target ~]$ date -R
Mon, 12 Nov 2018 03:40:56 -0500

本文标签:
本文标题:改时区
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】