• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 990
  • Last Modified:

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
0
kotvali
Asked:
kotvali
  • 4
  • 2
1 Solution
 
myerpzCommented:
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.
0
 
kotvaliAuthor Commented:
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
0
 
whbramCommented:
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:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=oracle&qid=10345775#1
0
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
kotvaliAuthor Commented:
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
0
 
whbramCommented:
The code resides in a stored database procedure (PL/SQL).
That means that you can run it from the database.
Calling the procedure from Oracle Forms is just one way of invoking it.
You can call this stored procedure from a number of things, a job queue entry, a database trigger or anything that can call a PL/SQL procedure (even SQL Plus).
0
 
kotvaliAuthor Commented:
Thanks whbram !
0
 
kotvaliAuthor Commented:
Thanks whbram !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now