Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Automate analyze - can't log in
I am trying to automate analyze through cron. The shell script is unable to
login to Oracle and I am still not sure why. Is there an easier way to do
this or can someone tell what I am doing wrong?
I wanted to be able to pass parameters so that I can use it on various
databases:
/u01/app/oracle/product/9.2.0/bin/sqlplus sys/$sysdbapass
@/u01/app/tools/analyze_db.sql;
#!/bin/ksh #*************************************************************************** # Program: Analyze database # # Will analyze target database #***************************************************************************
if [ $# -ne 1 ]
then echo "Usage Error. Usage: $0 <sid name>"
exit 1
export ORACLE_SID=$1
fi
ORACLE_SID=$1
export ORACLE_SID
. /u01/app/oraconfig/Oracle.env.vars
sysdbapass=`cat /home/oracle/.passwddba.$ORACLE_SID`
export sysdbapass
/u01/app/oracle/product/9.2.0/bin/sqlplus sys/$sysdbapass
@/u01/tools/analyze_db.sql;
exit
EOF
exit 0
~
-- http://www.freelists.org/webpage/oracle-lReceived on Mon Aug 29 2005 - 10:41:36 CDT
![]() |
![]() |