RAC中如何使用diagcollection.pl脚本打包收集诊断日志文件

2023-10-18 1421阅读

温馨提示:这篇文章已超过568天没有更新,请注意相关的内容是否还可用!

在Oracle集群环境的“$ORA_CRS_HOME/bin”目录下提供了diagcollection.pl脚本,以root用户身份执行该脚本便可以完成搜集必要的诊断信息的目的。–clean cleans up the diagnosability information gathered by this script. –coreanalyze UNIX only. Extracts information from core files and stores it in a text file. 简化了采集故障信息的繁琐流程。

这篇文章主要介绍RAC中如何使用diagcollection.pl脚本打包收集诊断日志文件,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!在Oracle集群环境的“$ORA_CRS_HOME/bin”目录下提供了diagcollection.pl脚本,以root用户身份执行该脚本便可以完成搜集必要的诊断信息的目的。

RAC中如何使用diagcollection.pl脚本打包收集诊断日志文件
(图片来源网络,侵删)

1.设置必要的环境变量

因为需要以root用户身份执行该脚本,因此oracle用户下的环境变量在此无效,需要重新设置。

[root@rac1 ~]# export ORACLE_BASE=/oracle/app/oracle

[root@rac1 ~]# export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

[root@rac1 ~]# export ORA_CRS_HOME=/oracle/app/crs

2.确保环境变量的正确性

需要检查的环境变量有:ORACLE_BASE、ORACLE_HOME、ORA_CRS_HOME和HOSTNAME。

[root@rac1 ~]# echo $ORACLE_BASE

/oracle/app/oracle

[root@rac1 ~]# echo $ORACLE_HOME

/oracle/app/oracle/product/10.2.0/db_1

[root@rac1 ~]# echo $ORA_CRS_HOME

/oracle/app/crs

[root@rac1 ~]# echo $HOSTNAME

rac1

环境变量检查通过。

3.执行采集脚本diagcollection.pl

[root@rac1 ~]# cd $ORA_CRS_HOME/bin

[root@rac1 bin]# ./diagcollection.pl –collect –all –crshome $ORA_CRS_HOME

Production Copyright 2004, 2005, Oracle. All rights reserved

Cluster Ready Services (CRS) diagnostic collection tool

The following CRS diagnostic archives will be created in the local directory.

crsData_rac1.tar.gz -> logs,traces and cores from CRS home. Note: core files will be packaged only with the -core option.

ocrData_rac1.tar.gz -> ocrdump, ocrcheck etc

coreData_rac1.tar.gz -> contents of CRS core files in text format

Collecting crs data

/bin/tar: Removing leading `/’ from member names

Collecting OCR data

Collecting information from core files

No corefiles found

The following Oracle Hom开发云主机域名e diagnostic archives will be created in the local directory.

oraData_rac1.tar.gz -> logs, traces and cores from Oracle Home

Collecting oracle home data

/bin/tar: Removing leading `/’ from member names

本次生成的打包文件如下:

[root@rac1 bin]# ls -l *tar.gz

-rw-r–r– 1 root root 138 Nov 18 22:38 coreData_rac1.tar.gz

-rw-r–r– 1 root root 234507 Nov 18 22:38 crsData_rac1.tar.gz

-rw-r–r– 1 root root 8000 Nov 18 22:38 ocrData_rac1.tar.gz

-rw-r–r– 1 root root 81851 Nov 18 22:38 oraData_rac1.tar.gz

4.diagcollection.pl脚本的帮助信息

不带任何参数的情况下diagcollection.pl脚本会给出该脚本的使用帮助信息。

[root@rac1 bin]# ./diagcollection.pl

Production Copyright 2004, 2005, Oracle. All rights reserved

Cluster Ready Services (CRS) diagnostic collection tool

diagcollection

–collect

[–crs] For collecting crs diag information

[–oh] For collecting oracle home diag information

[–all] Default.For collecting all diag information.

[–core] UNIX only. Does not package core files.

[–afterdate] UNIX only. Collects archives from the specified date. Specify in mm/dd/yyyy format

[–crshome] Argument that specifies the CRS Home location

NOTE:

1. You can also do the following

./diagcollection.pl –collect –crs –开发云主机域名-oh

2. ORACLE_HOME env variable needs to be set.

–clean cleans up the diagnosability

information gathered by this script

–coreanalyze UNIX only. Extracts information from core files

and stores it in a text file

5.小结

使用Or开发云主机域名acle提供的diagcollection.pl脚本可以很方便的对诊断信息进行批量打包。简化了采集故障信息的繁琐流程。

如需要将诊断信息提交给Oracle技术支持人员,使用该方法效率会比较高效。

Good luck.

secooler

10.11.18

以上是“RAC中如何使用diagcollection.pl脚本打包收集诊断日志文件”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注开发云行业资讯频道!

本文从转载,原作者保留一切权利,若侵权请联系删除。

《RAC中如何使用diagcollection.pl脚本打包收集诊断日志文件》来自互联网同行内容,若有侵权,请联系我们删除!

VPS购买请点击我

免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们,邮箱:ciyunidc@ciyunshuju.com。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!

目录[+]