Solved

oracle shell script job

Posted on 2007-04-04
6
457 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.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
oracle 10G 5 48
Oracle SQL Syntax 8 56
Oracle -- identify blocking session 24 22
Oracle - Stored Procedure Privilge access 3 22
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
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 how to recover a database from a user managed backup
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

707 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

20 Experts available now in Live!

Get 1:1 Help Now