Calling Shell script activity in Oracle Workflow.?
Hi,
I am using Oracle Workflow for executing OWB Mappings.
I also defined user defined activities to call shell scripts. It is working fine
But whenver the shell script executes for more than one day, work flow is not proceeding further even though, the shell script execution completed.
I have to manually skip that activity as success.
Did anyone face this type of problem?
Thanks in advance.
Thank you,
Regards,
Gowtham Sen.
Hi Matt,
I have seen your previous replies to the posts.
I think, the problem which I am getting is may be with TIMEOUT. Once the day crosses, the even the shell activity is completed, the workflow is not recognizing its completion.
I am using Oracle Warehouse builder. In I am using process flow editor to create workflows.
I verified for the options of changing timeouts. I couldnot able to get any.
Could you please help me, How I could set those values in backend.
Thanks in advance.
Thank you,
Regards,
Gowtham Sen.
Similar Messages
-
Calling shell scripts from within Oracle PL/SQL codes
Hello,
We are migrating from informix to Oracle. In our Informix Stored Procedure we
were able to call Unix Shell Script by executing a 'SYSTEM' command, such as:
CREATE PROCEDURE magazine(flag1, flag2)
SYSTEM '/pics2/informix/mag.sh' || flag1 || flag2;
END PROCEDURE;
How can I write this in PL/SQL? Is there a simillar command for 'SYSTEM' in PL/SQL?
ThanksMike,
Wrong forum, for this question, suggest you ask it in the PL/SQL forum.
Jim Stern -
Calling Shell Scripts in Business Workflow and Guided Procedures
Hi *,
is it possible to call shell scripts in business workflow and guided procedures? would need further documentation (how to, blog,...) about this issue.
Thx in advance,
Rene.Hello,
Workflows consist of tasks.
A task executed an object's method.
Methods are written in ABAP.
In the method you can code whatever you like, including code to execute shellscripts.
How to do this is not really a workflow question, I would suggest asking in an ABAP forum on how to write a function module to do this in a pure ABAP context. Then it's just a matter of inserting it into a method for use in your WF.
Cheers,
Mike -
Can we call shell script from oracle 9i?
Hi experts,
I wanted to know can we call shell script from oracle 9i procedures? If yes,how
Thanks
ShaanNo. I can't think of a way to do this...
If you want you can use DBMS_SCHEDULER to call OS SHELL scripts within.
For e.g.
CREATE PROGRAM
begin
dbms_scheduler.create_program
program_name => 'CHECK_TIME',
program_type => 'EXECUTABLE',
program_action => '/opt/oracle/chk_date.sh',
enabled => TRUE,
comments => 'Check the Time'
end;
CREATE A SHELL SCRIPT
opt/oracle> cat chk_date.sh
#!/usr/bin/ksh
echo "The date is :`date`"
CREATE SCHEDULE
begin
dbms_scheduler.create_schedule
schedule_name => 'EVERY_30_MINS',
repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
comments => 'Every 30-mins'
end;
CREATE JOB
begin
dbms_scheduler.create_job
job_name => 'RUN_CHECK_TIME',
program_name => 'CHECK_TIME',
schedule_name => 'EVERY_30_MINS',
comments => 'Run the program CHECK_TIME every 30 minutes',
enabled => TRUE
end;
MANUALLY RUN A JOB
exec dbms_scheduler.run_job('RUN_CHECK_TIME'); -
Call a UNIX shell script from an oracle stored procedure
We need to call a UNIX shell script from an oracle stored procedure
i.e. the control should come back to the procedure once the script completes. Can any body help to achieve this ?There are various ways in achieving this.
For Example, you can call a PRO*C-Library residing on the database server.
This requires a PL/SQL library to be generated and some changes to the Listener configuration.
It is also possible to implement a java procedure on the database being invoked by a PL/SQL wrapper class.
In this way (and if used right) there is also granularity regarding the filestructure permissions given and it may be called during a Forms or other PL/SQL session.
The article below explains a more generic approach how to invoke shell commands from within an Oracle Instance.
Be careful with this, because it really works ;)
Refer to :
http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
Message was edited by:
user434854 -
Need to call Shell script that uses SQL loader in APex4.1/11g
Hi there!
I have a requirement, wherein I have to call a shell script that connects to an external server, ftp's a file in and then uses sqlloader to load data into our table. Now we have the ftp script that does this for another program, but is a scheduled job. I wanted to call the ftp shell script from within APEX. Any suggestions on how this can be done, what PL/SQL logic can we use? I see online some people using dbms scheduler for this?
Thank you
SunHi,
Create some sh script on your oracle host machine where you can join into external server and run the process.
something like:
run_external_sh.sh
#!/bin/sh
ssh ext_user@ext_host ./sqlloader/import/import.shThen create a external JOB to call it via ORACLE(PL/SQL)
-- Call Shell Script.
BEGIN
DBMS_SCHEDULER.create_program (
program_name => 'external_call_sh',
program_type => 'EXECUTABLE',
program_action => '/local_host/call_external/sh/run_external_sh.sh',
number_of_arguments => 0,
enabled => TRUE,
comments => 'Call external SH script');
END;
/Now you can create a scheduled/or not scheduled JOB
-- Job defined by an existing program and schedule.
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'jb_external_call_sh',
program_name => 'external_call_sh',
schedule_name => 'external_call_scheduler', -- created scheduler
enabled => TRUE,
comments => 'Job defined by an existing external_call_sh program and schedule.');
END;
/Now you can call the JOB in APEX in PL/SQL process.
BEGIN
-- Run job synchronously.
DBMS_SCHEDULER.run_job (job_name => 'jb_external_call_sh');
END;Regards
J :D -
Calling shell script from sql procedure
Hi gurus
Is it possible
1)to call a shell script from sql procedure
2)that shell script has to return one value
3)and again sql procedure(calling shell script) has to capture the return value.
please help me to write this scriptYou may NOT have EXECUTE privilege/ permissions on the DBMS_PIPE package. Check with your DBA.
Using DBMS_PIPE may not be that simple to implement. Just making a call to DBMS_PIPE procedure will not do anything. It will NOT trigger anything on the UNIX side.
. You will also need to :
1. Write a job (ie CRON) at UNIX side which will keep read the incoming pipe for new messages, Unpack the message and get the command to be executed at the UNIX side -- There will be a lot of work involved here + DBA presence/activity is also required.
As Justin has pointed out, try and use HOST command which is very simple or try and use Java.
Shailender Mehta -
Calling shell script from apex application
Please let me know if anyone has tried Calling shell script from apex application, it would be nice enough if you can share how you did it? Thanks
Hi,
Requirements
* CREATE JOB (10g Rel.1)
* CREATE EXTERNAL JOB (10g Rel.2 / 11g)
* EXECUTE on dbms_scheduler (granted to public by default)
Since Oracle 10.2.0.2 the commands are executed as user nobody.
Code:
--Create a Program for dbms_scheduler
exec DBMS_SCHEDULER.create_program('RDS2008','EXECUTABLE','c:\ WINDOWS\system32\cmd.exe /c echo 0wned >> c:\rds3.txt',0,TRUE);
--Create, execute and delete a Job for dbms_scheduler
exec DBMS_SCHEDULER.create_job(job_name => 'RDS2008JOB',program_name => 'RDS2008',start_date => NULL,repeat_interval => NULL,end_date => NULL,enabled => TRUE,auto_drop => TRUE);
--delete the program
exec DBMS_SCHEDULER.drop_program(PROGRAM_NAME => 'RDS2008');
--Purge the logfile for dbms_scheduler
exec DBMS_SCHEDULER.PURGE_LOG;
This is one way as suggested by Trent.
We can also achieve as follows.
http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm
Calling OS Commands from Plsql
I think the above solutions may useful to you.
Let me know if you are facing any problem.
Thanks and Regards
Maheswara -
Hi,
Please let me know how to call shell scripts from WDA
Thanks
Bala DuvvuriHi Bala
You can not call any client side funcitons using Web Dynpro ABAP, it is possible in BSP using JavaScript.
You can use Suspend and Resume Plugs to navigate to a BSP page and perform the shell script and return to WDA using Resume Plug.
http://help.sap.com/saphelp_nw04s/helpdata/en/45/19bf8c16f25d7ae10000000a11466f/frameset.htm
Now, you can use JavaScript to execute shell script:
http://www.itjungle.com/mpo/mpo052302-story01.html
Abhi -
How to call shell script from a pl/sql procedure
Hi all,
I am little bit new to plsql programming, i have a small problem as follows
I have to call a shell script from a pl/sql procedure ..
Please suggest me some methods in oracle 10g, which i could make use of to achieve my goal. also please tell me what are the constraints for those methods if any.
I already came across dbms_scheduler, but i have got a problem and its nor executing properly its exiting giving 255 error or saying that permission problem, but i have already given full access to my shell scripts.
Thanks in advance
Best Regards
SatyaHi,
Read this thread, perhaps is there your response :
Host...
Nicolas. -
Running shell scripts from within oracle. A big task is forgotten
Dear List,
I have some shell shell scripts which do some tasks on the linux OS level.
I am calling the Korn scripts using a java class, which in turn is being called from a PLSQL function.
All but one of the 10 script works fine. This is the script which does the most work, and takes on average 40 minutes usually.
Why does Oracle forget the running of the shell script? I wait in my PLSQL function for the return code, but it never comes. The scripts I have not written myself !
I look forward to your reply on this matter.
regards
BenHi
If you are using the Oracle database 10g, the new dbms_scheduler package allows you to run shell scripts. The dbms_scheduler.create_job procedure have one parameter called the job_action in which you specify the full path of the shell script.
I hope this will help -
Calling Unix-Script from within Oracle and store stdout/stderr in table
Hi,
What I want to do is:
1. Calling a UNIX script (e.g. hello.sh) (from inside the Database)
hello.sh
echo Hello World!
2. and get the stdout/stderr output back in my Database in a table (e.g. temp_back)
table temp_back
ID stdout stderr
1 Hello World!
I think Number 1 isnt a big problem, but how to get stdout back in DB?
Any solution?
I searched a bit in this Forum and found this Post.
re:Calling Host Command Through Database Procedures or Triggers
This may be what I am searching for, but cant access the Link
Since I am not really fit with UNIX and packages/procedures in Oracle it would be nice if you could post a very detailed answer.
(Please no java)
-What packages do I need? (heard DBMS_OUTPUT would be useful)
-example PL/SQL script
Thanks a lot!
Marcus
Environment:
Oracle 9.2.0 DBMarcus, if you opened the Java sandbox to access any o/s file, you can call any Unix command, shell script, or program, that the Oracle o/s user has exec privs on.
Just remember that there's a very basic Unix environment when you make the call - the settings in the .profile does not apply. Thus PATH for example is not set. When making the call make sure that the complete path is given. As for the environment, that is a problem as you cannot set that and make the call at the same time.
In that case it is much simpler to rather write a Unix shell script that does all for you. Set the environment. Run the command(s). Format output. Etc.
Then you call that Unix script, via Java, from SQL or PL/SQL. Treat the Unix scripts like the Unix-version of stored procedures for your Oracle application.
Some technical details. When you connect to Oracle, a Unix process services you. This can be either a dedicated server process (servicing only your Oracle session) or a shared server process (from the shared service pool of processes).
In either case, it is a Unix process running as a background process (thus detached from any tty device). PL/SQL and SQL are executed by this process. The Oracle JVM created by your session also lives in this process. When you therefore make o/s calls, these calls are made by this process.
Therefore you are limited to what this process can and can't do. E.g. it runs as the oracle o/s user and will fail on accessing paths and commands does the oracle user does not have privs on. Etc. -
Is there an adapter that i can use to do telnet and say call a shell script.
Is ther an adapter defined to do ssh instead of telnet.
The doc mentions that telnet adapter is available but could not find any documentation or example demos to use it. http://www.oracle.com/technology/products/integration/adapters/pdf/DS_AdapterLibrary.pdf
Can someone point me to some appropriate docs/demos/etc.
Thanks,http://www.iwaysoftware.com/pdf/tech_brief/Technical_Brief_5250.pdf
-
Calling Shell Script from BPEL
I hav a requirement of calling a shell script (.sh) from BPEL. Can anybody help me out....how can i achieve this?
For embedding Java:
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/java.htm#sthref1282
For Java:
http://forum.java.sun.com/thread.jspa?threadID=635568&messageID=3700440
try
String execString = "ls -all"
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(execString);
/* handle you process from here..
outputstreams, inputStreams and such
catch (Exception e)
e.printStackTrace()
} -
Calling shell script from stored procedure.
Hi Everybody,
Could anyone tell me how to call a shell script from a stored procedure.
Thanks,
VasuYou would need to write a Java stored procedure that calls out to the underlying operating system. Tom Kyte has an example of this here
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:952229840241
Make sure that you're very aware of the security implications here, however. Your commands will run as the Oracle user on the host operating system, which makes it possible that a coding error and/or an attacker could do something like delete or corrupt Oracle data files, so you'll probably want to harden the code substantially.
Justin
Maybe you are looking for
-
How can i connect my macbook air with lion os to a windows 7 pc
Hi I wondered if anyone could help me as i am new to apple pc's I have recently got a macbook air and i am trying to have file sharing with both pc's unfortunately whatever i try does no allow both pc's to see each other. If i try the connect to serv
-
Search option using a new small window in oracle forms using pl/sql
Hai Friend, Iam Navya Jeevan,regarding Oracle Forms and Reports Doubts. Our project is developed using Forms and Reports In Forms for triggers we are using Pl/SQl language. DOUBT IN a form we require an option like search button when we press the sea
-
Set session variables inside a page
Inside the page "form.cfm" I have this code: <form name="report" action="pagestatistic.cfm" method="post"> <INPUT name=ONE size=15 > <INPUT name=TWO size=15 > <input type="submit" value="Go ON"> </form> I would like to set session variable: ONE and T
-
Oracle EBS R12: E-Business Essentials
I plan to take the Oracle EBS R12: E-Business Essentials exam... is there any good way to study for this? Any online reference, pdf or cds anyone has used? Any info would be helpful, thanks. -J
-
Should one turn OFF a MacBook, or let SLEEP at night?
A friend just bought a MacBook. I have a PowerBook G4... I was told to turn it off at night... my friend has been keeping his new MacBook on SLEEP at night... I hear too much SLEEP can goof up the computer sometimes running programs, and I hear turni