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中Timer类的详细介绍(详解)

    一.概念 定时计划任务功能在Java中主要使用的就是Timer对象,它在内部使用多线程的方式进行处理,所以它和多线程技术还是有非常大的关联的.在JDK中Timer类主要负责计划任务的功能,也就是在指定 ...

  2. 解读三组容易混淆的Dockerfile指令

    长话短说,今天分享三组容易混淆的Dockerfile指令, 帮助大家编写更优雅的Dockfile文件.构建更纯净的Docker镜像. COPY vs ADD COPY.ADD主体功能类似:从指定位置拷 ...

  3. elementUI+国际化

    1. 先创建一个lang 文件夹,创建两个js文件en.js(英文), zh.js(中文), 另外创建一个index.js文件(用于) en.js zh.js (两者必须保持一致) 2. 在index ...

  4. 掌握SpringBoot-2.3的容器探针:实战篇

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:原创文章分类汇总,及配套源码,涉及Java.Docker.K8S.DevOPS等 经过多篇知识 ...

  5. 关于cronExpression表达式

    spring 定时任务设置,关于cronExpression表达式: 字段 允许值 允许的特殊字符 秒 0-59 , - * / 分 0-59 , - * / 小时 0-23 , - * / 日期 1 ...

  6. 【译】Introducing YARP Preview 1

    1 YARP YARP是一个项目,用于创建反向代理服务器.它开始于我们注意到来自微软内部团队的一系列问题.他们要么为其服务构建反向代理,要么询问 API 和用于构建 API 的技术.因此我们决定让他们 ...

  7. HashMap的方法及功能、StringBuffer的方法

    Hashmap的存值:(map.put(key,value)) 1 public static void main(String[] args) { 2 ///Integer/map.put(&quo ...

  8. watch监听事件

    Vue.js 监听属性 watch,可以通过 watch 来响应数据的变化.以下实例通过使用 watch 实现计数器: <div id="app">           ...

  9. SpringMVC中的@RequestMapping注解

    @RequestMapping:设置请求映射,把请求和控制层中的方法设置映射关系 属性: 当请求路径和@RequestMapping的value属性一致时,则该注解所标注的方法即为处理请求的方法 me ...

  10. [AHOI2017/HNOI2017]单旋

    题目   点这里看题目. 分析   最妙的地方在于,这道题其实是用一种数据结构模拟另一种数据结构!   我们需要维护深度和树的结构,以下对于每个操作进行分别讨论. 插入一个新节点   可以发现,这个新 ...