1.安装
mkdir orachk
unzip orachk.zip -d orachk
2.文件查看
[root@oracle11gdg IO]# cd orachk
[root@oracle11gdg orachk]# ll
total 67028
-r-xr-xr-x 1 root root 8218911 Mar 16 2017 Apex5_CollectionManager_App.sql
-r-xr-xr-x 1 root root 4816355 Sep 15 2016 CollectionManager_App.sql
-rw-r--r-- 1 root root 44188736 Apr 1 2017 collections.dat
drwxr-xr-x 2 root root 46 Jan 31 16:46 doc
drwxr-xr-x 2 root root 206 Mar 31 2017 exadiscover
-r-xr-xr-x 1 root root 5198 Mar 10 2017 generate_guests_list.sh
-r-xr-xr-x 1 root root 2897070 Mar 31 2017 orachk
-rw-r--r-- 1 root root 2272416 Apr 1 2017 ORAchk_Health_Check_Catalog.html
-rw-r--r-- 1 root root 2225 Apr 1 2017 readme.txt
-rw-r--r-- 1 root root 6172383 Apr 1 2017 rules.dat
-r-xr-xr-x 1 root root 40052 Jul 22 2015 sample_user_defined_checks.xml
drwxr-xr-x 2 root root 163 Mar 31 2017 templates
-r-xr-xr-x 1 root root 2888 Oct 9 2015 user_defined_checks.xsd
-rw-r--r-- 1 root root 233 Apr 1 2017 UserGuide.txt
3.root用户收集巡检数据。
[root@oracle11gdg orachk]# ./orachk
This version of orachk was released on 31-Mar-2017 and its older than 120 days. No new version of orachk is available in RAT_UPGRADE_LOC. It is highly recommended that you download the latest version of orachk from my oracle support to ensure the highest level of accuracy of the data contained within the report.
Do you want to download latest version from my oracle support? [y/n][y]n (输入n)
Do you want to continue running this version? [y/n][y]y (输入y)
Running older version...
Checking for prompts for oracle user on all nodes...
List of running databases
1. fermdg
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].1
. .
Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS
. . . . . . .
Checking for prompts for root user on all nodes...
. . . . . . . .
-------------------------------------------------------------------------------------------------------
Oracle Stack Status
-------------------------------------------------------------------------------------------------------
Host Name CRS Installed ASM HOME RDBMS Installed CRS UP ASM UP RDBMS UP DB Instance Name
-------------------------------------------------------------------------------------------------------
oracle11gdg No No Yes No No Yes fermdg
-------------------------------------------------------------------------------------------------------
Copying plug-ins
. . . . . . . . .
*** Checking Best Practice Recommendations (PASS/WARNING/FAIL) ***
Collections and audit checks log file is
/home/oracle/IO/orachk/orachk_oracle11gdg_fermdg_013124_164847/log/orachk.log
Checking for prompts in /root/.bash_profile on oracle11gdg for root user...
. .
=============================================================
Node name - oracle11gdg
=============================================================
. . . . .
Collecting - Database Parameters for fermdg database
Collecting - Database Undocumented Parameters for fermdg database
Collecting - RDBMS Feature Usage for fermdg database
Collecting - CPU Information
Collecting - DiskMount Information
Collecting - Kernel parameters
Collecting - Maximum number of semaphore sets on system
Collecting - Maximum number of semaphores on system
Collecting - Maximum number of semaphores per semaphore set
Collecting - Memory Information
Collecting - OS Packages
Collecting - Operating system release information and kernel version
Collecting - Patches for RDBMS Home
Collecting - Table of file system defaults
Collecting - number of semaphore operations per semop system call
Collecting - Disk Information
Collecting - Linux Operating system health check using vmpscan.sh
Collecting - Root user limits
Collecting - Verify no database server kernel out of memory errors
Data collections completed. Checking best practices on oracle11gdg.
--------------------------------------------------------------------------------------
INFO => Important Storage Minimum Requirements for Grid & Database Homes
WARNING => There are some application objects with STALE statistics. for fermdg
INFO => Most recent ADR incidents for /oracle/app/oracle/product/11.2.0/db_1
INFO => Oracle GoldenGate failure prevention best practices
INFO => Validate database security configuration using database security assessment tool for fermdg
WARNING => Oracle patch 23665623 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 22113854 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 18498878 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 24739928 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 19174639 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 20879889 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 20476175 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 20907061 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Oracle patch 19855835 is not applied on RDBMS_HOME /oracle/app/oracle/product/11.2.0/db_1
WARNING => Kernel Parameter SEMOPM Is Lower Than The Recommended Value
INFO => user_dump_dest has trace files older than 30 days for fermdg
INFO => At some times checkpoints are not being completed for fermdg
WARNING => Linux Swap Configuration does NOT meet Recommendation
WARNING => OSWatcher is not running as is recommended.
FAIL => Database parameter DB_BLOCK_CHECKSUM is not set to recommended value on fermdg instance
FAIL => Database parameter DB_LOST_WRITE_PROTECT is not set to recommended value on fermdg instance
WARNING => Database parameter DB_BLOCK_CHECKING on PRIMARY is NOT set to the recommended value. for fermdg
INFO => Operational Best Practices
INFO => Database Consolidation Best Practices
INFO => Computer failure prevention best practices
INFO => Data corruption prevention best practices
INFO => Logical corruption prevention best practices
INFO => Database/Cluster/Site failure prevention best practices
INFO => Client failover operational best practices
WARNING => Oracle clusterware is not being used
WARNING => RAC Application Cluster is not being used for database high availability on fermdg instance
WARNING => DISK_ASYNCH_IO is NOT set to recommended value for fermdg
FAIL => Flashback on PRIMARY is not configured for fermdg
INFO => Database failure prevention best practices
WARNING => fast_start_mttr_target has NOT been changed from default on fermdg instance
FAIL => Primary database is NOT protected with Data Guard (standby database) for real-time data protection and availability for fermdg
FAIL => Active Data Guard is not configured for fermdg
WARNING => Redo log write time is more than 500 milliseconds for fermdg
INFO => Parallel Execution Health-Checks and Diagnostics Reports for fermdg
INFO => Oracle recovery manager(rman) best practices
INFO => Consider increasing the COREDUMPSIZE size
INFO => Consider setting optimizer related parameters to their default values (Parameter Set 3 of 3) for fermdg
WARNING => Consider investigating changes to the schema objects such as DDLs or new object creation for fermdg
WARNING => Consider investigating the frequency of SGA resize operations and take corrective action for fermdg
Best Practice checking completed.Checking recommended patches on oracle11gdg.
---------------------------------------------------------------------------------
Collecting patch inventory on ORACLE_HOME /oracle/app/oracle/product/11.2.0/db_1
---------------------------------------------------------------------------------
1 Recommended RDBMS patches for 112040 from /oracle/app/oracle/product/11.2.0/db_1 on oracle11gdg
---------------------------------------------------------------------------------
Patch# RDBMS ASM type Patch-Description
---------------------------------------------------------------------------------
24006111 no merge DATABASE PATCH SET UPDATE 11.2.0.4.161018
---------------------------------------------------------------------------------
RDBMS homes patches summary report
---------------------------------------------------------------------------------
Total patches Applied on RDBMS Applied on ASM ORACLE_HOME
---------------------------------------------------------------------------------
1 0 0 /oracle/app/oracle/product/11.2.0/db_1
---------------------------------------------------------------------------------
Detailed report (html) - /home/oracle/IO/orachk/orachk_oracle11gdg_fermdg_013124_164847/orachk_oracle11gdg_fermdg_013124_164847.html
UPLOAD(if required) - /home/oracle/IO/orachk/orachk_oracle11gdg_fermdg_013124_164847.zip
4.查看收集结果
[root@oracle11gdg orachk_oracle11gdg_fermdg_013124_164847]# ll
total 676
drwxr-xr-x 2 root root 204 Jan 31 16:52 log
-rw-r--r-- 1 root root 610995 Jan 31 16:52 orachk_oracle11gdg_fermdg_013124_164847.html
drwxr-xr-x 4 root root 20480 Jan 31 16:52 outfiles
-rw-r--r-- 1 oracle oinstall 34227 Jan 31 16:51 pxhcdr_fermdb_oracle11gdg_11.2.0.4.0_20240131_165123_log.zip
drwxr-xr-x 2 root root 204 Jan 31 16:52 reports
drwxr-xr-x 2 root root 12288 Jan 31 16:52 scripts
drwxr-xr-x 2 root root 307 Jan 31 16:52 upload
5.总结
(1)收集补丁信息。
(2)收集参数信息。
(3)OSWatcher是否运行
(4)swap检查
(5)内核参数检查
(6)过时的统计信息
(7)优化参数
(8)COREDUMPSIZE 大小检查
(9)并行执行
(10)检查点未完成
(11)user_dump_dest 里面tracefile检查,是否过期
(12)数据库安全访问
(13)ADR事件
(14)最小安装建议。
(15)fast_start_mttr_target 检查
(16)DISK_ASYNCH_IO 检查
(17)某些SQL的解析调用次数。
(18)磁盘空间的使用情况
(19)AWR保留策略
(20)ORACLE组件检查
(21)安装依赖包检查
orachk 工具,虽然可以收集信息,但是仅限于操作系统和数据库参数,组件,补丁,等信息的访问。缺少数据库内部对象的信息。例如表空间,表大小,数据库大小等。需要结合自定义脚本进行巡检。