diagcollection.pl命令实践过程

本文详细介绍了如何使用Oracle数据库的诊断工具diagcollection.pl进行集群准备服务(CRS)的诊断收集,包括设置环境变量、调用命令、查看结果以及帮助信息。通过执行命令,可以收集特定类型的数据,如CRS数据、OCR数据、操作系统日志等,并将其保存到当前目录,文件名包含日期和时间。此外,还提供了diagcollection.pl命令的帮助文档,解释了其各种选项的用途。
1.定位命令
=====================================
[root@node1 ~]# which diagcollection.pl
/u01/app/11.2.0/grid/bin/diagcollection.pl




[root@node1 ~]# ls -lrt /u01/app/11.2.0/grid/bin/diagcollection.pl
-rwxr-xr-x 1 grid oinstall 34144 Apr  7  2009 /u01/app/11.2.0/grid/bin/diagcollection.pl




2.找出变量
==================================================
------------------grid-----------
[grid@node1 ~]$ env|grep ORA
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/11.2.0/grid
[grid@node1 ~]$


------------------oracle-----------
[oracle@node1 ~]$ env|grep ORA
ORACLE_UNQNAME=racdb
ORACLE_OWNER=oracle
ORACLE_SID=racdb1
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
===========================================================






3.root设定变量
---------root----------
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORA_CRS_HOME=/u01/app/11.2.0/grid




4.root调用
root:
[root@node1 wyq]# pwd
/root/wyq


/u01/app/11.2.0/grid/bin/diagcollection.pl --collect --all --crshome $ORA_CRS_HOME


--------------调用过程---------
[root@node1 wyq]# /u01/app/11.2.0/grid/bin/diagcollection.pl --collect --all --crshome $ORA_CRS_HOME
Production Copyright 2004, 2008, Oracle.  All rights reserved
Cluster Ready Services (CRS) diagnostic collection tool
The following CRS diagnostic archives will be created in the local directory.
crsData_node1_20150522_1929.tar.gz -> logs,traces and cores from CRS home. Note: core files will be packaged only with the --core option. 
ocrData_node1_20150522_1929.tar.gz -> ocrdump, ocrcheck etc 
coreData_node1_20150522_1929.tar.gz -> contents of CRS core files in text format


osData_node1_20150522_1929.tar.gz -> logs from Operating System
Collecting crs data
/bin/tar: log/node1/agent/ohasd/oraagent_grid/oraagent_grid.log: file changed as we read it
/bin/tar: log/node1/cssd/ocssd.log: file changed as we read it
Collecting OCR data 
Collecting information from core files
No corefiles found 
Collecting OS logs
----------------
[root@node1 wyq]# 






5.结果 存 当前目录,文件名中日期+时间


[root@node1 wyq]# pwd
/root/wyq
[root@node1 wyq]# ls -lrt
total 20012
-rw-r--r-- 1 root root 20145534 May 22 19:30 crsData_node1_20150522_1929.tar.gz
-rw-r--r-- 1 root root     9807 May 22 19:31 ocrData_node1_20150522_1929.tar.gz
-rw-r--r-- 1 root root   299056 May 22 19:31 osData_node1_20150522_1929.tar.gz
[root@node1 wyq]# 






[root@node1 wyq]# date
Fri May 22 19:51:47 CST 2015
[root@node1 wyq]# 








6、帮助 diagcollection.pl
[root@node1 ~]# /u01/app/11.2.0/grid/bin/diagcollection.pl
Production Copyright 2004, 2008, Oracle.  All rights reserved
Cluster Ready Services (CRS) diagnostic collection tool
diagcollection
    --collect  
             [--crs] For collecting crs diag information 
             [--adr] For collecting diag information for ADR
             [--ipd] For collecting IPD-OS data
             
             [--all] Default.For collecting all diag information. 
             
             [--core] UNIX only. Package core files with CRS data 
             [--afterdate] UNIX only. Collects archives from the specified date. Specify in mm/dd/yyyy format
             [--aftertime] Supported with -adr option. Collects archives after the specified time. Specify in YYYYMMDDHHMISS24 format
             [--beforetime] Supported with -adr option. Collects archives before the specified date. Specify in YYYYMMDDHHMISS24 format
             
             [--crshome] Argument that specifies the CRS Home location 
             
             [--incidenttime] Collects IPD data from the specified time.  Specify in MM/DD/YYY24HH:MM:SS format
                  If not specified, IPD data generated in the past 24 hours are collected
             [--incidentduration] Collects IPD data for the duration after the specified time.  Specify in HH:MM format.
                 If not specified, all IPD data after incidenttime are collected 
             NOTE: 
             1. You can also do the following 
                ./diagcollection.pl --collect --crs --crshome
 
     --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
[root@node1 ~]# 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8494287/viewspace-1675520/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8494287/viewspace-1675520/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值