1. 首页 > ITPUX技术网 > 正文

改时区

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

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息