?
Solved

CALLING UNIX C-Shell scripts from Oracle SQL/sqlplus/stored procedures

Posted on 2003-03-10
3
Medium Priority
?
1,697 Views
Last Modified: 2013-12-11
Hi Good person,

I have an Oracle DB, that's heavily relying on c-shell scripts, and we need to have a DIRECT link between Oracle scripts and the c-shell scripts. In other words, we want to run any of our c-shell scripts at any time from the Oracle DB (throught stored procedures, or preferrably, embedded SQL code in PowerBuilder)

CAN ANY ONE HELP?

Any word regarding

1- Easiest way to call the scripts
2- minimum login requirements(one id/one password for both DB & application)Without using OS Authentication method in Oracle
3- How to call SQL loader from Oracle SQL (Without having to go to OS)

By the way:

Application scripts are on machine A
DB Server is on machine B
Client invoking scripts will be from a PC(Powerbuilder application)

Highly appreciate it,

Thanks
0
Comment
Question by:tootootoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
saxena_mohit earned 80 total points
ID: 8141498
Hi,
 you can use Host function in your pl/sql or sql script or procedure and then  call your unix shell files.
Example put

host('/home/user/scripts/test.sh')
and you can run it on your server. similerly you can right a shell script for sql loader and call that script using host function.I guess this would help.
Thanks
mohit

but in this case scripts have to be on server machine B.
0
 
LVL 3

Expert Comment

by:graf27
ID: 8339130
I use the other way: Running Shell-Scripts which are calling database values etc ....

1. Example invoking DB

#!/bin/sh

echo running Script
echo ....
echo calling DB

sqlplus -s scott/tiger <<+++EOF

-- Your SQLPLUS-Code here
select 'I am from database' from dual;
quit

+++EOF

echo end of DB


2. Getting Values from db

#!/bin/sh
myvalue=`(sqlplus -s scott/tiger @select.sql)`
echo $myvalue


0
 
LVL 4

Expert Comment

by:MathiasMagnusson
ID: 9152943
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[Accept saxena_mohit's comment as answer.]
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
MathiasMagnusson
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

770 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