views:

481

answers:

4


can anybody help me in oracle10g in unix machine
I have a requirement to execute the unix command in procedure how can i do that
thanks in advance

+1  A: 

You can use the DBMS_SCHEDULER package from Oracle. There is also an open source set of packages for doing this. You can find those here.

mamboking
A: 

Hi,

I think you could use the DBMS_JAVA Package and the loadjava procedure, or call a Java (instead of PL/SQL) stored procedure that launches the unix command.

ATorras
Sorry. More info at: http://www.sc.ehu.es/siwebso/KZCC/Oracle_10g_Documentacion/java.101/b12021/dbms_java.htm#g638495
ATorras
A: 

If DBMS_SCHEDULER isn't enough for you and you need to run commands within the context of other PL/SQL code, then you will need to look into calling External Procedures.

DCookie
A: 
BEGIN
     DBMS_SCHEDULER.create_job(
    job_name        => 'SHELL_JOB',
    repeat_interval  => 'FREQ=DAILY; BYHOUR=2',
    job_type         => 'EXECUTABLE',
    job_action       => '/u01/app/oracle/admin/tools/shell_job.sh',
    enabled          => TRUE,
    comments         => 'Perform stuff'
);
END;
Brian