iru@/home/oracle/dba/scripts: cat check_all_database.sh
#!/bin/sh
ORATAB=/home/oracle/dba/scripts/oratab
export ORATAB
start()
{
sqlplus -s '/as sysdba'<<!
set head off
set pagesize 100
select instance_name from v\$instance;
select username from dba_users where username like '%AM%';
select username from dba_users where username like '%MA%';
select count(1) from all_objects where owner='RKEHOSKIE';
exit
!
}
cat $ORATAB| egrep -v '#|^$|ASM' | while read i
do
(
ORACLE_HOME=`echo ${i} | awk -F":" '{ print $2 }'`
ORACLE_SID=`echo ${i}| awk -F":" '{ print $1 }'`
export ORACLE_HOME ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH
export PATH
start
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
sleep 2
) | tee -a check.log
done
Comments
Post a Comment