1 Reply Latest reply: Mar 12, 2014 4:24 AM by GregV RSS

    pl/sql

    Abhishek12991

      I am using apex 4.0.2 version,Actually i want to take export of my database by using this procedure....

      when i tried yhis procedure on windows machine,its working fine..

      but in ubuntu machine the database is not getting exported,please help

       

      created a folder in /home/srl----export

      under export created two folders dump and log

       

      create or replace procedure run_export

      as

      begin

      DBMS_SCHEDULER.CREATE_JOB(job_name=> 'export',

      JOB_TYPE=>'EXECUTABLE',

      JOB_ACTION=> 'exp tvm/tvm file=/home/srl/export/dump/backup'||'_'||to_char(sysdate,'DDMMYYHHMI')||'.dmp log=/home/srl/export/log/backup'||'_'||to_char(sysdate,'DDMMYYHHMI')||'.log',

      enabled         => TRUE,

      auto_drop       => TRUE);

      end;

      /

       

      grant execute on run_export to tvm;

        • 1. Re: pl/sql
          GregV

          Hi Abhishek,

           

          Instead of always creating the same job that auto drops, you should create this job once for all and run it whenever you need.

          To do so, create it as disabled with auto_drop=FALSE, and to run it just call the dbms_scheduler.run_job procedure.

          Something like:

           

          BEGIN

          DBMS_SCHEDULER.CREATE_JOB(job_name   => 'export',

                                    JOB_TYPE   =>'EXECUTABLE',

                                    JOB_ACTION => 'exp tvm/tvm file=/home/srl/export/dump/backup'||'_'||to_char(sysdate,'DDMMYYHHMI')||'.dmp log=/home/srl/export/log/backup'||'_'||to_char(sysdate,'DDMMYYHHMI')||'.log',

                                    enabled    => FALSE,

                                    auto_drop  => FALSE

                                   );

          END;

          /

           

          The 'export' job will peacefully stay as disabled. Whenever you need to run it, just call the run_job procedure:

           

          CREATE OR REPLACE PROCEDURE run_export

          AS

            BEGIN

                 DBMS_SCHEDULER.run_job(job_name => 'export');

          END;

          /

           

          Now, about your export not working, do you get an error or nothing happens?

          Can you provide the output of the following query:

           

          SELECT job_name, STATUS, ADDITIONAL_INFO

          FROM user_scheduler_job_run_details  

          WHERE upper(job_name) = 'EXPORT'; 

           

          Thanks