Link to home
Start Free TrialLog in
Avatar of kotvali
kotvali

asked on

Running Shell Script on UX-HP from Oracle Procedure

How to execute/run an Unix Shell Script from a database trigger / Stored Procedure. The version of Oracle is 8.0.5
Avatar of myerpz
myerpz

You might like to consider the following.
Within your database trigger or stored procedure, if your processing detects a condition which means a Unix job should be run, then write a record to another Oracle table ( let's call it "JobControl" ) containing enough information for a separate job to determine what needs doing.
This separate job is run ( at whatever frequency is appropriate ) via a crontab entry and connects to the database to check if anything needs doing. If not, it goes back to sleep. But if a JobControl record is found, then the approprate action is taken.
( the SQL which polls  the JobControl table could spool output to a file which your Unix job could then pick up on ).
Sounds a bit convoluted, but I have used it and it is quite flexible once set up.

Hope this helps, good luck.
Avatar of kotvali

ASKER

Dear Myerpz,

Thanks a lot for your comment. I really appreciate it. I have couple of jobs running the same way. Instead fo Corntab, I have a scheduler called "Appworx" which does the same. My questions is, directly, can I access the shell script!

Thanks any way.

Regards,
Shashi
The best way to access a shell script from PL/SQL is via Oracle External Procedure calls.

Please refer to a previous answer of mine at:
https://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=10345775#1
Avatar of kotvali

ASKER

Hi whbram,

Thanks a lot for your response. But I dont have to do anything with forms. I need to execute shell straight from Oracle Database.

Thanks any way.
Shashi
ASKER CERTIFIED SOLUTION
Avatar of whbram
whbram

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kotvali

ASKER

Thanks whbram !
Avatar of kotvali

ASKER

Thanks whbram !