First, I am creating an executable job:
BEGIN
DBMS_SCHEDULER.CREATE_JOB(job_name => 'PIPE_JOB', job_type => 'EXECUTABLE', job_action => 'RMAN PIPE TEST_PIPE_1 target / TIMEOUT = 60');
END;
Next, I am trying to execute the job with this series of Oracle commands:
DECLARE
pipename CONSTANT VARCHAR2(100) := 'TEST_PIPE_1';
create_result INTEGER;
send_result INTEGER;
BEGIN
create_result := DBMS_PIPE.CREATE_PIPE(pipename);
DBMS_PIPE.PACK_MESSAGE('BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DEVICE TYPE DISK DATABASE INCLUDE CURRENT CONTROLFILE;');
send_result := DBMS_PIPE.SEND_MESSAGE(pipename);
DBMS_SCHEDULER.RUN_JOB(job_name => 'PIPE_JOB', use_current_session => false);
END;
Now, when I make the call to RUN_JOB, the RMAN executable fires up on the server, but then immediately exits, presumably because it never receives the commands that I am attempting to pack into the pipe.
How can I use pipes correctly to make RMAN receive the commands I am trying to send it?