HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Showing results for 
Search instead for 
Did you mean: 

rma script fails

Occasional Advisor

rma script fails


export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_SID=cieho
export PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin

su - $ORACLE -c "rman catalog=rman/rman target=sys/redhat @incr.sql"
it fails ++ su - oracle -c 'rman catalog=rman/rman target=sys/redhat @incr.sql'

it fails with following error
-bash: rman: command not found

pls any input to resolve this issue


Patrick Wallek
Honored Contributor

Re: rma script fails

It's probably not carrying your path over when you do the 'su'.

Specify the full path to the 'rman' executable.

su - $ORACLE -c "/u01/app/oracle/product/10.2.0/db_1/bin/rman catalog=rman/rman target=sys/redhat @incr.sql"

Re: rma script fails

Since you are doing "su -", your $PATH setting isn't copied over, as Patrick said.

You could add $PATH to the oracle user or add it on that command:
su - $ORACLE -c "export PATH=$PATH; rman catalog=rman/rman target=sys/redhat @incr.sql"

Your other variables aren't copied either, do you need them?
Occasional Advisor

Re: rma script fails

Hi Patrik,

Thanks lot for your inputs

We try but it fails againg

++ su - oracle -c '/u01/app/oracle/product/10.2.0/db_1/bin/rman catalog=rman/rman target=sys/Janet12 @incr.sql'

Message file RMAN.msb not found

Verify that ORACLE_HOME is set properly


Re: rma script fails

>Verify that ORACLE_HOME is set properly

That's what I cautioned you about:
su - $ORACLE -c "export PATH=$PATH ORACLE_HOME=$ORACLE_HOME ORACLE_SID=$ORACLE_SID; rman catalog=rman/rman target=sys/redhat @incr.sql"
Occasional Advisor

Re: rma script fails

Thanks lot it works


Re: rma script fails

>Thanks lot it works

If you are happy with the answers you got, please the following about how to assign points: