There are a number of methods available within Oracle to shell out of the database and call an operating system script.
Java running inside the database has an access to a command, which will shell out and call an operating system script. This requires Java to be installed in the database (not available with Oracle XE). The Java program sets up environment variables and eventually invokes a routine, which performs the shell process.
final Process p = doexec(command, osexecEnv, osworkDir);
The schema running the Java program might need additional privileges to run commands (see
dbms_java.grant_permission for more information).
For more information on this, including the methods outlined, refer to http://www.oracle.com/technetwork/database/enterprise-edition/calling-shell-commands-from-plsql-1-1-129519.pdf ...