Solved

Running Shell Script on UX-HP from Oracle Procedure

Posted on 2001-07-03
7
942 Views
Last Modified: 2012-06-21
How to execute/run an Unix Shell Script from a database trigger / Stored Procedure. The version of Oracle is 8.0.5
0
Comment
Question by:kotvali
  • 4
  • 2
7 Comments
 
LVL 3

Expert Comment

by:myerpz
Comment Utility
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
 

Author Comment

by:kotvali
Comment Utility
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
 
LVL 1

Expert Comment

by:whbram
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:kotvali
Comment Utility
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
 
LVL 1

Accepted Solution

by:
whbram earned 50 total points
Comment Utility
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
 

Author Comment

by:kotvali
Comment Utility
Thanks whbram !
0
 

Author Comment

by:kotvali
Comment Utility
Thanks whbram !
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now