PL/SQL (MOSC)

MOSC Banner

How to call unix shell script from plsql schedule job

edited Oct 18, 2018 5:00AM in PL/SQL (MOSC) 6 commentsAnswered
 Hi,

Can someone help me to find easy of calling unix shell script from PLSQL.

Here is the scenario:

ORACLE DATABASE VERSION : 11.1.0.7
OPERATING SYSTEM: RED HAT LINUX 64 BIT

I have plsql scheduled job which export the schema using plsql script. This jobs works fine and backup is being written on the required location.

my_plsql_backup_script:
==================
DECLARE
   h1   NUMBER;
 BEGIN
   h1 :=
      DBMS_DATAPUMP.
      open (
         operation   => 'EXPORT',
         job_mode    => 'SCHEMA',
         job_name    => 'BACKUPMYDB'
                       || TO_CHAR (SYSDATE, 'dd-mm-yyyyhh24miss'),
         version     => 'COMPATIBLE');
   DBMS_DATAPUMP.set_parallel (handle => h1, degree => 1);
   DBMS_DATAPUMP.
   add_file (
      handle      => h1,
      filename    =>   'MYDBExport'
                    || TO_CHAR (SYSDATE, 'dd-mm-yyyyhh24miss')

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center