- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scheduling oracle export process
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 02:55 AM
03-03-2003 02:55 AM
Objective:
Daily backup for oracle database tables using cron.
Overview:
Normaly to export tables iuse this command:
exp username/password full=y file=/backup/ora.dmp
this command will export all database tables to a dump file called ora.dmp
I want to scheduled this command by cron. so, I added the oracle account called xyz to cron.allow
then,
crontab -e xyz
added:
00 18 * * * exp username/password full=y file=/backup/ora.dmp
Problem:
Nothing happen, the cron daemon can't read the above task. I tried another task " ps -ef > file" and it did read it.
IS there any problem with syntax?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:01 AM
03-03-2003 03:01 AM
Solutionusing cron you do not have a login-shell, so try this:
00 18 * * * (. /etc/profile; . ./.profile; exp username/password full=y file=/backup/ora.dmp)
HINT:
"exp username/password ..." will show you the password of this user in the ps-command, better:
"echo username/passwword@SID | exp ..."
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:07 AM
03-03-2003 03:07 AM
Re: scheduling oracle export process
crontab -l
# See if the cron have read teh crontab file
2- /sbin/init.d/cron stop
/sbin/init.d/cron start
# RE start cron process
3- mailx -f /var/mail/xyz
# see user mail for cron notifications
4- vi /usr/lib/cron/log
# search for commands started foe user xyz
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:09 AM
03-03-2003 03:09 AM
Re: scheduling oracle export process
My crontab looks like
40 * * * * /usr/bin/expdat
# vi expdat
#this script is used to export the database
#!/usr/bin/sh
ORACLE_HOME=/opt/app/oracle/product/8.1.7;export ORACLE_HOME
TERM=vt100;export TERM
rm /tmp/database
$ORACLE_HOME/bin/givedb >> /tmp/database
x=`date "+.dmp%d%m%y"`;
for i in `cat /tmp/database`
do
#echo "enter the database name for export :\c"
#read ORACLE_SID;export ORACLE_SID
$ORACLE_HOME/bin/exp system/
done
this is the givedb script
ps -ef|grep ora_reco|grep -v grep|awk '{print $9}'| cut -c 10- |egrep 'DB'
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:10 AM
03-03-2003 03:10 AM
Re: scheduling oracle export process
login as xyz user
$crontab -e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:50 AM
03-03-2003 03:50 AM
Re: scheduling oracle export process
are the variables etc, required for export to run available.
the best way to do is to check the mails for the user with which cron is run and also the cron log.
hth
-balaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:53 AM
03-03-2003 03:53 AM
Re: scheduling oracle export process
Doesn't work.
Carlos Comment:
when I view mail for xyz, I notice the following:
sh: /etc/profile: execute permission denied
sh: ./profile: execute permission denied
sh: exp: not found
then, I wrote the whole path for exp, and still nout found.
Other Comments I'll go through it now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 03:53 AM
03-03-2003 03:53 AM
Re: scheduling oracle export process
Doesn't work.
Carlos Comment:
when I view the mail for xyz, I notice the following:
sh: /etc/profile: execute permission denied
sh: ./profile: execute permission denied
sh: exp: not found
then, I wrote the whole path for exp, and still nout found.
Other Comments I'll go through it now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 04:12 AM
03-03-2003 04:12 AM
Re: scheduling oracle export process
I didnt write ( /etc/.profile) ....
Substitute your exp .... line by a filename.sh.
Inside filename.sh set all VARIABLES you need to run the export - ORACLE_SID, PATH ...-
Include also the line
set -x
so the mail will contain all commands executed.
set execution perms to filename.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 04:31 AM
03-03-2003 04:31 AM
Re: scheduling oracle export process
/etc/profile is not a shell-skript, you cannot execute it, you have to "source" it.
Please copy and paste my answer and you'll find:
. /etc/profile
and
. ./.profile
(dot-space-/etc/profile)
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 09:35 AM
03-03-2003 09:35 AM
Re: scheduling oracle export process
Proper permissions on /etc/profile
-r--r--r-- 1 bin bin 2539 Dec 30 08:36 /etc/profile
We don't want to execute it.
As user xyz do you get a schedule when you run crontab -e ?
I didn't see that.
We are going this way currently oracle backups are done by root with this cron syntax.
5 22 * * 1-5 /usr/contrib/bin/backup.oracle.sh 2>&1 | mailx -s "Nighlty Oracle C
old Backup" HPSysCronLog@juf.org
Inside the job....
/usr/bin/su - oracle -c "/usr/contrib/bin/nightly.backup.oracle.sh"
This handles making sure the backup is done by oracle user not root.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 10:51 PM
03-03-2003 10:51 PM
Re: scheduling oracle export process
Thank very much Cris.
Thank you all
YMJ