Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Shell Scripts from Apex 19.2

VallabhaOct 23 2020 — edited Oct 24 2020

Hi All
How to call shell Scripts from Apex 19.2 any examples please.
Use Case
We are in the process creating a UI in APEX which need to call serial of Shell Scripts ( it is all related Apps DBA tasks ) and need to send the output to user.

Comments

jflack

I think you should include information about what you are trying to accomplish - what is your use case. A shell script might not be the best solution, and certainly raises security concerns.

Vallabha

Hi Jflack
Thanks for your comments
Below is the Use Case
We are in the process creating a UI in APEX which need to call serial of Shell Scripts ( it is all related Apps DBA tasks ) and need to send the output to user.

InoL

Still not clear what you are trying to do.
Shell script running on the client? That is not possible from a browser.
Shell script running on the database server? Use dbms_scheduler for that.
Somewhere else? What is triggering the script?

Mike Kutz

Example DBA Tasks?
The ORDS team has REST-enabled a few of them (ORDS v19.1)
Other tasks (common for other RDBMS) may not be needed.
MK
REST Data Services Release Notes 19.1 (0 Bytes)

Billy Verreynne

This is not a Use Case.
This is your solution to an unknown problem.
Define the problem.

Vallabha

We are in the process of automating the EBS Apps cloning process for it we want to call Shell Scripts from Apex so it we wanted to know how we can call it.

InoL

I assume you are talking about scripts on the database server then. An Apex web application cannot call shell scripts directly from the browser, but the database can. Use dbms_scheduler.

Billy Verreynne

Shell scripts where? Running as which o/s users? Using what o/s environments?
APEX is a PL/SQL framework. It does not run "scripts", with the exception of Javascript that is send to the APEX client (web browser/web client) for execution.
PL/SQL can run external processes via the EXT PROC interface, via the Java VM accessing the o/s, or via DBMS Scheduler.
PL/SQL also has a web interface (expanded upon with APEX) for executing web CGI processes, and web services.
DBMS Scheduler is the easiest secure option. However it runs local processes on the database server in a non-privileged account - in other words a non-oracle and non-grid o/s account. Which ceases to be secure when you makes that a privileged account like that of an app server, or oracle itself.
This means using features like Sudo - and using these very carefully and not violating basic security principles. Which very likely means that very few to none of your existing scripts would be safe to run as is.
If the process execution also crosses server boundaries then approaches like ssh with authorised keys need to be considered.
All these issues makes the question "how to execute scripts from APEX?" a dangerously ignorant and naive question.

Yevon

This has nothig to do with APEX, this is just oracle DB PLSQL development. You can call database shceduler that calls to shell scripts, Just try this:
Just search in google: "oracle shceduler execute shell scripts" and you have nice article in dba-oracle

Billy Verreynne

dba-oracle is not a web site I would recommend for accurate technical detail.

jflack

Now were getting somewhere. I wonder if EBS Apps has an API that you can call instead of shell scripts. But if you must call shell scripts, I think a few people have given you good suggestions to use DBMS_SCHEDULER or an external procedure. Personally, I prefer scheduler.

Mike Kutz

I had an adjustment so that Google would no longer consider that site, but it stopped working. I haven't gone back to "fix" it.

1 - 12

Post Details

Added on Oct 23 2020
12 comments
2,061 views