Solved

oracle shell script job

Posted on 2007-04-04
6
470 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
[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
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example, show how to take different types of Oracle backups using RMAN.
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

734 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