0

For the last few Oracle versions, I've launched RMAN scripts via PL/SQL using "PA_UTIL.pr_ExecOsCommand". Now, I wonder, is there a more efficient way? I see some people are recommending to use PIPE, but I've haven't found a usable example so far. The information in https://web.stanford.edu/dept/itss/docs/oracle/10gR2/backup.102/b14191/rcmcnctg007.htm, gave me a start, but I still lack an example.

Eli Abramson
  • 119
  • 1
  • 11

1 Answers1

1

Use the scheduler. It can run OS commands.

$ cat >/tmp/test111.sh <<EOF
#!/bin/bash
echo Success > /tmp/test111.out
EOF
$ chmod +x /tmp/test111.sh
$ sqlplus system

SQL> begin
  dbms_scheduler.create_job(
    job_name=>'TEST_OS_EXEC_111',
    job_type=>'executable',
    job_action=>'/tmp/test111.sh',
    enabled=>TRUE
  );
end;
/
Connor McDonald
  • 10,418
  • 1
  • 11
  • 16
  • Connor, I'm already issuing direct OS commands, what I'm looking for is a way to launch RMAN scripts more natively. – Eli Abramson Feb 27 '18 at 10:42
  • You need to be on 12c for that. In that release, there is a new job type of BACKUP_SCRIPT which will allow you to run RMAN scripts – Connor McDonald Feb 28 '18 at 05:12