Oracle sysdate內部時間與作業系統不一致

來源:互聯網
上載者:User

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>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.