有时为了检查oracle文件权限,逐个比较较为不便,可以利用官方提供的permission.pl获取相关脚本
再稍微加工,然后用npp的compare插件,可快捷些
依据说明执行一下
-
--获取GI HOME下所有文件权限
-
root # ./permission.pl $GI_HOME
-
-
--过滤垃圾信息,便于后期比较
-
grep -Ev "/oracle/app/19.3.0/grid/cfgtoollogs/opatchautodb/|\
-
/oracle/app/19.3.0/grid/cfgtoollogs/opatch/|\
-
/oracle/app/19.3.0/grid/network/tools/help/|\
-
/oracle/app/19.3.0/grid/rdbms/audit/|\
-
/oracle/app/19.3.0/grid/usm/install/|\
-
/oracle/app/19.3.0/grid/nls/data/|\
-
/oracle/app/19.3.0/grid/sqlpatch/3|\
-
/oracle/app/19.3.0/grid/sqlpatch/2|\
-
/oracle/app/19.3.0/grid/.patch_storage/|\
-
/oracle/app/19.3.0/grid/log/|\
-
/oracle/app/19.3.0/grid/inventory/backup/|\
-
/oracle/app/19.3.0/grid/rdbms/mesg/|\
-
/oracle/app/19.3.0/grid/rdbms/log/opatch/lsinv/|\
-
/oracle/app/19.3.0/grid/cfgtoollogs/opatchauto/|\
-
/oracle/app/19.3.0/grid/suptools/tfa/release/|\
-
/oracle/app/19.3.0/grid/tfa/|\
-
/oracle/app/19.3.0/grid/OPatch.bak/" permission-三-1月-18-10-07-45-2023 > gi_ck1.log
-
-
--获取DB HOME下所有文件权限
-
root # ./permission.pl $ORACLE_HOME
-
-
--过滤垃圾信息
-
grep -Ev "/oracle/app/oracle/product/19.3.0/db_1/rdbms/xml/em/|\
-
/oracle/app/oracle/product/19.3.0/db_1/.patch_storage/|\
-
/oracle/app/oracle/product/19.3.0/db_1/inventory|/oracle/app/oracle/product/19.3.0/db_1/apex/|\
-
/oracle/app/oracle/product/19.3.0/db_1/suptools/orachk|/oracle/app/oracle/product/19.3.0/db_1/cfgtoollogs/|\
-
/oracle/app/oracle/product/19.3.0/db_1/OPatch_bak/|\
-
/oracle/app/oracle/product/19.3.0/db_1/jdk/lib/visualvm/|\
-
/oracle/app/oracle/product/19.3.0/db_1/rdbms/audit/|\
-
/oracle/app/oracle/product/19.3.0/db_1/rdbms/log/|\
-
/oracle/app/oracle/product/19.3.0/db_1/R/library/|\
-
/oracle/app/oracle/product/19.3.0/db_1/sqlpatch/3|\
-
/oracle/app/oracle/product/19.3.0/db_1/sqlpatch/2|\
-
/oracle/app/oracle/product/19.3.0/db_1/OPatch.bak/|\
-
/oracle/app/oracle/product/19.3.0/db_1/log/|\
-
/oracle/app/oracle/product/19.3.0/db_1/network/tools/" permission-三-1月-18-10-08-44-2023 > db_ck1.log
-
-
--获取Inventory文件权限并过滤
-
root # ./permission.pl /oracle/app/oraInventory
-
-
grep -Ev "/oracle/app/oraInventory/logs/|\
-
/oracle/app/oraInventory/backup/" permission-三-1月-18-10-03-08-2023 > inv_ck1.log
-
-
--排序后再比对
-
sort -k 4 -t " " gi_ck1.log >sort_gi_ck1.log
-
sort -k 4 -t " " db_ck1.log>sort_db_ck1.log
-
sort -k 4 -t " " inv_ck1.log>sort_inv_ck1.log
--统计各目录下文件个数
cat sort_gi_ck1.log|cut -b 39-47|uniq -c|sort -nr|head
cat sort_db_ck1.log|cut -b 56-65|uniq -c|sort -nr|head
还是$ORACLE_HOME/perl/ 目录下文件多
然后打开npp的比较功能(插件需要下载)
效果如下
一目了然
permission.zip
阅读(832) | 评论(0) | 转发(0) |