Oracle 12c RAC 日志体系结构的变化
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 12c RAC 日志体系结构的变化相关的知识,希望对你有一定的参考价值。
1 说明
在11g中,查看GRID的日志,会进入$ORACLE_HOM/log。
[[email protected] ~]$ cd $ORACLE_HOME/log/ [[email protected] log]$ ls crs diag rac1 [[email protected] log]$ cd rac1 [[email protected] rac1]$ ls acfs admin afd alertrac1.log client crflogd crfmond crsd cssd ctssd diskmon evmd gipcd gnsd gpnpd mdnsd ohasd racg srvm xag [[email protected] rac1]$ ll total 76 drwxr-xr-x 6 grid oinstall 4096 Dec 11 01:02 acfs drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 admin drwxr-xr-x 2 grid oinstall 4096 Dec 11 01:02 afd -rw-rw-r-- 1 grid oinstall 0 Dec 11 19:58 alertrac1.log drwxrwxrwt 2 grid oinstall 4096 Dec 11 19:22 client drwxr-x--- 2 root oinstall 4096 Dec 11 01:02 crflogd drwxr-x--- 2 root oinstall 4096 Dec 11 01:02 crfmond drwxr-x--- 2 root oinstall 4096 Dec 11 01:02 crsd drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 cssd drwxr-x--- 2 root oinstall 4096 Dec 11 01:02 ctssd drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 diskmon drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 evmd drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 gipcd drwxr-x--- 2 root oinstall 4096 Dec 11 01:02 gnsd drwxr-x--- 2 grid oinstall 4096 Dec 11 01:19 gpnpd drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 mdnsd drwxr-x--- 2 root oinstall 4096 Dec 11 01:17 ohasd drwxrwxr-t 5 grid oinstall 4096 Dec 11 01:02 racg drwxr-x--- 2 grid oinstall 4096 Dec 11 01:02 srvm drwxrwxr-x 2 grid oinstall 4096 Dec 11 01:02 xag [[email protected] rac1]$
但在12c中,还是存在上述的目录结构,但是里面什么内容都没有。 因为从12c开始,RAC 的日志结构发生了改变。
12c 中RAC 分两种类型:
1. standard cluster
Name of alert log : alert.log
location of alert log: $ORACLE_BASE/diag/crs/host01/crs/trace
2. flex cluster
Name of alert log : alert<hostname>.log
location of alert log: $ORACLE_HOME/log/host01
我的测试环境是standard cluster,所以在11g的RAC 架构里,看不到任何信息。 但如果是flex cluster,那么日志结构,还是和12c之前的集群一样。
[[email protected] trace]$ crsctl query crs activeversion Oracle Clusterware active version on the cluster is [12.1.0.2.0] [[email protected] trace]$ pwd /u01/app/grid/diag/crs/rac1/crs/trace [[email protected] trace]$ ls alert.log crsctl_130341.trm crsctl_139270.trm gpnptool_131848.trm clscfg_108107.trc crsctl_130399.trc crsctl_139276.trc gpnptool_137540.trc clscfg_108107.trm crsctl_130399.trm crsctl_139276.trm gpnptool_137540.trm clscfg_88148.trc crsctl_130457.trc crsctl_139287.trc gpnptool_141922.trc clscfg_88148.trm crsctl_130457.trm crsctl_139287.trm gpnptool_141922.trm clscfg_94297.trc crsctl_130754.trc crsctl_139288.trc gpnptool_144685.trc clscfg_94297.trm crsctl_130754.trm crsctl_139288.trm gpnptool_144685.trm crsctl_103046.trc crsctl_130819.trc crsctl_139320.trc gpnptool_89849.trc
2 验证
[[email protected] ~]# cd /proc/`ps -C crsd.bin -o pid=`/fd [[email protected] fd]# pwd /proc/114497/fd [[email protected] fd]# ll |grep /u01/app/ lrwx------ 1 root root 64 Dec 11 01:20 1 -> /u01/app/grid/crsdata/rac1/output/crsdOUT.trc lrwx------ 1 root root 64 Dec 11 01:20 111 -> /u01/app/12.1.0/grid/rdbms/mesg/diaus.msb lr-x------ 1 root root 64 Dec 11 01:20 120 -> /u01/app/12.1.0/grid/rdbms/mesg/diaus.msb l-wx------ 1 root root 64 Dec 11 01:20 15 -> /u01/app/grid/diag/crs/rac1/crs/trace/crsd.trc …… [[email protected] fd]# [[email protected] fd]# cd /proc/`ps -C ocssd.bin -o pid=`/fd [[email protected] fd]# [[email protected] fd]# ll |grep /u01/app/ lrwx------ 1 grid oinstall 64 Dec 11 01:19 1 -> /u01/app/grid/crsdata/rac1/output/ocssdOUT.trc lr-x------ 1 grid oinstall 64 Dec 11 01:20 118 -> /u01/app/12.1.0/grid/has/mesg/rdeus.msb lr-x------ 1 grid oinstall 64 Dec 11 01:20 124 -> /u01/app/12.1.0/grid/has/mesg/clswus.msb lr-x------ 1 grid oinstall 64 Dec 11 01:20 135 -> /u01/app/12.1.0/grid/rdbms/mesg/diaus.msb lrwx------ 1 grid oinstall 64 Dec 11 01:19 2 -> /u01/app/grid/crsdata/rac1/output/ocssdOUT.trc lrwx------ 1 grid oinstall 64 Dec 11 01:19 3 -> /u01/app/grid/crsdata/rac1/output/ocssdOUT.trc lrwx------ 1 grid oinstall 64 Dec 11 01:19 7 -> /u01/app/grid/diag/crs/rac1/crs/trace/ocssd.trc ……
实际上,这种改变也是Oracle 的另一个日志管理的趋势。 Oracle 从11g 引入了ADR (AutomaticDiagnostic Repository) ,ADR 是一个基于文件的资料档案库,用于存放数据库诊断数据(如跟踪、意外事件转储和程序包、预警日志、健康状况监视器报告、核心转储等)。
从11g R1 开始,数据库、自动存储管理(ASM)、集群就绪服务(CRS) 和其它Oracle 产品或组件将所有诊断数据都存储在ADR 中。每种产品的每个实例都将诊断数据存储在自己的ADR 主目录下。
[[email protected] fd]# su - grid [[email protected] ~]$ adrci ADRCI: Release 12.1.0.2.0 - Production on Fri Dec 11 21:13:42 2015 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. ADR base = "/u01/app/grid" adrci> show home ADR Homes: diag/tnslsnr/rac1/mgmtlsnr diag/tnslsnr/rac1/listener_scan1 diag/tnslsnr/rac1/listener diag/crs/rac1/crs diag/clients/user_grid/host_1874443374_82 diag/rdbms/_mgmtdb/-MGMTDB diag/asm/+asm/+ASM1
这个12c中新的目录结构,就是ADR的目录结构。 根据12c中的改变,可以看出,Oracle 已经采用ADR来管理各种日志。
Starting with 12.1.0.2 Oracle Grid Infrastructure has adapted the Automatic Diagnostic Repository (ADR) based management of diagnostic information. As a result of this adaptation, all diagnostic information has been moved under the ADR folder tree. This applies to the host alert log as well as to ASM alert logs and other logs as well as traces.
转:http://www.cndba.cn/dave/article/160
以上是关于Oracle 12c RAC 日志体系结构的变化的主要内容,如果未能解决你的问题,请参考以下文章