RE: ONTAPE as cron script (error)
Posted in 1997
Paul
Yes you can use compress. My original script used compress until I found =
that gzip was MUCH, MUCH better. Just replace gzip with compress in the =
script.
Also you would need to use split if the size of your **compressed** =
archive exceeds 2GB (Andreas correct me if I am wrong) because your Unix =
lseek will read only 2^31 bytes before returning -ve offsets. Based on =
some measurements of actual compressed sizes versus the actual size of =
the dbspace, I find that a compressed level 0 backup (for my data) never =
exceeds 20% of the total used raw disk space and level 1 and 2s never =
exceed 5%. I realize that this depends on your data and your load, but =
going by my data, I could have at least a 10 GB database before I needed =
to worry about splitting the file.
In case you still need your compressed archives split, then replace the =
line:
gzip - < $DUMPDIR/$bkdev >$DUMPDIR/$bkdev.gz &
with
gzip - | split -b512m < $DUMPDIR/$bkdev >$DUMPDIR/$bkdev.gz &
This will create files xaa, xab, etc (unless you specify a name in =
split) of 512MB each in the current directory, and nothing in the .gz =
file. You may have to put in extra code for maintaining these files, and =
restore will require some extra effort, by linking a TAPEDEV to each of =
these devices in turn.
HTH
Sujit
----------
From: mosserp@wellsfargo.com[SMTP:mosserp@wellsfargo.com]
Sent: Wednesday, November 19, 1997 3:50 PM
To: andreas.zeugswetter@telecom.at
Cc: informix-list@rmy.emory.edu
Subject: RE: ONTAPE as cron script (error) =20
Andreas,
This looks very promising to solve a big headache that we have right =
now!!
Environment:
-- DEC UNIX ver. 3.2G (soon migrating to 4.0b)
-- Informix ODS 7.20.UC3 (soon migrating to 7.23.FC4)
Currently, every week night we do a L0 archive to disk. Since the =
archive exceeds 2gig,
we have to use the following procedure (TAPEDEV set to =
/archive/archive.file, with size 2000000):
1) from first telnet session:
ln -s file1 /archive/archive.file
2) from second telnet session, start the:
ontape -s -L 03) when file1 reaches 2gig, ontape asks for the next "tape"; then =
switch back to first session:
rm /archive/archive.file
ln -s file2 /archive/archive.file
4) switch back to second session, and hit <CR> to continue the archive
Naturally, I want to automate this process. But I haven't been able to =
figure out how to script the two-session aspect.
Your comment below about "split -b512m" makes me think that there is a =
way around the 2 gig limit!!?? What exactly do I need to change in =
Sujit's script? What do I need to change in Tape parameters in =
onconfig? Any other changes needed anywhere (e.g., UNIX config)? Also, =
will the standard "compress" work in place of gzip (yes, I've used gzip =
at other sites, and I like it, but I'm not sure if our sys. admin. group =
would allow gzip to be installed).
Many, many TIA!
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
Paul Mosser, Open Systems DBA
Wells Fargo Bank
Tempe, Arizona, USA
mosserp@wellsfargo.com
----------
From: =
andreas.zeugswetter@telecom.at[SMTP:andreas.zeugswetter@telecom.at]
Reply To: andreas.zeugswetter@telecom.at
Sent: Wednesday, November 19, 1997 10:42 AM
To: informix-list@rmy.emory.edu
Subject: Re: ONTAPE as cron script (error) =20
Hi,
We use a very similar approach as you do and since you were so nice to
the community I would like to warn you of problems with your script.
kill -9 $bgpid
is very dangerous, since it could cut off some
pages from the end of the backup.
You need to replace the line with:
wait $bgpid
This will wait for gzip to finish after the pipe is closed
by ontape.
I also use split -b512m after the gzip, because our backups=20
are larger than 2 Gb.
We also use gzip --fast because it compresses nearly as good
and gives much better performance.
best regards
Andreas