=====================================
[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 ~]#