Search This Blog

Thursday, January 24, 2013

Run Commands As Oracle User From Root

The following scripts shows how a number of commands can be run as the "oracle" user the "root" user.
#!/bin/ksh
su - oracle <<EOF
ORACLE_SID=LIN1; export ORACLE_SID
rman catalog=rman/rman@w2k1 target=/ cmdfile=my_cmdfile log=my_logfile append 
EOF

This is often necessary where CRON jobs are run from the root user rather than the oracle user.

No comments:

Post a Comment