Amanda-Users

Re: backup Oracle DB at AMANDA server

2005-03-04 10:09:31
Subject: Re: backup Oracle DB at AMANDA server
From: Bert_De_Ridder AT peopleware DOT be
To: Jack$on <jackson AT ukrcard.com DOT ua>
Date: Fri, 4 Mar 2005 13:39:19 +0100

Build amanda with this parameter :

--with-gnutar=/bin/amandatar

In this /bin/amandatar you can do something like this :
( I know this perl code is probably awful coding, but it works)



#!/usr/bin/perl

use Getopt::Long qw(:config pass_through);

$result = GetOptions (
 'directory=s' => \$dir,
 'file=s' => \$file
);


if ( $file ne '/dev/null' )
{
  if ( $dir eq '/your/oracle/dir' )
  {
    system "echo 'Start backup oracle at ' >> /var/lib/amanda/runtime" ;
    system "date >> /var/lib/amanda/runtime";
    system ( "command to stop oracle  >> /var/lib/amanda/runtime" );
  }
}

# reconstruct command line
while ( $ARGV[0] ne '' )
{
  $val = $ARGV[0] ;
  unshift ( @NEWARGV, $val, ) ;
  shift @ARGV;
}

while ( $NEWARGV[0] ne '' )
{
  $val = $NEWARGV[0] ;
  unshift ( @ARGV, $val ) ;
  shift @NEWARGV;
}

if ( $dir ne '' )
{
  unshift ( @ARGV, '--directory', $dir );
}
if ( $file ne '' )
{
  unshift ( @ARGV, '--file', $file );
}

if ( $file ne '/dev/null' )
{
  system "echo 'Backing up directory ' $dir >> /var/lib/amanda/runtime" ;
}

unshift ( @ARGV , "/bin/tar" ) ;

system ( @ARGV ) ;

# postprocessing
#
if ( $file ne '/dev/null' )
{
  if ( $dir eq '/your/oracle/dir' )
  {
    system ( "command to start oracle >> /var/lib/amanda/runtime" );
    system "echo 'End backup oracle at ' >> /var/lib/amanda/runtime" ;
    system "date >> /var/lib/amanda/runtime";
  }
}

exit 0;


I don't even take credit for this solution; all credits should go to Paul Bijnens - also on this list.

(alles kits, Paul ? ;-)  )






Kind regards,



Bert De Ridder

PeopleWare NV - Head Office

Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66


PeopleWare NV - Branch Office Geel

Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25


http://www.peopleware.be
http://www.mobileware.be


Jack$on <jackson AT ukrcard.com DOT ua>
Sent by: owner-amanda-users AT amanda DOT org

04/03/2005 13:27
Please respond to
Jack$on <jackson AT ukrcard.com DOT ua>

To
amanda-users AT amanda DOT org
cc
Subject
backup Oracle DB at AMANDA server





Hello amanda-users,

 I have configured AMANDA Server, my daily & weekly backups from my
 servers working successful...
 but I wonna backup My Oracle Database by The AMANDA.
 previously, i must do export of DB, or stop Oracle Database...
 only after this i may backup my Database files, or export files...
 but how i can synchronize my export procedure & amanda backup?

 PS I'm sorry for my bad English...
 
--
Best regards,
Jack$on                          mailto:jackson AT ukrcard.com DOT ua