Hello everyone,

Iím glad to post on this forum for the first time .

I have ďstrangeĒ problem, and if you can, I would like to know your opinion.

Here is an introduction:

I execute a shell Script from Oracle (Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production on Linux) that will execute a batch, after that it send me a mail.

I use a Java Function that execute the Linux line command set as a string like this :
IDP.OSCommand_Run('bash /appl/portal/automation/boe/manageBO.sh
Here is the source of the function, itís not relevant:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "OSCommand" ASimport java.io.*;
PUBLIC class OSCommand{public static String Run(String Command){try{Runtime.getRuntime().exec(Command);
RETURN("0");
}catch (
EXCEPTION
e){System.out.println("Error running command: " + Command +"\n" + e.getMessage());
RETURN(e.getMessage());
}

CREATE OR REPLACE
FUNCTION OSCommand_Run(
Command IN STRING)2
RETURN VARCHAR2 IS3 LANGUAGE JAVA4 NAME 'OSCommand.Run(java.lang.String) return int';
/
I GRANT the following permission:
Execute dbms_java.grant_permission( 'SCOTT','SYS:java.io.FilePermission', '<>','execute');

execute dbms_java.grant_permission( 'SCOTT','SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '*' );

execute dbms_java.grant_permission( 'SCOTT','SYS:java.lang.RuntimePermission', 'readFileDescriptor', '*' );

I use this function in Packageís Procedure. When I execute the main from my package, it works without any problem, the mail is sent.

So far there isnít any problem.

Here is my dilemma:

I have a schedule job that calls the main of my package, the same as before.

My function isnít executed, I donít have my mail.

The other function of my main work, but only this function with the command line doesnít work, it only happens when I execute the main from a schedule job.

If someone knows why this java function isn't executed by a dbschedule job, please answer me.

Thank you for your support,

Miloslava