?
Solved

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

Posted on 2003-03-10
3
Medium Priority
?
1,712 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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 syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

571 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