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
Shaan

No. 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');

Similar Messages

  • Can I call host file ( Unix Shell script ) from Oracle 10g trigger

    Hi,
    I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
    thanks & regards
    parag

    user12009546 wrote:
    Hi,
    I am new to Oracle 10g. Can I call host file ( unix shell script ) from Oracle 10g trigger ?. I know it is possible. Pl explain me with small example
    thanks & regards
    paragIf you are in 10g, you can simple call shell script from DBMS_SCHEDULER:
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'TEST_SCRIPT',
    job_type => 'EXECUTABLE',
    job_action => 'PATH_OF_YOUR_SCRIPT',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
    enabled => TRUE,
    comments => 'Shell script from Oracle'
    END;
    /

  • 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

  • How to execucte/calll a shell script from oracle

    hi all
    i want to execute a shell script from oracle...... how do i do that can any one send me a good link which i can refer and learn
    or if any one has already implemented anything like this plz let me know the code
    Regards

    Here u goooooo
    http://www.experts-exchange.com/Database/Oracle/Q_21908413.html
    Regards,
    http://www.oracleracexpert.com
    Send email using UTL_MAIL in oracle.
    http://www.oracleracexpert.com/2009/11/send-email-using-utlmail-in-oracle-10g.html
    Migrate Non-ASM Database to ASM using RMAN
    http://www.oracleracexpert.com/2009/10/migrate-database-to-asm-using-rman.html]

  • Run Shell script from oracle plsql

    OS--> Linux
    Version--Oracle 10g
    I want to run a shell script from oracle PL/sql. I know dbms_scheduler can be used to create job , enable job and run it .
    But I have a requirement where I need to know if my script ran successfully or not. Something like a return code back to oracle.
    So that I can run appropriate code depending on return code of executed Script.
    Kindly help !!

    Online documentation was invented for a reason.
    And this reason was not would look it, as a volunteer, on your behalf, and post it in this forum.
    All procedures are documented. There are examples for most facitlities on Asktom, and there is Morgan's Library at [http://www.psoug.org]
    Sybrand Bakker
    Senior Oracle DBA

  • Need Example on calling a unix shell script from oracle stored procedure

    Hi
    Can anybody give example on how to call unix shell script from an Oracle stored procedure. Please give a small example on how to do this .I need this urgently please.
    Have a nice time.
    Thanks & Regards
    Jogesh

    If you are on 10g you can also use DBMS_SCHEDULER. See Re: Excute Unix command Using PL SQL

  • Calling unix shell script from oracle stored procedure.. urgent!!!!!!!!!!!!

    Hi,
    i havea requirement where in i should be able to call my shell script through oracle stored procedure.i tried the following way..but iam unable to get the result.please find the details below.
    new.sh - my shell script - lctfile (LCTFILE) is the input pa
    v_config_file=`find $FND_TOP -name LCTFILE
    FNDLOAD apps/s0ccer@$dxbs1 0 Y DOWNLOAD $v_config_file /home/bir4163/RPT33/bin/menu.ldt MENU MENU_NAME='AR_NAVIGATE_GUI'
    if [ $? != 0 ];then
    echo "$DATE $0 FNDLOAD DOWNLOAD Failed!" | tee -a $LOG_FILE
    else
    echo "SUCCESS" | tee -a $LOG_FILE
    fi
    CREATE OR REPLACE PROCEDURE test_dbms_scheduler
    AS
    v_text VARCHAR2 (255) := 'AR_NAVIGATE_GUI';
    BEGIN
    DBMS_OUTPUT.put_line ('I am in Procedure');
    DBMS_SCHEDULER.create_job (
    job_name => 'test_dbms_scheduler',
    job_action => '/home/bir4163/RPT33/bin/new.sh',
    number_of_arguments => 1,
    job_type => 'executable',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=SECONDLY; INTERVAL=1',
    enabled => FALSE,
    auto_drop => FALSE,
    comments => 'run shell script'
    DBMS_SCHEDULER.set_job_argument_value (job_name => 'test_dbms_scheduler',
    argument_position => 1,
    argument_value => v_text);
    DBMS_SCHEDULER.enable ('test_dbms_scheduler');
    DBMS_OUTPUT.put_line ('I am back in Procedure');
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line (SQLCODE || SQLERRM);
    END;
    But iam unable to test it as i do not have permissions to access dbms_scheduler.can anybody tell me how to solve this using DBMS_PIPE with a sample code.
    please do help its very urgent
    thanks
    ramya

    Hi,
    Register your Shell Script as a concurrent program, Executable execution method "Host", then use fnd_request.submit_request to submit the program.
    Regards,
    Andries

  • 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
    Satya

    Hi,
    Read this thread, perhaps is there your response :
    Host...
    Nicolas.

  • Call Shell Script from PL-SQL

    Hello All,
    I have been using some well known Java Class and Procedures to execute shell scripts from PL-SQL.
    The different environments I was using before were
    1)
    Operating System (Server) AIX version 5
    Oerating System(Client) Microsoft Windows XP Service Pack 2
    Oracle Database Version Oracle Database 10g Enterprise Edition Release
    10.2.0.1.0
    2)
    Operating System (Server) Red Hat Linux 3.4.5-2
    Oerating System(Client) Microsoft Windows XP Service Pack 2
    Oracle Database Version Oracle Database 10g Enterprise Edition Release
    10.2.0.1.0
    But suddenly I had to drop and recreate the Databases on 1st (AIX) environment
    and
    reinstall the Operating System (Server) Red Hat 3.4.5-2 on IInd environment stated above (which obviously means the reinstallation of Oracle Database there!)
    Now the shell script(through PL-SQL)is executing smoothly for the IInd (Linux) environment[b] but not executing for the Ist (AIX) environment
    and I am not getting how to solve the problem.
    I have given all the permissions to users, shell scripts and all as they were before.
    Can you please help?
    Regards,
    Abhijit.

    Hello All,
    I have been using some well known Java Class and Procedures to execute shell scripts from PL-SQL.
    The different environments I was using before were
    1)
    Operating System (Server) AIX version 5
    Oerating System(Client) Microsoft Windows XP Service Pack 2
    Oracle Database Version Oracle Database 10g Enterprise Edition Release
    10.2.0.1.0
    2)
    Operating System (Server) Red Hat Linux 3.4.5-2
    Oerating System(Client) Microsoft Windows XP Service Pack 2
    Oracle Database Version Oracle Database 10g Enterprise Edition Release
    10.2.0.1.0
    But suddenly I had to drop and recreate the Databases on 1st (AIX) environment
    and
    reinstall the Operating System (Server) Red Hat 3.4.5-2 on IInd environment stated above (which obviously means the reinstallation of Oracle Database there!)
    Now the shell script(through PL-SQL)is executing smoothly for the IInd (Linux) environment[b] but not executing for the Ist (AIX) environment
    and I am not getting how to solve the problem.
    I have given all the permissions to users, shell scripts and all as they were before.
    Can you please help?
    Regards,
    Abhijit.

  • Calling shell script from stored procedure.

    Hi Everybody,
    Could anyone tell me how to call a shell script from a stored procedure.
    Thanks,
    Vasu

    You 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

  • 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 script

    You 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 Java

    Hi i have a shell script which calls the ant command.How do i call this shell script from jdk 1.5. I used p = runtime.exec( filename) but it threw an IOException saying cannot execute. How do i call this from my java program which runs on the redhat linux box.Please Help

    Possibility:
    It does not have execute permissions - Either grant them by chmod or use the command as sh <script-name>
    Rich

  • 11g - calling shell script from trigger

    From what I read so far, starting from 11g onward user credential IS REQUIRED in order to call the shell script from database procedure/trigger.  I am working in a shop where they used SSO (so no password) and having a local user with password is not possible.
    I wonder if anyone used any other method to call the shell scripts from database procedure/trigger?
    Thanks all

    user550338 wrote:
    performance is not going to be a problem for this requirement b/c it ONLY happened after the startup or before the shutdown.
    That still -- even more so --- sounds like a bad idea.  Exactly what does this shell script accomplish that needs to be triggered by database startup/shutdown?

  • Calling shell script from forms9i

    Hi,
    I have a shell script that inserts records in the table. When I run this shell script in Unix, it runs fine and inserts records in the table.
    But when I run it from forms9i by using HOST command it does everything written in the shell script but inserting records in the table.
    Can anyone tell me why it is not inserting records in the table.
    I will really appreciate you response.
    Thanks,
    Kumar

    IMO when you run the shell script from forms it runs in privileges of App server user and in that shell that why its running as oraias when you run it from forms .. I think the SSO is out of picture in this situation.So you need to find a way of connecting to the in the script.
    Check the TNS names environment varaibles etc for doing this,

  • 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?
    Thanks

    Mike,
    Wrong forum, for this question, suggest you ask it in the PL/SQL forum.
    Jim Stern

Maybe you are looking for

  • Flash 8 Video Switch Issue

    I have a user with a dual monitor setup, and whenever he plays a flash media file, both screens go blank for a moment, then the left screen switches to 640x480, and the right monitor stays in its configured rez (1280x1024). Prior to running the flash

  • IPhone 3G and Outlook 2007

    I've googled around and found there was/is an issue with Syncing the Calendars between the phone and the PC. Is this still the case or has it been sorted out now? Can you save items to the phone from emails yet or is that still crippled? I had an iPh

  • IPhoto cannot be opened after upgrade to 9.3 in Lion

    After I upgraded to iPhoto 9.3, my iPhoto crashed as follow, appreciate if you could give advice on this. Thanks. Process:         iPhoto [1577] Path:            /Applications/iPhoto.app/Contents/MacOS/iPhoto Identifier:      com.apple.iPhoto Version

  • Powerbook g4 vs

    I am thinking of getting a new computer but there is nothing wrong with my powerbook g4. Can anyone advise? I was thinking of getting a new macbook or maybe getting the new iMac. or I could update the powerbook with leopard and get the new iMac. I do

  • Getting serial number if not original purchaser

    Hello...I'm hoping someone here can help me with a bit of a knotty problem... I purchased a used computer recently, a transaction which included the purchase of the copy of CS5 Design Premium on said computer. Being distracted at the time and just in