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实现 LeetCode 301 删除无效的括号

    301. 删除无效的括号 删除最小数量的无效括号,使得输入的字符串有效,返回所有可能的结果. 说明: 输入可能包含了除 ( 和 ) 以外的字符. 示例 1: 输入: "()())()&quo ...

  2. Java实现 蓝桥杯 算法训练 1的个数

    试题 算法训练 1的个数 资源限制 时间限制:1.0s 内存限制:256.0MB 问题描述 输入正整数n,判断从1到n之中,数字1一共要出现几次.例如1123这个数,则出现了两次1.例如15,那么从1 ...

  3. Java实现中值问题

    中值问题是求一个n个数列表中某一数组下标k,它要求该下标元素比列表中的一半元素大,又比另一半元素小,这个中间的值被称为中值. 使用Lomuto划分算法思想,此处引用<算法设计与分析基础>第 ...

  4. 权限系统设计(0):权限系统设计基本概念改需-MAC/RBAC引子

    此篇主要对权限系统设计所涉的一些专业术语重点梳理.从我们windows的文件系统 自主访问控制 到基于角色访问控制. 权限设计基本术语 对后面会用到的词汇做一个简要说明 什么是权限(许可) 权限(Pr ...

  5. 制作sentinel docker镜像

    在sentinel官方下载jar包即可运行,但是在部署的时候一个一个的启动jar包很不方便,制作成镜像方便部署和管理. 1)直接运行 # 修改端口号,默认是8080 java -jar sentine ...

  6. 2020最新IDEA插件大集合,一款能帮助你写代码的工具是多么重要

    摘要 12款为用户精心打造的Idea插件,含盖前后端,另把使用小技巧分享给大家,提高大家的码率,希望对你们有帮助! Lombok Lombok为Java项目提供了非常有趣的附加功能,使用它的注解可以有 ...

  7. kibana的Dev Tool中如何对es进行增删改查

    kinaba Dev Tool中对es(elasticSearch)进行增删改查 一.查询操作 查询语句基本语法 以下语句类似于mysql的: select * from  xxx.yyy.topic ...

  8. k8s+docker部署Golang项目

    Go环境搭建 root账户 下载Golang [root@infra2-test-k8s /]# cd /usr/local/ [root@infra2-test-k8s local]# wget h ...

  9. ubuntu12.04 串口登录系统配置

    原文转自:http://blog.csdn.net/g__gle/article/details/8663239 1) Create a file called /etc/init/ttyS0.con ...

  10. 面试必问:分布式锁实现之zk(Zookeeper)

    点赞再看,养成习惯,微信搜索[三太子敖丙]关注这个互联网苟且偷生的工具人. 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试完整考点.资料以及我的 ...