Oracle-rac Sysdate and current_date time are inconsistent, resulting in a delay in client connection time

Source: Internet
Author: User

[[Email protected] ~]$ Date
Tue Oct 14:20:56 CST 2017
[Email protected] ~]$ Cat/etc/sysconfig/clock
# The time zone of the system is defined by the contents of/etc/localtime.
# This file was only for evaluation by System-config-date, does not rely in its
# contents elsewhere.
Zone= "Asia/shanghai"
[Email protected] ~]$ Sqlplus/as SYSDBA

Sql*plus:release 11.2.0.3.0 Production on Tue Oct 10 14:21:11 2017

Copyright (c) 1982, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the partitioning, Real application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real application testing options

[Email protected]> select dbtimezone from dual;

Dbtimezone
------------
+00:00

[Email protected]> select sysdate from dual;

Sysdate
-----------------------
10-oct-2017 14:21:28

[Email protected]> select current_date from dual;

Current_date
-----------------------
10-oct-2017 14:21:37

[Email protected]>

But when connected with third-party tools such as Toad or Plsql, Sysdate is three hours slow.

Because it is a clustered database server, the Oracle 11.2.0.3 Grid directly reads the operating system time zone,

The time zone of the ORACLE 11.2.0.3 grid is placed in the $oracle_home/crs/install/s_crsconfig_hostname_env.txt* file

View this file found TZ is not the same as the zone value of clock file

Change the TZ value of this configuration file of two node service to the same value as the clock file, i.e. tz= "Asia/shanghai" (root user)

Then restart the cluster CRS

Oracle-rac Sysdate and current_date time are inconsistent, resulting in a delay in client connection time

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.