Running/Hung Action Not Returning Failed Or Successful

Document ID : KB000117474
Last Modified Date : 15/10/2018
Show Technical Document Details
The "Run Command Line (SSH)" action is being used to execute sqlplus. The command starts and never stops. It continues to run forever.

An example of the command that is running is: 
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/client_1;/u01/app/oracle/product/12.1.0/client_1/bin/sqlplus my_qa_orauser/***** @ORASERVICENAME @/path/to/myoracle.sql 

CA Release Automation 
The cause is related to the fact that the command used above will execute the myoracle.sql script and then exit out to the sqlplus prompt. The agent expects/needs all commands to complete successfully and return a return code (rc). Since sqlplus is still running it has not returned an rc and that is why the action is being shown as still running. 
There might be other ways to successfully get sqlplus to exit after finishing the script. Here is an example of one method:
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/client_1; exit | /u01/app/oracle/product/12.1.0/client_1/bin/sqlplus my_qa_orauser/***** @ORASERVICENAME @/path/to/myoracle.sql