首页 > 代码库 > 用ORACHK自动化检查数据库系统的健壮性

用ORACHK自动化检查数据库系统的健壮性

1、orachk工具主要用途

(1)主动检查您的整个软件在操作系统、CRS、数据库、高可用等层面中的严重问题,以便于IT部门整改,提升系统的稳定性

(2)对于您系统中存在的风险提供简单化和合理化的诊断和分析建议。

(3)对系统中存在的健康风险提供汇总信息,并且能够向下钻取到特定的问题和对应的解决方案

(4)对检查结果进行量化评分(100分制),内容非常的全面,通过得分直观判断健康程度

2、运行注意要点

(1)orachk不支持在root用户下运行,需要在oracle或grid用户下运行

(2)如果检查RAC环境的健康,需要输入其它节点的root密码,如果各节点root密码相同,则只需输入一次即可

3、检查输出信息分级

序号

分级

意义

1

FAIL

严重的不合格的问题

2

WARNING

警告问题

3

ERROR

错误问题

4

INFO

参考信息

4、orachk下载

        metalink文章 1268927.2 中提供下载,当前最新版本为ORA CHK2.2.5,不分平台,在linux、AIX等平台通用

5、orachk安装

5.1 创建一个orachk专用目录

      创建一个orachk解压出来的众多文件,以及运行orachk产生的分析报告材料

[root@INFA oracle]# mkdir -p /home/oracle/orachk

5.2、安装orachk

    安装orachk很简单,只需要将orachk-2.2.5.zip解压缩出来即可

[root@INFA oracle]# cp orachk-2.2.5.zip /home/oracle/orachk/

[root@INFA oracle]# cd /home/oracle/orachk

[root@INFA orachk]# unzip orachk-2.2.5.zip

5.3、配置orachk目录权限

[root@INFA orachk]# chown -R oracle:oinstall /home/oracle/orachk

[root@INFA orachk]# chmod -R 777 /home/oracle/orachk

6、单实例环境运行orachk开展健康检查实例

(1)启动orachk检查:

[oracle@INFA orachk]$ ./orachk

List of running databases

1. infadb

2. None of above

 

Select databases from list for checking best practices. For multiple databases, select 1 for All or comma separated number like 1,2 etc [1-2][1].

 

(2)输出过程记录(部分内容):

Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS

 

. . . . . . . . . . . . . . .

-------------------------------------------------------------------------------------------------------

                                                 Oracle Stack Status                           

-------------------------------------------------------------------------------------------------------

Host Name  CRS Installed  ASM HOME       RDBMS Installed  CRS UP    ASM UP    RDBMS UP  DB Instance Name

-------------------------------------------------------------------------------------------------------

infa        No              No              Yes             No         No       Yes      infadb   

-------------------------------------------------------------------------------------------------------

 

Copying plug-ins

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 

*** Checking Best Practice Recommendations (PASS/WARNING/FAIL) ***

 

Collections and audit checks log file is

/home/oracle/orachk/orachk_infa_infadb_080214_023723/log/orachk.log

 

Checking for prompts in /home/oracle/.bash_profile on infa for oracle user...

=============================================================

                    Node name - infa                               

=============================================================

 

Collecting - Active sessions load balance for infadb database

Collecting - Archived Destination Status for infadb database

......

Collecting - Memory Information

Collecting - OS Packages

Collecting - Operating system release information and kernel version

Collecting - Patches for RDBMS Home

Collecting - number of semaphore operations per semop system call

 

Data collections completed. Checking best practices on infa.

--------------------------------------------------------------------------------------

 

 INFO =>    user_dump_dest has trace files older than 30 days for infadb

 INFO =>    At some times checkpoints are not being completed for infadb

 WARNING => One or more redo log groups are NOT multiplexed for infadb

 WARNING => Shell limit soft nproc for DB is NOT configured according to recommendation

 ......

 INFO =>    Consider investigating changes to the schema objects such as DDLs or new object creation for infadb

 INFO =>    Information about 11.2.0.3 support

 

Best Practice checking completed.Checking recommended patches on infa.

---------------------------------------------------------------------------------

Collecting patch inventory on ORACLE_HOME /dba/oracle/product/11.2.0/db_1

---------------------------------------------------------------------------------

1 Recommended RDBMS patches for 112030 from /dba/oracle/product/11.2.0/db_1 on infa

---------------------------------------------------------------------------------

Patch#   RDBMS    ASM     type                Patch-Description                      

---------------------------------------------------------------------------------

18031683  no             merge               DATABASE PATCH SET UPDATE 11.2.0.3.10 (INCLUDES CPUAPR2014)

---------------------------------------------------------------------------------

 RDBMS homes patches summary report

---------------------------------------------------------------------------------

Total patches  Applied on RDBMS Applied on ASM ORACLE_HOME   

---------------------------------------------------------------------------------

 1              0              0                /dba/oracle/product/11.2.0/db_1

---------------------------------------------------------------------------------

 

Detailed report (html) - /home/oracle/orachk/orachk_infa_infadb_080214_023723/orachk_infa_infadb_080214_023723.html

 

UPLOAD(if required) - /home/oracle/orachk/orachk_infa_infadb_080214_023723.zip

详细输出结果已经打包成zip文件

7、RAC环境运行orachk开展健康检查

    方法与单实例完全一样,不同的一点在于,需要在运行节点,输入远端节点的root密

8、输出结果示例(摘取部分内容)

(1)头部概述信息

Oracle RAC Assessment Report

System Health Score is 85 out of 100 (detail)

Cluster Summary

Cluster Name

XXdb-cluster

OS/Kernel Version

AIX6 (64-BIT) 61 1

CRS Home - Version

/u01/app/11.2.0.3/grid - 11.2.0.3.0

DB Home - Version - Names

/u01/app/oracle/11.2.0.3/db - 11.2.0.3.0 - 2

Number of nodes

2

   Database Servers

2

orachk Version

2.2.5_20140530

Collection

orachk_XXdb1_ebizsj_072514_164205.zip

Duration

33 mins, 54 seconds

Collection Date

25-Jul-2014 16:49:00


Note! This version of orachk is considered valid for 64 days from today or until a new version is available

 

(2)database server检查输出部分

Database Server

Status

Type

Message

Status On

Details

FAIL

Database Check

There should be no duplicate parameter entries in the database init.ora(spfile) file

XXdb1:ebiz

View

FAIL

SQL Check

Table AUD$[FGA_LOG$] should use Automatic Segment Space Management for ebizsj

All Databases

View

FAIL

SQL Check

Some bigfile tablespaces do not have non-default maxbytes values set

ebiz

View

......

......

.......

......

......

WARNING

SQL Check

Consider increasing the value of the session_cached_cursors database parameter

ebiz

View

WARNING

OS Check

maximum number of processes user limit (ulimit -u) for current user is NOT set to recommended value 16384 or greater

All Database Servers

View

......

......

......

......

......

 

(3)GRIDAND RDBMS Patch部分

GRID and RDBMS patch recommendation Detailed report

Detailed report for "XXdb1"




1 Recommended CRS patches for112030 from /u01/app/11.2.0.3/grid

Patch#

CRS

ASM

RDBMS

RDBMS_HOME

Patch-Description

18139678

not-applied

n/a

not-applied

merge

GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.3.10 (INCLUDES DB PSU 11.2.0.3.10)

Top 

1 Recommended RDBMS patchesfor 112030 from /u01/app/oracle/11.2.0.3/db

Patch#

RDBMS

ASM

Type

Patch-Description

18139678

not-applied

n/a

merge

GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.3.10 (INCLUDES DB PSU 11.2.0.3.10)

 

......

 

本文作者:黎俊杰(网名:踩点),从事”系统架构、操作系统、存储设备、数据库、中间件、应用程序“六个层面系统性的性能优化工作

欢迎加入 系统性能优化专业群,共同探讨性能优化技术。群号:258187244