Solved

oracle shell script job

Posted on 2007-04-04
6
465 Views
Last Modified: 2012-08-13
Hi

I have a shell script and my oracle version is 9i
How can i make this shell script to execute via an oracle job
0
Comment
Question by:suhinrasheed
6 Comments
 
LVL 27

Expert Comment

by:sujith80
ID: 18855918
To do this:
You need to write an external procedure in either Java or C and call it from the Job.

But why dont you schedule your jobs in the unix machine?
Setup crontab to run the shell script and if any sqlprocessing has to be done do it in the shell script.
0
 
LVL 9

Expert Comment

by:arioh
ID: 18855981
0
 

Author Comment

by:suhinrasheed
ID: 18856297
hi

i have a control file in UNIX machine as follows

 LOAD DATA
 infile *
 TRUNCATE INTO TABLE dept
   FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
   (deptno, dname, loc)
   BEGINDATA
   18,"mrty","SARIN"
   12,RESEARCH,"SARATOGA"
   10,"ACCOUNTING",CLEVELAND
   11,"ART",SALEM
   13,FINANCE,"BOSTON"
   21,"SALES",PHILA.
   22,"SALES",ROCHESTER
   42,"INT'L","SAN FRAN"

Now i have a shell script file load.sh in the UNIX machine.The content of .sh file is:
sqlldr acorn/acorn control=dept.ctl log=dept.log

Now i have created a java stored procedure as mentioned in link below
http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php

But it seems the procedure is not functioning..could you tell me how to test my procedure successfully
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:suhinrasheed
ID: 18856308
i have not given grant permsions mentioned in the link is it because of that the data load is not happening
0
 
LVL 9

Accepted Solution

by:
arioh earned 500 total points
ID: 18856378
those permissions must be granted, otherwise java stored procedure will not read your script from the disk and will not run it
0
 
LVL 9

Expert Comment

by:konektor
ID: 18857726
you should better use other scheduler than oracle jobs. use operating system specific one, eg. crontab in uniw evnironments.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MULTIPLE DATE QUERY 15 91
create a nested synonym 4 28
Read XML values 8 42
Oracle create type table from existing table%rowtype ? 6 35
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 video shows how to recover a database from a user managed backup

856 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