orachk is nothing new and was former known as raccheck, long time ago and the functionality increased a lot! It checks your environment for possible wrong configurations and best practices from oracle. The number of checks increase with each version. here you can see all the checks. You can check an existing installation or improve your standard configuration with the recommendations. I like to use it, after a cluster setup or upgrade or operating system upgrade. It’s not limited to Database, Clusterware or Operating System, but in this blog it is. Main MOS Note and Doku. Exachk is an own tool, but belongs to the same family.
Installation and Update
You may have it already on your server. Check $ORACLE_HOME/suptools . Usually its very old and not managed by OPatch (a little bit strange, something inside the oracle home not managed by OPatch, isn’t it?).
oracle$ cd $ORACLE_HOME/suptools/orachk oracle$ ./orachk -v ORACHK VERSION: 2.2.5_20140530
The current version is 184.108.40.206.7 (stand of June 2016). For one simple run you can easily unzip it to any location you want and remove it afterwards. In some former version the resultes was removed if it was placed on shared storage.
root# mkdir /tmp/orachk root# cd /tmp/orachk root# unzip ../orachk.zip
and it’s ready to run or you can upgrade the existing one:
oracle$ export RAT_UPGRADE_LOC=/tmp/upgrade oracle$ ls /tmp/upgrade/ orachk.zip oracle$ ./orachk -upgrade Output directory is /XXX orachk has been upgraded to ORACHKVERSION:220.127.116.11.7_20160526
The tool could run with different users root, oracle home owner or grid home owner. Oracle recommend the root user, but the user needs ssh equivalence between the nodes and root often forbidden to login via ssh, therefore I recommend to run it as oracle home owner and grant the sudo permissions on all nodes.
oracle ALL=(root) NOPASSWD:/home/oracle/.orachk/root_orachk.sh
Arccording to the dokumentation it’s $HOME/root_orachk.sh, but thats wrong! (/var/log/secure told me the truth :))
There a a lot of possibilities to run is but keep is simple .. for the beginning.
OK, this was really easy. If you want to run it often. You don’t want to type the password all the time and confirm the detected Values for CRS_HOME and DBs. You want to run it silent. -s (not described in help) tell orachk to use sudo and use the default values. To overwrite the defaults have a look in help with -h.
For the report, open the html file. It’s intuitive to read and don’t care about the System Health Score.
Skip Checks and Profiles
If you already know check which fail you can exclude these or maybe the whole profile.
./orachk -excludeprofile maa -excludecheck E6862960C4CD3E9DE04313C0E50A9C21,9EC93C7514C11512E040E50A1EC048DD
Or do it the other way around and specify the check which should run
./orachk -profile asm -check 9EC93C7514C11512E040E50A1EC048DD
The check number are shown in the report, if you click on “Show/Hide Check IDs”.
If you upgrade something or changed a lot on the system you can compare tow reports. In case you run different checks you need the -force option.
./orachk -diff orachk_XX_XX_061716_213556.zip orachk_XX_XX_061716_230539.zip
You can add some additional check into the file user_defined_checks.xml . A sample_user_defined_checks.xml is delivered with orachk.zip and already prepared with some additional checks for OSWatcher and DB audit. If you want to check some standard definitions, you can add them here, i.e. oracle home locations or special database parameters. I found very less documentation, but the file is well commented. Run only the user defined check with:
./orachk -s -profile user_defined_checks
If you face some problems, detecting grid home or operating system, you can export a shell variable. All of them are starting with RAT_ for details you have to look at the documentation or -debug option, which start the orachk with set -x . Nearby the whole orachk is written in bash.
Also a daemon mode is available to run orachk on a regular basis or collection manager for storing the outputs in a central db. Both sound very interesting, but i don’t found the time and the use cases for that.