Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle rac time is out of sync

Shulou Source: shulou.com Published: 2022-06-01 07:42:15 11月14日 Update

Oracle rac 11.2.0.4 the time of two nodes is out of sync

Check the time zone of the database and find that it is different:

Node oracle3:

SQL > SELECT TZ_OFFSET (SESSIONTIMEZONE), TZ_OFFSET (DBTIMEZONE) FROM DUAL

TZ_OFFS TZ_OFFS

--

+ 08:00 + 00:00

Node Oracle4:

SQL > SELECT TZ_OFFSET (SESSIONTIMEZONE), TZ_OFFSET (DBTIMEZONE) FROM DUAL

TZ_OFFS TZ_OFFS

--

+ 00:00 + 00:00

Then check the cluster time synchronization server and find that the status is in observation mode and the normal state should be active!

Node Oracle3

[oracle@oracle3 ~] $crsctl check ctss

CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

Node Oracle4

[oracle@oracle4 ~] $crsctl check ctss

CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

View the current time zone of the Linux server with the following command:

[root@oracle4 ~] # date + "Z% z"

Or

[root@oracle4] # date-R

Specific results, as follows, found to be different!

Node Oracle3:

[root@oracle3 ogg] # date + "Z z"

UTC + 0000

Node Oracle4:

[oracle@oracle3 ~] $date + "Z% z"

CST + 0800

Modify the setting time zone, method 2 I use

Method 1, and then select

Tzselect

Method 2

Copy the appropriate time zone file, replace the system time zone file, or create a link file

Cp / usr/share/zoneinfo/$ Primary time Zone / $Sub time Zone / etc/localtime

For example, in China, you can use:

Cp / usr/share/zoneinfo/Asia/Shanghai / etc/localtime

Then, after adjusting the time zone, check the cluster time synchronization service again and find that the status is still incorrect.

Node Oracle3

[oracle@oracle3 ~] $crsctl check ctss

CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

Node Oracle4

[oracle@oracle4 ~] $crsctl check ctss

CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

Some people on the Internet say that they need to stop the ntpd service of Linux. The person who checks me is stop.

[root@oracle3 Asia] # service ntpd status

Ntpd is stopped

[root@oracle4 Asia] # service ntpd status

Ntpd is stopped

Others say that the configuration file needs to be deleted, and the status of the cluster time synchronization service is still incorrect after deletion.

Mv / etc/ntp.conf / etc/ntp.conf.bak

After the operation is completed, it is still not good.

It turns out that the time difference between my two machines is so great that they can't be synchronized after more than a second.

Then modify the time for the other one.

[root@oracle3 Asia] # date-s "15:41:26 CST"

Check again that the status of ctss time synchronization service is active:

[oracle@oracle3 ~] $crsctl check ctss

CRS-4701: The Cluster Time Synchronization Service is in Active mode.

CRS-4702: Offset (in msec): 1729800

[oracle@oracle4 ~] $crsctl check ctss

CRS-4701: The Cluster Time Synchronization Service is in Active mode.

CRS-4702: Offset (in msec): 1729800

Tags: Node time zone time synchronization service state file method cluster no again server two commands that is data database machine schema system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS NVidia Shulou Technology OPPO Reno Microsoft