Bacula-users

Re: [Bacula-users] Issue backing up Oracle database using Bacula

2010-06-29 10:42:26
Subject: Re: [Bacula-users] Issue backing up Oracle database using Bacula
From: "Mike Holden" <bacula AT mikeholden DOT org>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 29 Jun 2010 14:41:13 +0100
Mogaroy wrote:
> Thanks Mike,

No problem!!

> Will recheck the points you mentioned.Meanwhile, some searching has
> led me to feel that it has something to do with the PL/SQL script
> (runhotbackup.sql) which does the actual backup to local disk
> (/var/oracle/backup) in my case.
> The 'host' command which is used in the script to rsync the
> datafiles is not recognized by PL/SQL, and maybe that's causing it
> to throw the errors.
>
> http://www.orafaq.com/wiki/PL/SQL_FAQ
>
> To verify, I tried copying a single file, running the command
> manually from SQL prompt, and the file got copied successfully.
>
> But, since the author of the script has tested the whole thing
> successfully, I'm wondering if it indeed is the cause.
>
> I came upon an earlier thread where the author mentions about his
> article, and I'm following it up there as well hoping to find a
> solution:
>
> http://www.backupcentral.com/phpBB2/two-way-mirrors-of-external-mailing-lists-3/bacula-25/oracle-database-backup-question-79798/#337777

The hotbackup script doesn't use pl/sql to execute a host command.
What is does is create a text file containing a list of commands,
several of which are "host" statements. It then uses that generated
script as input into an sqlplus session to do the actual backup
commands.

Like I said earlier, if your commands and database files are stored
in different directories to where the original authore placed them,
you will need to modify the runhotbackup.sql script to put the
correct locations, as well as any of the other files that you copied
from that wiki entry at
http://wiki.bacula.org/doku.php?id=application_specific_backups:oracle_rdbms

In detail, the hotbackup script does the following steps:

creates a file called
/app/oracle/oradata/db1/scripts/hotbackupscript.sql, as defined in
the "spool" statement. This path must exist and be writeable to the
user. This script file will be written to incluse a number of
sqlplus statements, which are later executed using the line
beginning with "@" right at the bottom.

It then adds commands to do the following:

does an "rm" of /app/oracle/backup/*, so again this directory must
exist and be writeable.

Create a list of "ALTER DATABASE" statements to enter and exit hot
backup mode for the tablespace. For each tablespace, it also adds an
"host rsync" command into the file to do the backup copy to
/app/oracle/backup for each datafile in the current tablespace (a
tablespace may have several datafiles).

Finally, once this loop for tablespaces has completed, it adds
various other commands to backup controlfiles, handle archived
redologs etc.

So you see, pl/sql ISN'T running a "host" statement at all, sqlplus is!

Maybe if you told us exactly what changes tou made to the locations
from the original wiki, and what changes you made to the scripts we
may be able to spot what is wrong!

Can you run the hotbackup script directly in sqlplus using "@
runhotbackup.sql" from within sqlplus? If so, then the problem is
elsewhere, if not then error message sill help us diagnose the
problem further.
-- 
Mike Holden

http://www.by-ang.com - the place to shop
for all manner of hand crafted items,
including Jewellery, Greetings Cards and Gifts



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users