Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Automate analyze - can't log in

Re: Automate analyze - can't log in

From: rjamya <rjamya_at_gmail.com>
Date: Mon, 29 Aug 2005 11:58:39 -0400
Message-ID: <9177895d05082908587e1fcd64@mail.gmail.com>


your script should look like ...

connect / as sysdba
exec blah_1;
exec blah_2;
exit

and then change your sqlplus call in the shell script to

$ORACLE_HOME/bin/sqlplus -s /nolog @fully_qualified_script_name_here

Raj

On 8/29/05, J. Dex <cemail_219_at_hotmail.com> wrote:
>
> 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
> ~
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> --
> http://www.freelists.org/webpage/oracle-l
>

-- 
------------------------------
select standard_disclaimer from company_requirements where category = 
'MANDATORY';

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Aug 29 2005 - 11:00:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US