views:

523

answers:

2

Here's a good one for any Oracle gurus out there. I'm working on a web page that dynamically configures Oracle DB backup settings in a closed environment. Right now, I have everything set up to generate scheduled jobs that run pre-determined RMAN scripts that already exist on the Database server's disk. This works, but I want to go a step further.

Is there any way to create jobs with the scheduler that will run RMAN scripts which haven't first been written to disk? For example, is it possible to fire off an RMAN backup script directly from the scheduler by using a pipe of some sort? I've found some vague information on the RMAN Pipe Interface, but I can't see how I could create a private pipe, pack it with RMAN commands, and then feed it to RMAN all in one job run... Any thoughts would be very much appreciated.

A: 

In anything related to backup/restore of the database, I advise you to prefer OS's means to execute scheduled jobs (cron/at on unix, Scheduled tasks on Windows). The advantage is that they are independent from oracle instance and you can better handle cases when oracle instance is down or malfunctioning. The "RMAN pipe interface" is meant to be used together with operating system's shell, as well.

However, executing scripts directly from database is also possible: AskTom

Juraj
Well, I think the issue here is that the web server and the database server are often on different physical machines. This means that I can only schedule jobs on the web server, so it isn't very useful to use the OS's scheduler. I really feel like there is a way to get Pipes to work, but I just can't seem to get all the little pieces put together.
Raggedtoad
Fine, then please peruse the AskTom link in my answer, and rate whether it helped you.
Juraj
A: 

If you want to use DBMS_SCHEDULER then the script has to reside on the database server.
But if you install an Oracle client on the web server you can run RMAN from there and connect to the TARGET database. E.g.:

rman 'usr/pwd@conn_str AS SYSDBA' CMDFILE /home/www/db/backup-full.rman

In this case the script can reside on the web server.
Hope this helps.

Kamal