- 3,714,823 Users
- 2,242,634 Discussions
- 7,845,082 Comments
Forum Stats
Discussions
Categories
- 12 Data
- 362.2K Big Data Appliance
- 6 Data Science
- 1.5K Databases
- 447 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 3 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.7K ORDS, SODA & JSON in the Database
- 415 SQLcl
- 42 SQL Developer Data Modeler
- 184.8K SQL & PL/SQL
- 21K SQL Developer
- 1.8K Development
- 3 Developer Projects
- 32 Programming Languages
- 135K Development Tools
- 7 DevOps
- 3K QA/Testing
- 236 Java
- 4 Java Learning Subscription
- 10 Database Connectivity
- 65 Java Community Process
- Java 25
- 8 Java APIs
- 141.1K Java Development Tools
- 5 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 134 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 10 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 118 LiveLabs
- 28 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 3 Deutsche Oracle Community
- 10 Español
- 1.9K Japanese
- 2 Portuguese
Shell Scripts from Apex 19.2

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.
Answers
-
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.
-
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.
-
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?
-
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
-
This is not a Use Case.
This is your solution to an unknown problem.
Define the problem.
-
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.
-
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.
-
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.
-
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
-
dba-oracle is not a web site I would recommend for accurate technical detail.
-
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.
-
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.