We start a loadplan via $ODI_HOME/oracledi/agent/bin/startloadplan.sh Shell Script.
We want to call the LoadPlan via external scheduler.
The call looks like this:
./startloadplan.sh <MYLOADPLAN> GLOBAL "-AGENT_URL=<MYAGENT>"
OracleDI: Starting load plan <MYLOADPLAN> in context GLOBAL ...
2012-10-19 09:39:55.787 NOTIFICATION ODI-1659: Load plan "<MYLOADPLAN>", instance "2511011", run 1 has started
The odiagent.log shows me that the loadplan failed.
The Shell Script Return Value seems to be always 0. Altough documentation states:
http://docs.oracle.com/cd/E23943_01/integrate.1111/e12643/running_executions.htm#BABBEDEG) If a scenario or a Load Plan completes successfully, the return code will be 0. If not, the return code will be different than 0. This code will be available in: The return code of the command line call. The error message, if any, is available on the standard error output.
How do I get the correct exit code and error output displayed ond stderr? Or is the documentation wrong?
And: The above command returns immediately. Even tough the LoadPlan execution takes several minutes. I need the call of the shellscript to hang, until the Loadplan has finished, and then return the correct return code.
For the return code:
According to Oracle it works as expected. They don't return the exit code of the java-call to the Shell. You only get a return code !=0, if you make a typo when calling the startloadplan.sh :-)
So you have to write a wrapper script and check the status manually within this script.
They plan to add this in ODI 12 or whatever the next release will be called.