Oracle归档日志所在目录时间不对&&Oracle集群日志时间显示错误

前言

这个问题在18年的时候遇到了,基本不注意并且集群或者数据库运行正常是很难注意到的。

忘记当时怎么发现的了,最近拿出来重现一下问题。

具体描述一下问题:

比如当前时间是2020年07月03日0点,数据库对redo log发起归档。

在OMF下,归档会按照日期进行分类归档。

但是发起归档之后,新的归档文件会放在的20200702的目录中。

另外,db和asm和集群的警告日志的时间也和操作系统的date时间不一致。

现象

在我的测试环境中,关闭所有节点的集群之后,更改时间:

[root@rac1 ~]# date -s "2020-07-03 00:00:00"
Fri Jul :: CST

然后,启动所有节点的集群,可以依次观察

集群的警告日志,grid用户下,$ORACLE_HOME/log/rac1/alertrac1.log

-- ::26.667:
[ohasd()]CRS-:The OLR service started on node rac1.
-- ::26.675:
[ohasd()]CRS-:Oracle High Availability Service started on node rac1.
-- ::26.676:
[ohasd()]CRS-:location: /etc/oracle/lastgasp has reboot advisory log files, were announced and errors occurred
-- ::30.080:
[/u01/app/11.2./grid/bin/orarootagent.bin()]CRS-:Cannot get GPnP profile. Error CLSGPNP_NO_DAEMON (GPNPD daemon is not running).
-- ::34.563:
[gpnpd()]CRS-:GPNPD started on node rac1.
-- ::36.992:
[cssd()]CRS-:CSSD daemon is started in clustered mode
-- ::38.798:
[ohasd()]CRS-:Resource state recovery not attempted for 'ora.diskmon' as its target state is OFFLINE
-- ::01.319:
[cssd()]CRS-:Lease acquisition for node rac1 number completed
-- ::02.612:
[cssd()]CRS-:CSSD voting file is online: /dev/mapper/asm-ocr02; details in /u01/app/11.2./grid/log/rac1/cssd/ocssd.log.
-- ::02.620:
[cssd()]CRS-:CSSD voting file is online: /dev/mapper/asm-ocr03; details in /u01/app/11.2./grid/log/rac1/cssd/ocssd.log.
-- ::02.623:
[cssd()]CRS-:CSSD voting file is online: /dev/mapper/asm-ocr01; details in /u01/app/11.2./grid/log/rac1/cssd/ocssd.log.
-- ::15.917:
[cssd()]CRS-:CSSD Reconfiguration complete. Active nodes are rac1 rac2 .
-- ::18.061:
[ctssd()]CRS-:The Cluster Time Synchronization Service on host rac1 is in observer mode.
-- ::18.421:
[ctssd()]CRS-:The new Cluster Time Synchronization Service reference node is host rac1.
-- ::18.422:
[ctssd()]CRS-:The Cluster Time Synchronization Service started on host rac1.
-- ::20.023:
[ohasd()]CRS-:Resource state recovery not attempted for 'ora.diskmon' as its target state is OFFLINE
[client()]CRS-:-Jul- : ACFS-: Checking for existing ADVM/ACFS installation.
[client()]CRS-:-Jul- : ACFS-: Validating ADVM/ACFS installation files for operating system.
[client()]CRS-:-Jul- : ACFS-: Verifying ASM Administrator setup.
[client()]CRS-:-Jul- : ACFS-: Loading installed ADVM/ACFS drivers.
[client()]CRS-:-Jul- : ACFS-: Loading 'oracleoks.ko' driver.
[client()]CRS-:-Jul- : ACFS-: Loading 'oracleadvm.ko' driver.
[client()]CRS-:-Jul- : ACFS-: Loading 'oracleacfs.ko' driver.
........

ASM实例警告日志,

Thu Jul  ::
NOTE: No asm libraries found in the system
NOTE: No asm libraries found in the system
MEMORY_TARGET defaulting to .
* instance_number obtained from CSS = , checking for the existence of node ...
* node does not exist. instance_number =
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is and used is bytes. Ensure that the mount point is /dev/shm for this directory.
LICENSE_MAX_SESSION =
LICENSE_SESSIONS_WARNING =
Initial number of CPU is
Number of processor cores in the system is
Number of processor sockets in the system is
Private Interface 'eth1:1' configured from GPnP for use as a private interconnect.
[name='eth1:1', type=, ip=169.254.146.181, mac=-0c----8b, net=169.254.0.0/, mask=255.255.0.0, use=haip:cluster_interconnect/]
Public Interface 'eth0' configured from GPnP for use as a public interface.
[name='eth0', type=, ip=192.168.180.100, mac=-0c----, net=192.168.180.0/, mask=255.255.255.0, use=public/]
Picked latch-free SCN scheme
Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/app/11.2./grid/dbs/arch
Autotune of undo retention is turned on.
LICENSE_MAX_USERS =
SYS auditing is disabled
NOTE: Volume support enabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4. - 64bit Production
With the Real Application Clusters and Automatic Storage Management options.
ORACLE_HOME = /u01/app/11.2./grid
System name: Linux
Node name: rac1.example.com
Release: 2.6.-.el6.x86_64
Version: # SMP Wed Jul :: EDT
Machine: x86_64
VM name: VMWare Version:
Using parameter settings in server-side spfile +OCR/rac-cluster/asmparameterfile/registry.253.1034884609

DB的警告日志,

Thu Jul  ::
Adjusting the default value of parameter parallel_max_servers
from to due to the value of parameter processes ()
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION =
LICENSE_SESSIONS_WARNING =
Initial number of CPU is
Number of processor cores in the system is
Number of processor sockets in the system is
Private Interface 'eth1:1' configured from GPnP for use as a private interconnect.
[name='eth1:1', type=, ip=169.254.146.181, mac=-0c----8b, net=169.254.0.0/, mask=255.255.0.0, use=haip:cluster_interconnect/]
Public Interface 'eth0' configured from GPnP for use as a public interface.
[name='eth0', type=, ip=192.168.180.100, mac=-0c----, net=192.168.180.0/, mask=255.255.255.0, use=public/]
Public Interface 'eth0:2' configured from GPnP for use as a public interface.
[name='eth0:2', type=, ip=192.168.180.111, mac=-0c----, net=192.168.180.0/, mask=255.255.255.0, use=public/]
Picked latch-free SCN scheme
Autotune of undo retention is turned on.
LICENSE_MAX_USERS =
SYS auditing is disabled
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.4. - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options.
ORACLE_HOME = /u01/app/oracle/product/11.2./db_1
System name: Linux
Node name: rac1.example.com
Release: 2.6.-.el6.x86_64

可以看到,日志开头全都是2020年07月02日的9点初。

我们再看看归档的情况,

在此之前,先删除之前的所有归档便于观察。

[oracle@rac2 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jul 3 00:20:01 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ZKM (DBID=4210149549)

RMAN> delete force noprompt archivelog all;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=200 instance=zkm2 device type=DISK
List of Archived Log Copies for database with db_unique_name ZKM
===================================================================== Key Thrd Seq S Low Time
------- ---- ------- - ---------
91 1 56 A 02-JUL-20
Name: +ARCH/zkm/archivelog/2020_07_03/thread_1_seq_56.303.1044695873 92 2 21 A 02-JUL-20
Name: +ARCH/zkm/archivelog/2020_07_02/thread_2_seq_21.299.1044695875 deleted archived log
archived log file name=+ARCH/zkm/archivelog/2020_07_03/thread_1_seq_56.303.1044695873 RECID=91 STAMP=1044749873
deleted archived log
archived log file name=+ARCH/zkm/archivelog/2020_07_02/thread_2_seq_21.299.1044695875 RECID=92 STAMP=1044695874
Deleted 2 objects

其中一个节点发出命令归档redo log,

SYS@zkm1> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.

SYS@zkm1>
SYS@zkm1> select sysdate from dual; SYSDATE
------------------------
2020-07-03 00:20:27 SYS@zkm1> alter system archive log current; System altered.

观察警告日志,显示的时间是“Thu Jul 02 09:20:32 2020”。

Thu Jul 02 09:20:32 2020
Thread 1 advanced to log sequence 58 (LGWR switch)
Current log# 2 seq# 58 mem# 0: +DATA/zkm/onlinelog/group_2.258.1034889845
Current log# 2 seq# 58 mem# 1: +ARCH/zkm/onlinelog/group_2.258.1034889845
Thu Jul 02 09:20:32 2020
Archived Log entry 93 added for thread 1 sequence 57 ID 0xfaf1eead dest 1:

进去ASM磁盘查看文件情况,

ASMCMD> ls -l
Type Redund Striped Time Sys Name
Y 2020_07_02/
ASMCMD> ls -l *
Type Redund Striped Time Sys Name
ARCHIVELOG UNPROT COARSE JUL 02 09:00:00 Y thread_1_seq_57.299.1044696033
ARCHIVELOG UNPROT COARSE JUL 02 09:00:00 Y thread_2_seq_22.303.1044696033
ASMCMD> pwd
+arch/zkm/ARCHIVELOG

至此,问题完全重现成功。

原因

不知道各位发现没有,实际上最开始启动集群(crsctl start crs)那一瞬间(大概是2020-07-03 00:00:00多,刚改完时间不到1分钟),

集群的警告日志最开始出现的时间为“2020-07-02 09:00:26.667:”,基本相差15小时。

因此很容易也可以猜出,是由于时区的原因。

系统的时区为:

[grid@rac1 ~]$ cat /etc/sysconfig/clock
# The time zone of the system is defined by the contents of /etc/localtime.
# This file is only for evaluation by system-config-date, do not rely on its
# contents elsewhere.
ZONE="Asia/Shanghai"

那么,集群应该也有自己的配置文件对应的时区,也就是集群不依赖OS的时区(-_-||)。

mos可以找到这么一篇文章:

How To Change Timezone for Grid Infrastructure (Doc ID 1209444.1)

Oracle归档日志所在目录时间不对&&Oracle集群日志时间显示错误的更多相关文章

  1. ORACLE 12C 之集群日志位置变化

    如果你还是使用 oracle 11g RAC 的目录结构方式寻找集群的日志,你会发现目录中所有的日志都是空的.actdb21:/oracle/app/12.2.0/grid/log/actdb21(+ ...

  2. windows 环境怎样恢复 (oracle 11g grid) ocr voting 损坏的集群

     windows 环境怎样恢复 (oracle 11g grid) ocr voting 损坏的集群 oracle 11g 以后 ocr 能够放到 asm 磁盘上,而ASM的启动依赖于ocr和vo ...

  3. Elasticstack 5.1.2 集群日志系统部署及实践

    Elasticstack 5.1.2 集群日志系统部署及实践 一.ELK Stack简介 ELK Stack 是Elasticsearch.Logstash.Kibana三个开源软件的组合,在实时数据 ...

  4. centos7搭建ELK Cluster集群日志分析平台(二):Logstash

    续  centos7搭建ELK Cluster集群日志分析平台(一) 已经安装完Elasticsearch 5.4 集群. 安装Logstash步骤 . 安装Java 8 官方说明:需要安装Java ...

  5. centos7搭建ELK Cluster集群日志分析平台

    应用场景:ELK实际上是三个工具的集合,ElasticSearch + Logstash + Kibana,这三个工具组合形成了一套实用.易用的监控架构, 很多公司利用它来搭建可视化的海量日志分析平台 ...

  6. 大数据项目之_15_帮助文档_NTP 配置时间服务器+Linux 集群服务群起脚本+CentOS6.8 升级到 python 到 2.7

    一.NTP 配置时间服务器1.1.检查当前系统时区1.2.同步时间1.3.检查软件包1.4.修改 ntp 配置文件1.5.重启 ntp 服务1.6.设置定时同步任务二.Linux 集群服务群起脚本2. ...

  7. ElasticSearch+Logstash+Filebeat+Kibana集群日志管理分析平台搭建

    一.ELK搜索引擎原理介绍 在使用搜索引擎是你可能会觉得很简单方便,只需要在搜索栏输入想要的关键字就能显示出想要的结果.但在这简单的操作背后是搜索引擎复杂的逻辑和许多组件协同工作的结果. 搜索引擎的组 ...

  8. centos7搭建ELK Cluster集群日志分析平台(四):Fliebeat-简单测试

    续之前安装好的ELK集群 各主机:es-1 ~ es-3 :192.168.1.21/22/23 logstash: 192.168.1.24 kibana: 192.168.1.25 测试机:cli ...

  9. centos7搭建ELK Cluster集群日志分析平台(三):Kibana

    续  centos7搭建ELK Cluster集群日志分析平台(一) 续  centos7搭建ELK Cluster集群日志分析平台(二) 已经安装好elasticsearch 5.4集群和logst ...

随机推荐

  1. Java实现有向图强连通分量的Tarjan算法

    1 问题描述 引用自百度百科: 如果两个顶点可以相互通达,则称两个顶点强连通(strongly connected).如果有向图G的每两个顶点都强连通,称G是一个强连通图.有向图的极大强连通子图,称为 ...

  2. java实现第五届蓝桥杯六角填数

    六角填数 题目描述 如图[1.png]所示六角形中,填入1~12的数字. 使得每条直线上的数字之和都相同. 图中,已经替你填好了3个数字,请你计算星号位置所代表的数字是多少? 请通过浏览器提交答案,不 ...

  3. Linux 用户组管理命令

    groupadd 组名,可以添加用户组 groupmod -n 新组名 老组名,可以修改组名 groupdel 组名,可以删除组(组中不能有初始用户存在,附加用户无所谓) gpasswd -a 用户名 ...

  4. 浅谈js原型

    前言 突发奇想,想写一篇原型的文章,也可能是因为对原型有更深的理解吧,在这里做个记录,来记录下自己的理解加深下记忆. 总之,希望本文的内容能够对您的学习或者工作有所帮助.另,如果有任何的错误或者不足请 ...

  5. iOS-PCH File的快速导入方法和使用

    PCH的文件的用途:      在实际的项目开发中,如果很多地方都在使用某个类的头文件,很多地方都在使用同一个”宏”的时候:很多地方用到了NSLog()函数, 在app发布的时候,想清除掉时,此时就需 ...

  6. 并发编程之sun.misc.Unsafe类

    1.Unsafe知识点整理 2.代码: package com.javabasic.unsafe; import java.lang.reflect.Field; import sun.misc.Un ...

  7. CSS3弹性布局内容对齐(justify-content)属性使用详解

    内容对齐(justify-content)属性应用在弹性容器上,把弹性项沿着弹性容器的主轴线(main axis)对齐. 该操作发生在弹性长度以及自动边距被确定后. 它用来在存在剩余空间时如何加以分配 ...

  8. 一台电脑如何使用多个git账号?

    git相信大家都在用,一般公司有一个账号,放公司自己架的服务器中,员工自己还有一个github或者gitee的账号,存放自己的一些私有代码.本篇文章总结一下,本人在公司开发机上,使用多个git账号的干 ...

  9. 解决:gradle 前言中不允许有内容

    将Android Studio 升级到4.0然后创建一个新项目,编译出现“ gradle 前言中不允许有内容” 的错误,在网上找了很多资料,众说纷纭,但都没有解决我的问题,最后反复摸索把问题解决了. ...

  10. EIGRP-9-弥散更新算法-拓扑表

    弥散更新算法(DUAL)是一个收敛算法.它代替了其他距离矢量协议使用的Bellman-Ford 算法.路由环路.甚至是在协议完全收敛前出现的瞬时环路.都会对网络性能造成不良影响.为了防止环路的形成.D ...