【RDA】使用RDA(Remote Diagnostic Agent)工具对数据库进行健康检查

【RDA】使用RDA(Remote Diagnostic Agent)工具对数据库进行健康检查

分类: Linux

RDA英文全称叫做“Oracle Remote Diagnostic Agent”。
这个Oracle诊断工具是用perl编写的,包含非常丰富的诊断脚本,使用它可以非常便利的采集到Oracle数据库服务器系统配置和数据库的详细信息。
如果您在向Oracle支持人员寻求帮助时能够提供一份RDA报告,将会大大的缩短问题处理的周期,避免信息的反复采集。
RDA不会更改数据库服务器的任何配置,仅仅是采集信息,了解系统。大家可以放心使用RDA工具。

这篇文章给大家介绍一下这个RDA工具的使用方法,供参考。

1.下载RDA安装包
参考MOS(Metalink Note):314422.1
“Remote Diagnostic Agent (RDA) 4 - Getting Started [ID 314422.1]”文章中提供了不同操作系统版本的介质下载。
这里选择“Linux x86 (64-bit)”版本进行演示操作。

该工具支持以下操作系统:
Apple Mac OS X
HP OpenVMS
HP Tru64
HP-UX Itanium
HP-UX PA-RISC (32-bit)
HP-UX PA-RISC (64-bit)
IBM AIX on POWER Systems (32-bit)
IBM AIX on POWER Systems (64-bit)
IBM Dynix/Ptx
IBM Linux on POWER
IBM zSeries Based Linux
Linux Itanium
Linux x86 (32-bit)
Linux x86 (64-bit)
Microsoft Windows (32-bit)
Microsoft Windows (64-bit)
Sun Solaris Intel (32-bit)
Sun Solaris Intel (64-bit)
Sun Solaris SPARC (32-bit)
Sun Solaris SPARC (64-bit)

2.在数据库服务器上创建一个RDA目录
创建的RDA目录需要保证有足够的空间可用。
ora10g@secDB /home/oracle$ mkdir RDA

3.将下载到的安装文件上传到服务器上
$ scp p9079828_418_LINUX.zip oracle@172.17.193.211:/home/oracle/RDA
oracle@172.17.193.211's password:
p9079828_418_LINUX.zip 100% 26MB 8.8MB/s 00:03

4.解压文件
1)解压
ora10g@secDB /home/oracle/RDA$ unzip p9079828_418_LINUX.zip
Archive: p9079828_418_LINUX.zip
inflating: readme.txt
creating: rda/
creating: rda/RDA/
... 此处省略大量解压信息 ...
inflating: rda/rda_linux56
creating: rda/ccr/
inflating: rda/ccr/ccr-Production-10.3.2.0.0-Linux-i386.zip

2)解压后,当前目录下将会创建一个rda目录和一个readme.txt文件
ora10g@secDB /home/oracle/RDA$ ls -ltr
total 27M
-r--r--r-- 1 oracle oinstall 48 Dec 4 14:45 readme.txt
drwxr-xr-x 6 oracle oinstall 4.0K Dec 4 14:45 rda/
-rwx------ 1 oracle oinstall 27M Mar 5 02:07 p9079828_418_LINUX.zip*

3)readme.txt文件记录了RDA软件的版本信息
ora10g@secDB /home/oracle/RDA$ vi readme.txt
RDA/OCM bundle for RDA 4.18-091204 for linux_x86
~

5.验证RDA工具安装是否成功
1)第一种方法
ora10g@secDB /home/oracle/RDA/rda$ perl rda.pl -cv
Loading the file list ...
Checking the directory '.' ...
Checking the directory 'RDA' ...
Checking the directory 'RDA/Handle' ...
Checking the directory 'RDA/Library' ...
Checking the directory 'RDA/Library/Remote' ...
Checking the directory 'RDA/Local' ...
Checking the directory 'RDA/Object' ...
Checking the directory 'RDA/Operator' ...
Checking the directory 'RDA/Value' ...
Checking the directory 'hcve' ...
Checking the directory 'modules' ...
No issues found

2)第二种方法
ora10g@secDB /home/oracle/RDA/rda$ rda.sh -cv
Loading the file list ...
Checking the directory '.' ...
Checking the directory 'RDA' ...
Checking the directory 'RDA/Handle' ...
Checking the directory 'RDA/Library' ...
Checking the directory 'RDA/Library/Remote' ...
Checking the directory 'RDA/Local' ...
Checking the directory 'RDA/Object' ...
Checking the directory 'RDA/Operator' ...
Checking the directory 'RDA/Value' ...
Checking the directory 'hcve' ...
Checking the directory 'modules' ...
No issues found

经检查,RDA工具安装没有问题。

6.配置并运行RDA
1)验证perl是否可用
ora10g@secDB /home/oracle/RDA/rda$ perl -V

2)保证rda.sh和rda.pl两个文件具有执行权限
ora10g@secDB /home/oracle/RDA/rda$ ls -l rda.sh rda.pl
-r-xr-xr-x 1 oracle oinstall 47K Nov 30 16:02 rda.pl*
-r-xr-xr-x 1 oracle oinstall 3.5K Jan 14 2009 rda.sh*

如果不具有执行权限,可以使用下面的命令进行调整。
ora10g@secDB /home/oracle/RDA/rda$ chmod +x rda.sh rda.pl

3)使用“-L modules”选项列出所有可供采集的模块
通过下面的这个列表体现出了RDA在数据库采集方面的强大优势。
ora10g@secDB /home/oracle/RDA/rda$ ./rda.sh -L modules
Available data collection modules are:
ACFS Collects ASM Cluster File System Information
ACT Collects Oracle E-Business Suite Application Information
ADBA Collects ACS Oracle Database Assessment
ADX Collects AutoConfig and Rapid Clone Information
AGT Collects Enterprise Manager Agent Information
APEX Collects APEX Information
ASAP Collects Oracle Communications ASAP Information
ASBR Collects Application Server Backup and Recovery Information
ASG Collects Application Server Guard Information
ASIT Collects Oracle Application Server Installation Information
ASM Collects Automatic Storage Management Information
B2B Collects Oracle Business to Business Information
BAM Collects Business Activity Monitoring Information
BEE Collects Beehive Information
BI Collects Oracle Business Intelligence Enterprise Edition Info.
BPEL Collects Oracle BPEL Process Manager Information
BR Collects Database Backup and Recovery Information
BRM Collects Oracle Communications BRM Information
CCR Collects OCM Diagnostic Information
CFG Collects Key Configuration Information
COHR Collects Oracle Coherence Information
CONT Collects Oracle Content Services Information
CRID Collects Oracle Access Manager (COREid) Information
D2PC Collects Distributed Transaction Information
DB Controls RDBMS Data Collection
DBA Collects RDBMS Information
DBC Collects Database Control Information
DBM Collects RDBMS Memory Information
DEV Collects Oracle Developer Information
DG Collects Data Guard Information
DNFS Collects Direct NFS Information
DSCS Collects Discussions Information
DSCV Collects Oracle Discoverer Information
ECM Controls Oracle Enterprise Content Management 11g Data Collection
EM Collects Enterprise Manager OMS and Repository Info (Obsolete)
END Finalizes the Data Collection
EPMA Collects Enterprise Performance Management Architect Information
ESB Collects Enterprise Service Bus Information
ESS Collects Oracle Essbase Information
ESSO Collects Oracle Enterprise Single Sign-On Information
EXA Collects Exadata Information
FLTR Controls Report Content Filtering
GRDN Collects Oracle Guardian Information
GRID Controls Grid Control Data Collection
GTW Collects Transparent/Procedural Gateway Information
HFM Collects Oracle Hyperion Financial Management information
HPL Collects Oracle Hyperion Planning Information
IA Collects Intelligent Agent Information
IAS Collects Web Server Information
IFS Collects iFS (iFS, CMSDK, Files) Information
INI Initializes the Data Collection
INST Collects the Oracle Installation Information
IPSA Collects Oracle Communications IP Service Activator Information
J2EE Collects J2EE/OC4J Information
JDBC Collects Oracle Java DB Connectivity (JDBC) Information
JDEV Collects Oracle JDeveloper Information
JIVE Collects Jive Information
LANG Collects Oracle Language Information
LOAD Produces the External Collection Reports
LOG Collects Database Trace and Log Files
MAIL Collects Oracle Collaboration Suite Mail Information
MSLG Collects Microsoft Languages Information
ND Collects Oracle Communications Network Discovery Information
NET Collects Network Information
NM Collects Oracle Communications Network Mediation Information
NPRF Samples Performance Information (root not required)
OCAL Collects Oracle Calendar Information
OCFS Collects Oracle Cluster File System Information
OCM Setting up Configuration Manager Interface
OCS Controls Oracle Collaboration Suite Data Collection
ODI Collects Oracle Data Integrator Information
ODM Collects Oracle Data Mining Information
OES Collects Oracle Express Server Information
OID Collects Oracle Internet Directory Information
OIM Collects Oracle Identity Manager Information
OLAP Collects OLAP Information
OMM Collects Oracle Multimedia or Oracle interMedia Information
OMS Collects Oracle Management Server Information (obsolete)
ONET Collects Oracle Net Information
OS Collects the Operating System Information
OVD Collects Oracle Virtual Directory Information
OVMM Collects Oracle VM Manager Information
OVMS Collects Oracle VM Server Information
OWB Collects Oracle Warehouse Builder Information
OWSM Collects Oracle Web Services Manager Information
PDA Collects Oracle Portal Information
PDBA Collects PeopleSoft Information from an Oracle Database
PERF Collects Performance Information
PLNC Collects Oracle PL/SQL Native Compilation Information
PROF Collects the User Profile
PS Collects Oracle Communications Policy Services Information
PWEB Collects PeopleSoft Information from Web Application Server
RAC Collects Cluster Information
RACD Performs a Database Hang Analysis
RDSP Produces the Remote Data Collection Reports
RET Collects Oracle Retail Information
REXE Performs the Remote Data Collections
RPRF Samples Performance Information (root privileges required)
RSRC Collects Database Resource Manager Information
RTC Collects Real Time Communication Information
SEBL Collects Siebel Information
SES Collects Oracle Secure Enterprise Search Information
SMPL Controls Sampling
SOA Collects Oracle SOA Suite Information
SP Collects SQLPlus/iSQLPlus Information
SSO Collects Single Sign-On Information
STC Collects Streams Configuration Information
STM Collects Streams Monitoring Information
TOPL Collects Oracle TopLink Information
TTEN Collects Oracle TimesTen In-Memory Database Information
UCM Collects Oracle Universal Content Management Information
UOA Collects Oracle Universal Online Archive 11g Information
WAC Collects Web Access Client Information
WCI Collects Oracle WebCenter Information
WEBC Collects Oracle Web Cache Information
WKSP Collects Workspaces Information
WLS Collects Oracle WebLogic Server Information
WMC Collects Webmail Client Information
WRLS Collects Wireless Information
XDB Collects XDB Information
XSMP Samples User Defined Data
XTRA Collects User Defined Data

4)我们选择四个模块(OS DB DBA INST)配置一下
只要按照提示的信息进行配置即可,基本上都可以使用默认设置的内容。
需要注意的是最后两步我们这里输入“/”和“Y”,目的是在运行RDA采集信息的过程中不需要输入密码,避免交互操作。
ora10g@secDB /home/oracle/RDA/rda$ ./rda.sh -S OS DB DBA INST

S000INI: Initializes the Data Collection

RDA uses the output file prefix to identify all files belonging to the same
data collection. The prefix must start with a letter and must contain only
alphanumeric characters.

Enter the prefix to be used for all the generated files
Hit 'Return' to accept the default (RDA)

Enter the directory used for all the files to be generated
Hit 'Return' to accept the default (/home/oracle/RDA/rda/output)

Do you want to keep report packages from previous runs (Y/N)?
Hit 'Return' to accept the default (N)

Is a fresh collection performed as the default action (Y/N)?
Hit 'Return' to accept the default (Y)

Enter the Oracle home to be used for data analysis
Hit 'Return' to accept the default (/oracle/app/oracle/product/10.2.0/db_1)

Enter the domain name for this server

localhost.localdomain


S010CFG: Collects Key Configuration Information


S090OCM: Set up the Configuration Manager Interface

RDA benefits from Oracle Configuration Manager by improving its data
collection. Oracle Configuration Manager (OCM) collects the configuration
information and uploads it to the OCM Repository in connected mode. When OCM
is configured in disconnected mode, it adds the OCM payload to the RDA report
packages in future RDA runs.

Select the mode that you want to install Oracle Configuration Manager in
/oracle/app/oracle/product/10.2.0/db_1
C Connected Mode
D Disconnected Mode
Enter the letter corresponding to your choice
Hit 'Return' to accept the default (C)

Do you want to install OCM Database collection scripts (Y/N)?
Hit 'Return' to accept the default (Y)

Enter a SYSDBA user for installing the OCM Database collection scripts
Hit 'Return' to accept the default (sys)

Is /oracle/app/oracle/product/10.2.0/db_1 an Oracle E-Business Suite Database
Oracle home (Y/N)?
Hit 'Return' to accept the default (N)


S909RDSP: Produces the Remote Data Collection Reports


S919LOAD: Produces the External Collection Reports


S990FLTR: Controls Report Content Filtering


S999END: Finalizes the Data Collection


S100OS: Collects the Operating System Information


S130INST: Collects the Oracle Installation Information


S200DB: Controls RDBMS Data Collection

Is there a database for RDA to analyze (Y/N)?
Hit 'Return' to accept the default (Y)

Is the database associated to the current Oracle home (Y/N)?
Hit 'Return' to accept the default (Y)

Enter the Oracle SID to be analyzed
Hit 'Return' to accept the default (ora10g)

Is the INIT.ORA for the database to be analyzed located on this system? (Y/N)
Hit 'Return' to accept the default (Y)

Enter the location of the spfile or the INIT.ORA (including the directory and
file name)
Hit 'Return' to accept the default
(/oracle/app/oracle/product/10.2.0/db_1/dbs/spfileora10g.ora)

Enter an Oracle User ID (userid only) to view DBA_ and V$ tables. If RDA will
be run under the Oracle software owner's ID, enter a forward slash (/) here,
and enter Y at the SYSDBA prompt to avoid a prompt for the database password
at runtime.
Hit 'Return' to accept the default (system)

/

Is '/' a SYSDBA user (will connect as SYSDBA) (Y/N)?
Hit 'Return' to accept the default (N)

Y


S201DBA: Collects RDBMS Information

配置完成后,会在当前目录下生成output目录和配置文件setup.cfg(如果再次执行配置过程,会生成备份文件setup.bak,只保存一份备份文件。)。
配置文件setup.cfg是可编辑的,可以直接对其进行调整。

5)此时再使用“-L modules”选项查看,如果模块名前有“”号表示已经配置过。
这里为显示清晰,省略一部分输出信息。最后一行有关于“
”号的解释
ora10g@secDB /home/oracle/RDA/rda$ ./rda.sh -L modules
Available data collection modules are:
ACFS Collects ASM Cluster File System Information
... ...
*DB Controls RDBMS Data Collection
*DBA Collects RDBMS Information
DBC Collects Database Control Information
... ...
*FLTR Controls Report Content Filtering
... ...
*INST Collects the Oracle Installation Information
... ...
OS Collects the Operating System Information
... ...
XTRA Collects User Defined Data
A '
' before a module name indicates that its setup has been done.

6)我们使用“-vCRP OS DB DBA INST”选项运行RDA对系统进行信息采集
ora10g@secDB /home/oracle/RDA/rda$ ./rda.sh -vCRP OS DB DBA INST
Collecting diagnostic data ...

RDA Data Collection Started 05-Mar-2010 07:21:40

Processing Initialization module ...
Processing OCM module ...
Processing CFG module ...
Processing OS module ...
Processing Oracle installation module ...
Processing RDBMS module ...
Processing RDSP module ...
Processing LOAD module ...
Processing End module ...

RDA Data Collection Ended 05-Mar-2010 07:22:11

    Generating the reports ...
            - RDA_OS_numactl.txt ...
            - RDA_DBA_partition_data.txt ...
            - RDA_INST_inventory_xml.txt ...
            - RDA_DBA_vHWM_Statistic.txt ...
            - RDA_DBA_vcontrolfile.txt ...
            - RDA_DBA_vsystem_event.txt ...
            - RDA_DBA_spatial.txt ...
            - RDA_DBA_text.txt ...
            - RDA_CFG_database.txt ...
            - RDA_END_files.txt ...
            - RDA_DBA_ses_procs.txt ...
            - RDA_INST_oracle_home.txt ...
            - RDA_DBA_sga_info.txt ...
            - RDA_DBA_tablespace.txt ...
            - RDA_DBA_log_info.txt ...
            - RDA_DBA_vresource_limit.txt ...
            - RDA_INST_R00015_log_trace_log.txt ...
            - RDA_DBA_nls_parms.txt ...
            - RDA_DBA_undo_info.txt ...
            - RDA_INST_oracle_install.txt ...
            - RDA_OS_packages.txt ...
            - RDA_OS_ntpstatus.txt ...
            - RDA_DBA_versions.txt ...
            - RDA_OS_disk_info.txt ...
            - RDA_DBA_vfeatureusage.txt ...
            - RDA_END_report.txt ...
            - RDA_DBA_CPU_Statistic.txt ...
            - RDA_DBA_replication.txt ...
            - RDA_OS_kernel_info.txt ...
            - RDA_DBA_datafile.txt ...
            - RDA_INST_L00011_oh_inv.txt ...
            - RDA_OS_etc_conf.txt ...
            - RDA_INST_L00010_homes.txt ...
            - RDA_DBA_invalids.txt ...
            - RDA_DBA_security_files.txt ...
            - RDA_OS_misc_linux_info.txt ...
            - RDA_DBA_sequences.txt ...
            - RDA_DBA_vfeatureinfo.txt ...
            - RDA_INST_make_report.txt ...
            - RDA_DBA_voption.txt ...
            - RDA_INST_orainventory_logdir.txt ...
            - RDA_DBA_vparameters.txt ...
            - RDA_OS_cpu_info.txt ...
            - RDA_OS_hugepage.txt ...
            - RDA_DBA_aq_data.txt ...
            - RDA_OS_sysdef.txt ...
            - RDA_DBA_vsession_wait.txt ...
            - RDA_DBA_services.txt ...
            - RDA_OS_tracing.txt ...
            - RDA_OS_linux_release.txt ...
            - RDA_DBA_all_errors.txt ...
            - RDA_INST_oratab.txt ...
            - RDA_DBA_latch_info.txt ...
            - RDA_DBA_vlicense.txt ...
            - RDA_CFG_homes.txt ...
            - RDA_DBA_jobs.txt ...
            - RDA_OS_memory_info.txt ...
            - RDA_OS_libc.txt ...
            - RDA_OS_services.txt ...
            - RDA_OS_nls_env.txt ...
            - RDA_OS_java_version.txt ...
            - RDA_DBA_vcompatibility.txt ...
            - RDA_DBA_vspparameters.txt ...
            - RDA_INST_comps_xml.txt ...
            - RDA_DBA_security.txt ...
            - RDA_DBA_init_ora.txt ...
            - RDA_DBA_dba_registry.txt ...
            - RDA_CFG_oh_inv.txt ...
            - RDA_OS_system_error_log.txt ...
            - RDA_DBA_database_properties.txt ...
            - RDA_INST_orainst_loc.txt ...
            - RDA_END_system.txt ...
            - Report index ...
    Packaging the reports ...
            RDA.RDA_secDB.zip created
    Updating the setup file ...

解释一下用到的选项含义。
v选项含义:详细显示报告生成过程,如果不加这个选项,仅会显示上面输出的第一部分内容;
C选项含义:采集诊断信息;
R选项含义:生成HTML格式的报告;
P选项还以:对生成的报告文件打包,压缩成zip格式。

7.获得RDA的帮助信息
演示过程中我们使用了v、C、R和P选项,如何获得更多选项的说明信息呢?方法有两种。
1)获得简略的帮助信息
使用“-h”选项查看详细的帮助文档。
ora10g@secDB /home/oracle/RDA/rda$ ./rda.sh -h
Usage: rda.pl [-bcdflntvwxy] [-ABCDEHIKLMPQRSTV] [-e list] [-m dir]
[-s name] [-o out] [-p prof] arg ...
-A Authentify user through the setup file
-B Start background collection
-C Collect diagnostic information
-D Delete specified modules from the setup
-E Explain specified error numbers
-H Halt background collection
-I Regenerate the index
-K Kill background collection
-L List the modules available
-M Display the related manual pages
-O Render output specifications from STDIN
-P Package the reports (tar or zip)
-Q Display the related setup questions
-R Generate specified reports
-S Setup specified modules
-T Execute test modules
-V Display component version numbers
-b Don't backup setup file before saving
-c Check the RDA installation and exit
-d Set debug mode
-e list Specify a list of alternate setting definitions (var=val,...)
-f Set force mode
-h Display the command usage and exit
-l Use a lock file to prevent concurrent usage of a setup file
-m dir Specify the module directory ('modules' by default)
-n Start a new data collection
-o out Specify the file for background collection output redirection
-p prof Specify the setup profile ('Default' by default)
-q Set quiet mode
-s name Specify the setup name ('setup' by default)
-t Set trace mode
-v Set verbose mode
-w Wait as long as the background collection daemon is active
-x Produce module cross reference
-y Accept all defaults and skip all pauses

2)获得详细的帮助信息
使用“-M”选项查看详细的帮助文档。
内容非常详细,这里不做展示。
如果做进一步的查找,这个详细帮助文档内容是由下面rda.pod文件格式化后生成的。
ora10g@secDB /home/oracle/RDA/rda$ ls -l ./modules/rda.pod
-r--r--r-- 1 oracle oinstall 15K Nov 23 20:37 ./modules/rda.pod

8.查看RDA生成的报告
内容简洁实用,查询方便。

9.小结
RDA工具对于数据库健康检查的意义是重大的,使用RDA可以快速准确的获取数据库的基本信息(数据采集整体时间最常一般不会超过15分钟),对于数据库的故障亦有裨益。
RDA的强大的数据采集功能不限于本文的演示内容,建议朋友们对细节参数进行研究。

posted @ 2016-11-16 15:55  子鱼猴  阅读(2069)  评论(0编辑  收藏  举报