Home » Infrastructure » Unix » Problem in Scheduling the export script
Problem in Scheduling the export script [message #247533] Tue, 26 June 2007 04:48 Go to next message
Messages: 66
Registered: May 2005
Location: Delhi
I have oracle on Solaris 5.8. I want to schedule the script through crontab that will automatically take the export backup of database. But when i run the script it doesnot change the login to oracle.

Then i have just write the below contents in the shell script:

su - oracle << eof

cd /Oracle_dump


when i run the script through root user, it doesn't login as oracle user.

but when i change the script:

su - oracle

then it connects. Please let me know why it doesn't login, if i specify <<eof...eof

The same script running fine on another server. But the version of solaris is 5.9

Please suggest.

Re: Problem in Scheduling the export script [message #247650 is a reply to message #247533] Tue, 26 June 2007 12:13 Go to previous message
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Use some thing like this according to your requirement

by using vi make file export.sh

#!/bin/ksh -x

. $HOME/.profile_mydb

DAY=`date +%A`

$ORACLE_HOME/bin/exp userid=oracle/espsvcsoracle file=$MYDB_EXP/EXP_$DAY.dmp log=$MYDB_EXP/FULL_export_$DAY.l
og grants=Y indexes=Y consistent=y direct=n FULL=y

and then enter the entry in crontab like this

00 02 * * * /export/home/oracle/mydb7.2/script/export.sh > /export/home/oracle/mydb7.2/script/daily/log/export.out &
Previous Topic: Directory structure of ORACLE
Next Topic: FTP put /send file transfer
Goto Forum:

Current Time: Mon Oct 26 02:55:14 CDT 2020