Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

oracle shell script job

Posted on 2007-04-04
6
Medium Priority
?
473 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
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

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 1500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

704 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