[SOLVED] Oracle 11g database backup is failing as cronjob
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The above command is working fine via command prompt.
But if I make a script and add the above command in it and run it as a cronjob, it is failing.
i am getting the following error:
/home/oracle/scripts/backup.txt: line 6: expdp: command not found
The above command is working fine via command prompt. But if I make a script and add the above command in it and run it as a cronjob, it is failing. i am getting the following error:
/home/oracle/scripts/backup.txt: line 6: expdp: command not found
Again, as you've been asked several times previously, are you paying for Oracle? It is NOT FREE, and you've mentioned RAC in previous threads....have you contacted Oracle support? And what version/distro of Linux are you using???
Past that, your error is fairly plain; the expdp command isn't in the path that's exported via CRON, so specify the full path in the script.
Again, as you've been asked several times previously, are you paying for Oracle? It is NOT FREE, and you've mentioned RAC in previous threads....have you contacted Oracle support? And what version/distro of Linux are you using???
Past that, your error is fairly plain; the expdp command isn't in the path that's exported via CRON, so specify the full path in the script.
We are using Oracle Linux 7.5 which is free.
As you mentioned, I mentioned the full path as below in the script:
Code:
/u01/app/oracle/product/12.2.0.1/db_1/bin/expdp
But still it is giving me the follwoing error:
Code:
UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory
UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory
There it is in BOLD. If you do not know what ORACLE_HOME is, contact your DBA.
OEL is **NOT ORACLE DATABASE**, but Oracle Linux. One is free, the other is not. So why are you still not paying for Oracle???
Quote:
As you mentioned, I mentioned the full path as below in the script:
Code:
/u01/app/oracle/product/12.2.0.1/db_1/bin/expdp
But still it is giving me the follwoing error:
Code:
UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory
...which is a DIFFERENT error than you initially posted. And as dc.901 said, this error (and the first error) are VERY obvious; you haven't set up Oracle correctly, don't have a path set, etc. If your DBA followed the installation instructions, you'd have the ORACLE_HOME environment variable set already. And **AGAIN**, if you contacted Oracle support, they could have told you this as well.
OEL is **NOT ORACLE DATABASE**, but Oracle Linux. One is free, the other is not. So why are you still not paying for Oracle???
...which is a DIFFERENT error than you initially posted. And as dc.901 said, this error (and the first error) are VERY obvious; you haven't set up Oracle correctly, don't have a path set, etc. If your DBA followed the installation instructions, you'd have the ORACLE_HOME environment variable set already. And **AGAIN**, if you contacted Oracle support, they could have told you this as well.
We are paying for Oracle database. The issue is solved. Thanks for help.
ORACLE_HOME was already set as an environment variable, but still the script was failing.
The problem was that cron was NOT reading any user profile settings, so I had to define it in the cron script.
I had to set the environment variable ORACLE_HOME in my script as below, and then ran the script via cronjob. Its working fine. Checking for all needed variables in .profile and defining it in the beginning of cron script solved the issue.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.