Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

通过kfed自动获取磁盘信息的小脚本

$
0
0

编译KFED

[oracle@rac lib]$cd $ORACLE_HOME/rdbms/lib

[oracle@rac lib]$ pwd

/u01/app/oracle/product/10.2.0/db_1/rdbms/lib

[oracle@rac lib]$ make -f ins_rdbms.mk ikfed

 

Linking KFED utility (kfed)

rm -f/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed

gcc -o/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed-L/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/-L/u01/app/oracle/product/10.2.0/db_1/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/stubs/-L/usr/lib -lirc /u01/app/oracle/product/10.2.0/db_1/lib/s0main.o/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/sskfeded.o/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/skfedpt.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o -ldbtools10-lclntsh  `cat/u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10-lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat/u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 -lnro10 `cat/u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10-ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10  -lsnls10 -lnls10  -lcore10-lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10-lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10-lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat/u01/app/oracle/product/10.2.0/db_1/lib/sysliblist`-Wl,-rpath,/u01/app/oracle/product/10.2.0/db_1/lib -lm    `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist`-ldl -lm   -L/u01/app/oracle/product/10.2.0/db_1/lib

mv -f/u01/app/oracle/product/10.2.0/db_1/bin/kfed/u01/app/oracle/product/10.2.0/db_1/bin/kfedO

mv: cannot stat`/u01/app/oracle/product/10.2.0/db_1/bin/kfed': No such file or directory

make: [ikfed] Error 1 (ignored)

mv /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/kfed/u01/app/oracle/product/10.2.0/db_1/bin/kfed

chmod 751/u01/app/oracle/product/10.2.0/db_1/bin/kfed

[oracle@rac lib]$

 

--查看KFED 位置

[oracle@rac lib]$ which kfed

/u01/app/oracle/product/10.2.0/db_1/bin/kfed

 

这里记录一个脚本,方便以后获取信息:

 

#########################################################

#! /bin/sh
rm /tmp/kfed_DH.out /tmp/kfed_FS.out /tmp/kfed_BK.out /tmp/kfed_FD.out /tmp/kfed_DD.out /tmp/kfed_PST.out
for i in `ls /dev/raw/raw*`
do
echo $i >> /tmp/kfed_DH.out
/u02/app/oracle/product/10.2.0/db_1/bin/kfed read $i >> /tmp/kfed_DH.out
echo $i >> /tmp/kfed_FS.out
/u02/app/oracle/product/10.2.0/db_1/bin/kfed read $i blkn=1 >> /tmp/kfed_FS.out
echo $i >> /tmp/kfed_BK.out
/u02/app/oracle/product/10.2.0/db_1/bin/kfed read $i aun=1 blkn=254 >> /tmp/kfed_BK.out
echo $i >> /tmp/kfed_FD.out
/u02/app/oracle/product/10.2.0/db_1/bin/kfed read $i aun=2 blkn=1 >> /tmp/kfed_FD.out
echo $i >> /tmp/kfed_DD.out
/u02/app/oracle/product/10.2.0/db_1/bin/kfed read $i aun=2 blkn=2 >> /tmp/kfed_DD.out
echo $i >> /tmp/kfed_PST.out
/u02/app/oracle/product/10.2.0/db_1/bin/kfed read $i aun=1 blkn=2 >> /tmp/kfed_PST.out
done

#####################################################
~

作者:royjj 发表于2013-3-21 23:53:33 原文链接
阅读:83 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>