Solved

oracle shell script job

Posted on 2007-04-04
6
464 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
case statement in where clause with not exist 15 52
Fastest way to replace data in Oracle 5 64
Export table into csv file in oracle 10 87
Oracle function to insert records? 15 42
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
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.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

810 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