Bugun birden fazla database yoneten arkadaslarımızın isine yarabilecek bazı oratab özelikklerini paylaşmak istedim
Bu serverde kac process hangi databaselerde çalışıyor?
[zekeriya@zekeriyapc] cat pscnt
if [ “`echo $LINE | awk -F: ‘{print $3}’ -`” = “Y” ] ; then
ORACLE_SID=`echo $LINE | awk -F: ‘{print $1}’ -`
COUNT=`ps -ef | grep -v ora_ | grep $ORACLE_SID | wc -l`
echo “$ORACLE_SID $COUNT”
fi
esac
done
hangi database ne buyuklukte?
[zekeriya@zekeriyaPC] cat dbsizeall
for sid in `cat /var/opt/oracle/oratab | grep Y$ | cut -f1 -d:`
do
echo $sid
dbsize $sid
echo “ “
done
Kaç database var?
[zekeriya@zekeriyaPC] cat dbcnt
ORATAB=/var/opt/oracle/oratab
cat $ORATAB | grep -v “^\#” | grep -v “^*” | grep -v “^$” | wc -l
Hangi databaseler ayakta ve çalışıyor?
[zekeriya@zekeriyaPC] cat dbayakta
ORATAB=/var/opt/oracle/oratab
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*) 
if [ “`echo $LINE | awk -F: ‘{print $3}’ -`” = “Y” ] ; then
ORACLE_SID=`echo $LINE | awk -F: ‘{print $1}’ -`
if [ “$ORACLE_SID” = ‘*’ ] ; then
ORACLE_SID=””
fi
ORACLE_HOME=`echo $LINE | awk -F: ‘{print $2}’ -`
# check for database online
STATUS=`ps -fu oracle | grep “ora_[a-z]*_${ORACLE_SID}$” `
if [ $? -eq 0 ]; then
echo “${ORACLE_SID} OK”
else
echo “${ORACLE_SID} DOWN”
fi
fi
esac
done