Use the Oracle ORAchk and Oracle EXAchk -fileattr
option and command flags to record and track file attribute settings, and compare snapshots.
Changes to the attributes of files such as owner, group, or permissions can cause unexpected consequences. Proactively monitor and mitigate the issues before your business gets impacted.
-fileattr
.You must have Oracle Grid Infrastructure installed and running before you use -fileattr
.
To use file attribute check with the daemon:
By default, Oracle Grid Infrastructure homes and all the installed Oracle Database homes are included in the snapshots.
To take file attribute snapshots:
$ ./orachk -fileattr start CRS stack is running and CRS_HOME is not set. Do you want to set CRS_HOME to /u01/app/11.2.0.4/grid?[y/n][y] Checking ssh user equivalency settings on all nodes in cluster Node mysrv22 is configured for ssh user equivalency for oradb user Node mysrv23 is configured for ssh user equivalency for oradb user List of directories(recursive) for checking file attributes: /u01/app/oradb/product/11.2.0/dbhome_11202 /u01/app/oradb/product/11.2.0/dbhome_11203 /u01/app/oradb/product/11.2.0/dbhome_11204 orachk has taken snapshot of file attributes for above directories at: /orahome/oradb/orachk/orachk_mysrv21_20160504_041214
Include directories in the file attribute changes check.
To include directories to check:
$ ./orachk -fileattr start -includedir "/root/myapp/config/" CRS stack is running and CRS_HOME is not set. Do you want to set CRS_HOME to /u01/app/12.2.0/grid?[y/n][y] Checking for prompts on myserver18 for oragrid user... Checking ssh user equivalency settings on all nodes in cluster Node myserver17 is configured for ssh user equivalency for root user List of directories(recursive) for checking file attributes: /u01/app/12.2.0/grid /u01/app/oradb/product/12.2.0/dbhome_1 /u01/app/oradb2/product/12.2.0/dbhome_1 /root/myapp/config/ orachk has taken snapshot of file attributes for above directories at: /root/orachk/orachk_ myserver18_20160511_032034
Exclude directories from file attribute changes checks.
To exclude directories from checks:
-includedir
discover list by using the -excludediscovery
option.$ ./orachk -fileattr start -includedir "/root/myapp/config/" -excludediscovery CRS stack is running and CRS_HOME is not set. Do you want to set CRS_HOME to /u01/app/12.2.0/grid?[y/n][y] Checking for prompts on myserver18 for oragrid user... Checking ssh user equivalency settings on all nodes in cluster Node myserver17 is configured for ssh user equivalency for root user List of directories(recursive) for checking file attributes: /root/myapp/config/ orachk has taken snapshot of file attributes for above directories at: /root/orachk/orachk_myserver18_20160511_032209
Compare the new snapshot with the previous one to track changes.
To recheck changes:
$ ./orachk -fileattr check -includedir "/root/myapp/config" -excludediscovery CRS stack is running and CRS_HOME is not set. Do you want to set CRS_HOME to /u01/app/12.2.0/grid?[y/n][y] Checking for prompts on myserver18 for oragrid user... Checking ssh user equivalency settings on all nodes in cluster Node myserver17 is configured for ssh user equivalency for root user List of directories(recursive) for checking file attributes: /root/myapp/config Checking file attribute changes... . "/root/myapp/config/myappconfig.xml" is different: Baseline : 0644 oracle root /root/myapp/config/myappconfig.xml Current : 0644 root root /root/myapp/config/myappconfig.xml ...
Results of the file attribute changes are reflected in the File Attribute Changes section of the HTML output report.
Designate a snapshot as a baseline to compare with other snapshots.
To designate a snapshot as a baseline: