Home >Database >Mysql Tutorial >Oracle sysdate内部时间与操作系统不一致

Oracle sysdate内部时间与操作系统不一致

WBOY
WBOYOriginal
2016-06-07 17:22:051812browse

Oracle 11g RAC,内部时间是通过ctss服务进行同步的,在安装时候,默认都会将ntpd去掉,使用ctss。但是运行一段时间后发现,orac

Oracle 11g RAC,,内部时间是通过ctss服务进行同步的,在安装时候,默认都会将ntpd去掉,使用ctss。
但是运行一段时间后发现,oracle内部时间和操作系统存在时间上的差异,因此,oracle数据库和操作系统需要一个时间同步服务器;

/sbin/service ntpd status
ntpd (pid 4403) is running...

ps -ef|grep ntp
ntp      2113    1  0 Dec09 ?        00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -x

grep OPTIONS /etc/sysconfig/ntpd
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -x"

To start:

/sbin/service ntpd start

[grid@rac01 ~]$ crsctl check ctss
 CRS-4701: The Cluster Time Synchronization Service is in Active mode.
 CRS-4702: Offset (in msec): 0
 
当ctss检测到系统上有ntp时,会自动将模式切换到被动模式
[grid@HBCADB001 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.
 
SQL> select sessiontimezone,to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
SESSIONTIMEZONE
---------------------------------------------------------------------------
TO_CHAR(SYSDATE,'
-----------------
+08:00
20121029 14:14:10

SQL> !date
Mon Oct 29 14:14:13 CST 2012
SQL>

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn