Re: Backup Oracle
Rebecca Pakish Crum wrote: I use amanda to back up oracle. Basically I backup the cold backups that oracle does on it's own. I've restored from it as well. It's clean. I've never tried to just back up individual tables. In my opinion, oracle wouldn't restore cleanly that way no matter what was backing it up. Oracle likes to restore from it's own backups. I have also just set up a backup of an Oracle webserver with amanda. I'm using the script that comes with the book Unix Backup & Recovery. It does the backup in one directory, then I use amanda to send all the partitions to tape ( but the one with the Oracle live tables). I think that the script can be found out there. It's oraback.sh -Original Message- From: Aline [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 6:42 AM To: [EMAIL PROTECTED] Subject: Backup Oracle Hi, I would like to use the Amanda Software in order to make backup of some oracle's tables. Is it possible? Is it good?
RE: Backup Oracle
I use amanda to back up oracle. Basically I backup the cold backups that oracle does on it's own. I've restored from it as well. It's clean. I've never tried to just back up individual tables. In my opinion, oracle wouldn't restore cleanly that way no matter what was backing it up. Oracle likes to restore from it's own backups. -Original Message- From: Aline [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 6:42 AM To: [EMAIL PROTECTED] Subject: Backup Oracle Hi, I would like to use the Amanda Software in order to make backup of some oracle's tables. Is it possible? Is it good? Thanks, Aline __ E-mail Premium BOL Antivírus, anti-spam e até 100 MB de espaço. Assine já! http://email.bol.com.br/
Re: Backup Oracle
>I would like to use the Amanda Software in order to make >backup of some oracle's tables. Is it possible? Is it >good? We back up several Oracle databases (and have even had to restore :-). The trick is to run a script just before the amdump run that: - for each tablespace in the database - identify all datafiles belonging to that tablespace - set the tablespace to backup mode - copy the datafiles to the backup location - set the tablespace to regular mode - switch the log file so any changes made during backup get archived - back up the control file The files are written to a large separate partition that is what Amanda is actually told to back up. The scripts, etc, are here: ftp://gandalf.cc.purdue.edu/pub/amanda/dbbackup.* >Aline John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]
Re: Backup Oracle
John R. Jackson on Sat 25/01 12:47 -0500: > >I would like to use the Amanda Software in order to make > >backup of some oracle's tables. Is it possible? Is it > >good? > > We back up several Oracle databases (and have even had to restore :-). > The trick is to run a script just before the amdump run that: It seems to also work to take do a fs or device snapshot before the backup. I.e. it's the same as hitting the power button on a running Oracle server...any bogus transactions are rolled back by Oracle if needed.
Re: 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? Via crontab. Write a script that stops Oracle, backs up and then run amdump. That's what we do. > > PS I'm sorry for my bad English... > > -- > Best regards, > Jack$on mailto:[EMAIL PROTECTED] > > -- Kind Regards, Gavin Henry. Managing Director. T +44 (0) 1224 279484 M +44 (0) 7930 323266 F +44 (0) 1224 742001 E [EMAIL PROTECTED] Open Source. Open Solutions(tm). http://www.suretecsystems.com/
Re: backup Oracle DB at AMANDA server
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 <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 04/03/2005 13:27 Please respond to Jack$on <[EMAIL PROTECTED]> To amanda-users@amanda.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:[EMAIL PROTECTED]
Re: backup Oracle DB at AMANDA server
Jon LaBadie wrote: Sorry to ride on Bert's posting, but I don't have a copy of the original. I didn't see the original either, so I jump on too. my Oracle developers & users don't allow me stop Oracle DB :(. now, I make hot backup of Oracle DataBase, then backup files write to the local tape. It seems, thet i can't stop DB, & use your nicely solution :(. Last time I looked at doing backups of Oracle (Ora 6-7-8), I approached it as follows: first set each tablespace in hot backup mode (alter tablespace TS begin backup) then doing a filesystem backup of all the directories with datafiles, using plain amanda DLE's, then setting each tablespace out of hot backup mode, (alter tablespace TS end backup); then force a redo log switch (alter system switch logfile) and then doing a backup of the archived redologs. No need to stop the database at all. The dirty trick with amanda here is getting the archived redo logs done after the rest. That is difficult, because the datafiles are spread over different DLE's, and, as another thread this week already explained, you can't very well specify an order for the DLE's in amanda. My solution was to mirror the archived redologs to a different machine. Having a tapebackup of datafiles + archived redologs on two different machines was enough to restore the database. That mirror was kept up to date during daytime too. To be really sure, I did a full export too (also nice to restore a single table if needed). Is Oracle 9-10 any different for "hot backup mode" (i.e. more complicated than it need to be?). Another bad news -- this hot backup finished very closed to start of work day -- i can't run amdump at estimated time, because i have at I think I don't understand this sentence "i can't run amdump at estimated time". Can you elaborate on this? -- Paul Bijnens, XplanationTel +32 16 397.511 Technologielaan 21 bus 2, B-3001 Leuven, BELGIUMFax +32 16 397.512 http://www.xplanation.com/ email: [EMAIL PROTECTED] *** * I think I've got the hang of it now: exit, ^D, ^C, ^\, ^Z, ^Q, F6, * * quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, * * stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt, abort, hangup, * * PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e, kill -1 $$, shutdown, * * kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ...* * ... "Are you sure?" ... YES ... Phew ... I'm out * ***
Re: backup Oracle DB at AMANDA server
On Fri, Mar 04, 2005 at 06:07:19PM +0100, Paul Bijnens wrote: > Last time I looked at doing backups of Oracle (Ora 6-7-8), I > approached it as follows: first set each tablespace in hot backup mode > (alter tablespace TS begin backup) then doing a filesystem backup > of all the directories with datafiles, using plain amanda DLE's, > then setting each tablespace out of hot backup mode, (alter > tablespace TS end backup); then force a redo log switch (alter > system switch logfile) and then doing a backup of the archived redologs. > Ouch. If that database is seeing any signifigant activity during the backup, you're going to be generating *alot* of redo with that approach. Putting the whole database in backup mode at once is typically frowned upon unless you're using something like mirror splitting or snapshots so you can turn backup mode off after a few seconds. > Is Oracle 9-10 any different for "hot backup mode" (i.e. more > complicated than it need to be?). Not that I'm aware of. alter tablespace begin backup is still there, and reportedly they've added an alter database begin backup to put all tablespaces in backup mode at once for the snapshot crowd. RMAN is, however, the preferred backup method these days - it's typically much faster than copying the datafile, either cold or in backup mode, and doesn't cause the database to generate additional redo the way backup mode does. Currently, I run RMAN backups of our databases to disk, and let Amanda pick up both the RMAN output and the archive logs. I keep the last three RMAN runs around, plus all archive logs that RMAN hasn't backed up at least 3 times. That way, even if the Amanda run overlaps the RMAN run and a disaster occurs before the next time Amanda runs, I can still restore from the previous RMAN run + archive logs. Unfortunately, this doesn't scale too well, since you need anywhere from 2-3 times as much space for the RMAN output as your database + archive logs require (and I've got nearly as much space taken by archive logs as I have datafiles). For larger databases, I be inclined to go the alter database begin backup + snapshot route.
Re: backup Oracle DB at AMANDA server
Hi, Paul, on Freitag, 04. März 2005 at 18:07 you wrote to amanda-users: PB> Last time I looked at doing backups of Oracle (Ora 6-7-8), I PB> approached it as follows: first set each tablespace in hot backup mode PB> (alter tablespace TS begin backup) then doing a filesystem backup PB> of all the directories with datafiles, using plain amanda DLE's, PB> then setting each tablespace out of hot backup mode, (alter PB> tablespace TS end backup); then force a redo log switch (alter PB> system switch logfile) and then doing a backup of the archived redologs. PB> No need to stop the database at all. PB> The dirty trick with amanda here is getting the archived redo logs done PB> after the rest. That is difficult, because the datafiles PB> are spread over different DLE's, and, as another thread this week PB> already explained, you can't very well specify an order for the DLE's PB> in amanda. My solution was to mirror the archived redologs to a PB> different machine. Having a tapebackup of datafiles + archived redologs PB> on two different machines was enough to restore the database. That PB> mirror was kept up to date during daytime too. PB> To be really sure, I did a full export too (also nice to restore a PB> single table if needed). PB> Is Oracle 9-10 any different for "hot backup mode" (i.e. more PB> complicated than it need to be?). Paul, Bert, and anyone else: Could anyone of you imagine writing a small "Howto back up Oracle dbs" for the docs? -- best regards, Stefan Stefan G. Weichinger mailto:[EMAIL PROTECTED]
Re: backup Oracle DB at AMANDA server
Mike Delaney wrote: On Fri, Mar 04, 2005 at 06:07:19PM +0100, Paul Bijnens wrote: Last time I looked at doing backups of Oracle (Ora 6-7-8), I approached it as follows: first set each tablespace in hot backup mode (alter tablespace TS begin backup) then doing a filesystem backup of all the directories with datafiles, using plain amanda DLE's, then setting each tablespace out of hot backup mode, (alter tablespace TS end backup); then force a redo log switch (alter system switch logfile) and then doing a backup of the archived redologs. Ouch. If that database is seeing any signifigant activity during the backup, you're going to be generating *alot* of redo with that approach. Putting the whole database in backup mode at once is typically frowned upon unless you're using something like mirror splitting or snapshots so you can turn backup mode off after a few seconds. That's why you do it during the night... And on Solaris I do use snapshots, which takes indeed a few seconds only, for all the DLE's, not only the oracle datafiles. Never "File changed while reading" messages anymore. A pitty snapshots on Linux LVM2 does not work (yet). On some older systems still running a 2.4.18 kernel and LVM1, I use snapshots too (and MySQL instead of Oracle: a magnitude or two less in footprint, and still suitable for the tasks I need.) Is Oracle 9-10 any different for "hot backup mode" (i.e. more complicated than it need to be?). Not that I'm aware of. alter tablespace begin backup is still there, and reportedly they've added an alter database begin backup to put all tablespaces in backup mode at once for the snapshot crowd. RMAN is, however, the preferred backup method these days - it's typically much faster than copying the datafile, either cold or in backup mode, and doesn't cause the database to generate additional redo the way backup mode does. Need to study again, I see... Currently, I run RMAN backups of our databases to disk, and let Amanda pick up both the RMAN output and the archive logs. I keep the last three RMAN runs around, plus all archive logs that RMAN hasn't backed up at least 3 times. That way, even if the Amanda run overlaps the RMAN run and a disaster occurs before the next time Amanda runs, I can still restore from the previous RMAN run + archive logs. Unfortunately, this doesn't scale too well, since you need anywhere from 2-3 times as much space for the RMAN output as your database + archive logs require (and I've got nearly as much space taken by archive logs as I have datafiles). For larger databases, I be inclined to go the alter database begin backup + snapshot route. -- Paul Bijnens, XplanationTel +32 16 397.511 Technologielaan 21 bus 2, B-3001 Leuven, BELGIUMFax +32 16 397.512 http://www.xplanation.com/ email: [EMAIL PROTECTED] *** * I think I've got the hang of it now: exit, ^D, ^C, ^\, ^Z, ^Q, F6, * * quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, * * stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt, abort, hangup, * * PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e, kill -1 $$, shutdown, * * kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ...* * ... "Are you sure?" ... YES ... Phew ... I'm out * ***
Re: backup Oracle DB at AMANDA server
Paul Bijnens wrote: Mike Delaney wrote: On Fri, Mar 04, 2005 at 06:07:19PM +0100, Paul Bijnens wrote: Last time I looked at doing backups of Oracle (Ora 6-7-8), I approached it as follows: first set each tablespace in hot backup mode (alter tablespace TS begin backup) then doing a filesystem backup of all the directories with datafiles, using plain amanda DLE's, then setting each tablespace out of hot backup mode, (alter tablespace TS end backup); then force a redo log switch (alter system switch logfile) and then doing a backup of the archived redologs. Ouch. If that database is seeing any signifigant activity during the backup, you're going to be generating *alot* of redo with that approach. Putting the whole database in backup mode at once is typically frowned upon unless you're using something like mirror splitting or snapshots so you can turn backup mode off after a few seconds. That's why you do it during the night... And on Solaris I do use snapshots, which takes indeed a few seconds only, for all the DLE's, not only the oracle datafiles. Never "File changed while reading" messages anymore. A pitty snapshots on Linux LVM2 does not work (yet). On some older systems still running a 2.4.18 kernel and LVM1, I use snapshots too (and MySQL instead of Oracle: a magnitude or two less in footprint, and still suitable for the tasks I need.) It has been working for me for atleast 3 months now.. I had a couple of oopses at first but they were apparantly fixed in later kernels. /Andreas
Re: backup Oracle DB at AMANDA server
Jack$on wrote: hi. Thankx to everyone! currently I'm recompile my amanda, with my tar script. shutdown/startup schema good working & now I'm replace start/shop of my Oracle DB to a switching DB in & switching out hot backup mode... I'm reconfigure my Oracle DB, & change archive_log_dest to another partition (may be to another server), and try backup redo logs with starttime param in dumptype. I think, that if I backup redo logs with estimated delay (2 or 3 hours) all must works correctly... i think... :) not sure what version of Oracle you use but here we use 8.1.7.4 and 9.2.0.4 all on Linux. To backup i simply backup the DB using RMAN and backup to a directory on the local oracle server. I then use Amanda to backup that directory and so i get control files, datafiles etc all in the RMAN backup. This works fine as i can't stop my db's either as we are a 24x7 shop thanks