X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C24DBD1B545 for ; Fri, 21 Nov 2003 07:08:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 10612-07 for ; Fri, 21 Nov 2003 03:08:06 -0400 (AST) Received: from geulle01.xillion.nl (wc-146.r-195-35-166.essentkabel.com [195.35.166.146]) by svr1.postgresql.org (Postfix) with ESMTP id C1650D1B529 for ; Fri, 21 Nov 2003 03:08:03 -0400 (AST) Received: by geulle01.xillion.nl (Postfix, from userid 1001) id CBBD230727; Fri, 21 Nov 2003 08:05:47 +0100 (CET) Received: from lt02 (unknown [192.168.1.101]) by geulle01.xillion.nl (Postfix) with ESMTP id 6583430727; Fri, 21 Nov 2003 08:05:14 +0100 (CET) Reply-To: From: "Jean Huveneers" To: "'Oli Sennhauser'" Cc: Subject: Re: Backup/Recovery (BR) question Date: Fri, 21 Nov 2003 08:06:30 +0100 Message-ID: <001c01c3affd$fdc68b60$6501a8c0@farcourier.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001D_01C3B006.5F8AF360" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal In-Reply-To: <200311210154.33780.xzilla@users.sourceforge.net> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/378 X-Sequence-Number: 11365 This is a multi-part message in MIME format. ------=_NextPart_000_001D_01C3B006.5F8AF360 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, Hi, We do a back-up of our postgresql server by stopping it, takning a LVM snapshot starting te server again (< 10 seconds), than we write the snapshot to a tape. Works fine, and with your theory it should be able to take the snapshot without stopping postgresql. (to make the log replay work you at least need the log & db files from the exact same moment in time). See attached batch file (used with Redhat 9, LVM 1.0.7 and taper) Regards, Jean Huveneers Xillion ICT Solutions B.V. Marktplein 8 6243 BR Geulle The Netherlands tel: +31 (0)43 3659244 fax: +31 (0)43 3659249 gsm: +31 (0)6 456 44 357 www: www.xillion.nl > -----Original Message----- > From: Robert Treat [mailto:xzilla@users.sourceforge.net] > Sent: vrijdag 21 november 2003 7:55 > To: Oli Sennhauser > Cc: pgsql-admin@postgresql.org > Subject: Re: [ADMIN] Backup/Recovery (BR) question > > > On Thursday 20 November 2003 18:00, Oli Sennhauser wrote: > > Hello Robert > > > > >If you do // drop database "DB1" // the first database will drop, > > >though you might want to verify if it is really damaged. > > > > Oh sh....! It worked. Thanks. I am used to do the other way > around (from > > oracle). > > > > Do you have any idea to my second question? > > > > Q2: New situation: Why is it not a good idea to backup the database > > files of a cluster incl. all c_log and x_log (log files > last) to get a > > "physicaly hot backup". > > In principle it is the same situation like a server which > is crashing > > (not a once but during some time). After restoring, it > should do a redo > > and rollback automatically like after a crash. This methode > (physical > > hot backup) would increas backup and restore times dramatically. > > > > Essentially I think you're right, it should behave much like > a crashing > server. The main reason why people don't recommend it is > that (depending on > your os setup) there is the potential to lose data that has > been commited but > not actually written to disk. Note that you shouldn't get > corrupted data > from this, but in many cases losing data is just as bad so we > don't recomend > it. If you really want to do this, you should really either > shut down the > database or get LVM going. > > > Robert Treat > -- > Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL > > ---------------------------(end of > broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index > scan if your > joining column's datatypes do not match > > ------=_NextPart_000_001D_01C3B006.5F8AF360 Content-Type: application/octet-stream; name="startsnapshotbackup" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="startsnapshotbackup" #!/bin/bash DATUM=3D`date '+%a%d%B%Y'` COMMANDO=3D"taper -T st0 -U @fullbackupsnapshot +O -a -c 1 -t $DATUM" # stop services echo "Stopping Services for back-up" /etc/init.d/postgresql stop /etc/init.d/mysqld stop /etc/init.d/insightserver stop /etc/init.d/httpd stop /etc/init.d/sapdb74 stop /etc/init.d/nagios stop # maken snapshots echo "Taking snapshots..." /sbin/lvcreate -L1G -s -n bak_main /dev/main/main echo "/ Done" /sbin/lvcreate -L1G -s -n bak_var /dev/main/var echo "/var Done" /sbin/lvcreate -L1G -s -n bak_opt /dev/main/opt echo "/opt Done" /sbin/lvcreate -L1G -s -n bak_home /dev/main/home echo "/home Done" echo "Starting services post-snapshot..." /etc/init.d/nagios start /etc/init.d/sapdb74 start /etc/init.d/postgresql start /etc/init.d/mysqld start /etc/init.d/insightserver start /etc/init.d/httpd start echo "Mounting snapshots..." mount /dev/main/bak_main /mnt/backup -oro mount /dev/md0 /mnt/backup/boot mount /dev/main/bak_var /mnt/backup/var -oro mount /dev/main/bak_opt /mnt/backup/opt -oro mount /dev/main/bak_home /mnt/backup/home -oro echo "Running back-up..." UITVOEREN=3D`$COMMANDO` # echo "Unmounting snapshots..." umount /mnt/backup/boot umount /mnt/backup/opt umount /mnt/backup/home umount /mnt/backup/var umount /mnt/backup echo "Remove snapshots..." /sbin/lvremove -f /dev/main/bak_main /sbin/lvremove -f /dev/main/bak_var /sbin/lvremove -f /dev/main/bak_home /sbin/lvremove -f /dev/main/bak_opt #echo "Moving log file..."=20 #cp /root/taper_log /home/xillion/taper_log.txt #chown root.xillion /home/xillion/taper_log.txt #chmod 777 /home/xillion/taper_log.txt echo "Ready" ------=_NextPart_000_001D_01C3B006.5F8AF360--