Ronnie has asked for the wisdom of the Perl Monks concerning the following question:

Hi there inmates, I'm not sure how to proceed with setting up RMAN scripts in Perl. Our Oracle databases are to be backed up using RMAN - we have multiple Oracle databases and all are at 10g except for one which is at 9i but will be upgraded shortly. I have a lot of commands that I want to pass to RMAN and think I can do this using a SYSTEM call to the RMAN executable with a here document. We use an RMAN catalogue for all our databases. I want to write these scripts entirely in Perl and thought about using the DBI. I can connect to the RMAN database using the DBI but how do I pass a block of RMAN commands in? Can I prepare the block of commands via DBI and then execute them?

Replies are listed 'Best First'.
Re: Perl DBI & RMAN commands
by marto (Cardinal) on May 07, 2009 at 10:11 UTC
      I'm afraid so - I had no responses.
Re: Perl DBI & RMAN commands
by frieduck (Hermit) on May 07, 2009 at 13:21 UTC

    Your best bet is to use RMAN directly, as suggested by the responses to your previous post.

    If you really want to try via DBI, there's a dbms_backup_restore package that you can call. But, it's undocumented, which means unsupported and the API is likely to change between versions. I'd come up with a very good reason to not use RMAN before I'd try the DBI route.

Re: Perl DBI & RMAN commands
by bichonfrise74 (Vicar) on May 07, 2009 at 22:59 UTC
    I tend to agree with the other people here. I would rather use RMAN than develop something in Perl DBI. Oracle is a complicated database and RMAN is a proven technology for backing up the Oracle databases.