Heim > Datenbank > MySQL-Tutorial > RAC环境下SYSDATE返回错误时间

RAC环境下SYSDATE返回错误时间

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-06-07 16:40:30
Original
1204 Leute haben es durchsucht

某客户反馈说,在11.2.0.3的RAC下,使用sqlplus连接时查询sysdate返回的时间是正确的,但是使用PL/SQL等通过Listener方式连接的时候,则返回错误的时间。 其实造成这个问题的原因是11.2.0.2后的新特性: 11.2.0.1的时候TZ变量取决于grid和root用户的shell环

某客户反馈说,在11.2.0.3的RAC下,使用sqlplus连接时查询sysdate返回的时间是正确的,但是使用PL/SQL等通过Listener方式连接的时候,则返回错误的时间。

其实造成这个问题的原因是11.2.0.2后的新特性:

11.2.0.1的时候TZ变量取决于grid和root用户的shell环境变量TZ。

但是从11.2.0.2开始,Oracle的集群(GI)开始拥有自己的时区和配置,即TZ参数存在$GRID_HOME/crs/install/s_crsconfig__env.txt中设置的time zone。

[grid@11gR2 install]$ cat s_crsconfig_11gr2_env.txt
### This file can be used to modify the NLS_LANG environment variable, which determines the charset to be used for messages.
### For example, a new charset can be configured by setting NLS_LANG=JAPANESE_JAPAN.UTF8
### Do not modify this file except to change NLS_LANG, or under the direction of Oracle Support Services
TZ=Asia/Shanghai
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
TNS_ADMIN=
ORACLE_BASE=
Nach dem Login kopieren

一般集群的时区是在安装GI时从系统获取的。经过沟通后,客户确实在前段时间更改过系统时区,至此造成的sysdate返回错误的原因就是因为当操作系统的时区发生改变时,但是GI的时区未改变。

具体修改可以参考MOS:How To Change Timezone for 11gR2 Grid Infrastructure (Doc ID 1209444.1)

Verwandte Etiketten:
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage