how to ontape to disk
Posted in 2008
User on AIX 5.3 / IDS 10 asked how to make ontape back up to disk files and automatically roll over to new volumes (vtape.1, vtape.2...) without an operator pressing Enter at the "change tape" prompt. Replies: set TAPEDEV to a disk file path (or STDIO, optionally piping through gzip); use 'expect' plus mv/touch to rename each file and answer the prompt if multi-volume is really needed. Art Kagel noted a large TAPESIZE wastes no space since only the data written is stored, and TAPESIZE=0 lets ontape write until the filesystem/file-size limit, avoiding prompts entirely. Others warned against TAPEDEV=STDIO in the ONCONFIG (use ontape -t STDIO instead) and noted IDS 11 allows TAPEDEV to be a directory. No confirmation from the original poster is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Hello:
Environment:
AIX 5.3
IDS 10 FC6
How to use "ontape" command to backup database to file(juse 1G), and
automatic change volume name like vtape.1, vtape.2, vtape.3 etc....
game me some support
With v10 you can set TAPEDEV in your $ONCONFIG to STDIO or a disk file name
(full path + file - e.g. /opt/informix/backup/tape). There is also a
TAPESIZE in which you can indicate whatever size you want. I'm not sure why
you would want to change "tapes" at 1GB. ontape will prompt you to change
tapes, I suppose you could use "expect" to watch for that, rename your
tapefile to something and then send a return to ontape - but I don't
understand why you would want to. It might make sense if you were backing
up 2TB of disk to a little 100GB drive and had to swap out occasionally.
But for that sort of thing you really should be using "onbar" and a storage
manager anyway. I would recommend reading the "Backup and Restore Guide".
Note, if you do use "expect", and TAPEDEV=file, you will always backup to
that file, you will need to move the backed up file out of the way (rename
it) and place a new "empty" file in it's place:
mv $INFORMIXDIR/backup/tape $INFORMIXDIR/backup/tape.$n
touch $INFORMIXDIR/backup/tape
n = n + 1
What you might also consider is backing up through a compression program.
Set TAPEDEV to STDIO and then "ontape -s -L 0 | gzip - > backup.gz" (doing
from memory, may have something off there). This will compress your backup
on the fly and make it take less space and run faster. It reduces I/O work
which is typically the bottleneck - but CPU will peak higher.
cheers
j.
Sane ego te vocavi. Forsitan capedictum tuum desit.
-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org]On Behalf Of spender@163.com
Sent: Monday, February 25, 2008 11:20 PM
To: informix-list@iiug.org
Subject: how to ontape to disk
Hello:
Environment:
AIX 5.3
IDS 10 FC6
How to use "ontape" command to backup database to file(juse 1G), and
automatic change volume name like vtape.1, vtape.2, vtape.3 etc....
game me some support
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
first thanks:
I want backup database use "ontape -s -L 0" to backup informix database to
disk.
but, If i set TAPEDEV too small, it will prompt user "press Enter to
continue...", and wait for input, (read key)
if I set TAPEDEV too big, it will squander too many disk spaces.
I make a NFS filesystem and mount it to : /home/informix/backup/ <--vtape
file.
I want use "ontape" to backup my database, it create 1G files(rationality),
and when ontape prompt me change tape, I must copy vtape to a new file, just
like: vtape.1, and then press <enter> to continue.,and go on ......etc
Question:
User must be a normal unix user, and can input shell command,
I wan't do it though program or shell scripts or "crontab", user only need
click mouse from web, and wait for user input <enter> not need, shell script
will copy vtape file to vtape.$n......
hehe. Chinese user, and opretor can't do any unix command. !!!!!
use STDIO as TAPEDEV, I never do it, try it later....
"Jack Parker" <jack.parker4@verizon.net> wrote in message
news:mailman.548.1204030072.20610.informix-list@iiug.org...
> With v10 you can set TAPEDEV in your $ONCONFIG to STDIO or a disk file
> name
> (full path + file - e.g. /opt/informix/backup/tape). There is also a
> TAPESIZE in which you can indicate whatever size you want. I'm not sure
> why
> you would want to change "tapes" at 1GB. ontape will prompt you to change
> tapes, I suppose you could use "expect" to watch for that, rename your
> tapefile to something and then send a return to ontape - but I don't
> understand why you would want to. It might make sense if you were backing
> up 2TB of disk to a little 100GB drive and had to swap out occasionally.
> But for that sort of thing you really should be using "onbar" and a
> storage
> manager anyway. I would recommend reading the "Backup and Restore Guide".
>
> Note, if you do use "expect", and TAPEDEV=file, you will always backup to
> that file, you will need to move the backed up file out of the way (rename
> it) and place a new "empty" file in it's place:
>
> mv $INFORMIXDIR/backup/tape $INFORMIXDIR/backup/tape.$n
> touch $INFORMIXDIR/backup/tape
> n = n + 1
>
> What you might also consider is backing up through a compression program.
> Set TAPEDEV to STDIO and then "ontape -s -L 0 | gzip - > backup.gz" (doing
> from memory, may have something off there). This will compress your
> backup
> on the fly and make it take less space and run faster. It reduces I/O
> work
> which is typically the bottleneck - but CPU will peak higher.
>
> cheers
> j.
>
> Sane ego te vocavi. Forsitan capedictum tuum desit.
>
> -----Original Message-----
> From: informix-list-bounces@iiug.org
> [mailto:informix-list-bounces@iiug.org]On Behalf Of spender@163.com
> Sent: Monday, February 25, 2008 11:20 PM
> To: informix-list@iiug.org
> Subject: how to ontape to disk
>
>
> Hello:
>
> Environment:
> AIX 5.3
> IDS 10 FC6
>
> How to use "ontape" command to backup database to file(juse 1G), and
> automatic change volume name like vtape.1, vtape.2, vtape.3 etc....
>
> game me some support
>
>
>
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
spender wrote:
First, setting TAPESIZE larger than you need will not waste disk. IDS
will not write out the full maximum size of the file to TAPESIZE in any
case, only the size actually needed rounded up to the next TAPEBLK
blocksize. However, if your OS can handle an archive file large enough
to hold all of your chunks and any physical log records written during
the archive period, then you can set TAPESIZE to zero (0) and ontape
will continue to write to the file until the filesystem fills up or the
OS returns a 'too large' error before prompting for a new tape file.
Art S. Kagel
Oninit
> first thanks:
>
> I want backup database use "ontape -s -L 0" to backup informix database to
> disk.
> but, If i set TAPEDEV too small, it will prompt user "press Enter to
> continue...", and wait for input, (read key)
> if I set TAPEDEV too big, it will squander too many disk spaces.
>
> I make a NFS filesystem and mount it to : /home/informix/backup/ <--vtape
> file.
> I want use "ontape" to backup my database, it create 1G files(rationality),
> and when ontape prompt me change tape, I must copy vtape to a new file, just
> like: vtape.1, and then press <enter> to continue.,and go on ......etc
>
> Question:
> User must be a normal unix user, and can input shell command,
> I wan't do it though program or shell scripts or "crontab", user only need
> click mouse from web, and wait for user input <enter> not need, shell script
> will copy vtape file to vtape.$n......
>
> hehe. Chinese user, and opretor can't do any unix command. !!!!!
>
> use STDIO as TAPEDEV, I never do it, try it later....
> "Jack Parker" <jack.parker4@verizon.net> wrote in message
> news:mailman.548.1204030072.20610.informix-list@iiug.org...
>
>> With v10 you can set TAPEDEV in your $ONCONFIG to STDIO or a disk file
>> name
>> (full path + file - e.g. /opt/informix/backup/tape). There is also a
>> TAPESIZE in which you can indicate whatever size you want. I'm not sure
>> why
>> you would want to change "tapes" at 1GB. ontape will prompt you to change
>> tapes, I suppose you could use "expect" to watch for that, rename your
>> tapefile to something and then send a return to ontape - but I don't
>> understand why you would want to. It might make sense if you were backing
>> up 2TB of disk to a little 100GB drive and had to swap out occasionally.
>> But for that sort of thing you really should be using "onbar" and a
>> storage
>> manager anyway. I would recommend reading the "Backup and Restore Guide".
>>
>> Note, if you do use "expect", and TAPEDEV=file, you will always backup to
>> that file, you will need to move the backed up file out of the way (rename
>> it) and place a new "empty" file in it's place:
>>
>> mv $INFORMIXDIR/backup/tape $INFORMIXDIR/backup/tape.$n
>> touch $INFORMIXDIR/backup/tape
>> n = n + 1
>>
>> What you might also consider is backing up through a compression program.
>> Set TAPEDEV to STDIO and then "ontape -s -L 0 | gzip - > backup.gz" (doing
>> from memory, may have something off there). This will compress your
>> backup
>> on the fly and make it take less space and run faster. It reduces I/O
>> work
>> which is typically the bottleneck - but CPU will peak higher.
>>
>> cheers
>> j.
>>
>> Sane ego te vocavi. Forsitan capedictum tuum desit.
>>
>> -----Original Message-----
>> From: informix-list-bounces@iiug.org
>> [mailto:informix-list-bounces@iiug.org]On Behalf Of spender@163.com
>> Sent: Monday, February 25, 2008 11:20 PM
>> To: informix-list@iiug.org
>> Subject: how to ontape to disk
>>
>>
>> Hello:
>>
>> Environment:
>> AIX 5.3
>> IDS 10 FC6
>>
>> How to use "ontape" command to backup database to file(juse 1G), and
>> automatic change volume name like vtape.1, vtape.2, vtape.3 etc....
>>
>> game me some support
>>
>>
>>
>>
>> _______________________________________________
>> Informix-list mailing list
>> Informix-list@iiug.org
>> http://www.iiug.org/mailman/listinfo/informix-list
>>
>>
>
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
> ===========================================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer:
>
> http://www.oninit.com/home/disclaimer.php
>
> ===========================================================================================
>
>
>
===========================================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.oninit.com/home/disclaimer.php
===========================================================================================
Humm,
Loads of bits of information here :
1. I would strongly NOT recommend setting TAPEDEV to STDIO.
Try it ... set TAPEDEV to STDIO and ... run ontape -s -L 0! Be quick if
you want to restore it :S. Use ontape -s -L 0 -t STDIO
Sort of thing that will catch you out late at night on a 9600 baud
connection!
2. Version 11 (I know) has the ability to have TAPEDEV set to a
directory, sort of "set and forget" ... obviously beware of full
filesystems etc. etc.
3. There are LOADS of scripts out there which will do "what you ask",
but ...
Art S. Kagel (Oninit) wrote:
> spender wrote:
>
> First, setting TAPESIZE larger than you need will not waste disk. IDS
> will not write out the full maximum size of the file to TAPESIZE in any
> case, only the size actually needed rounded up to the next TAPEBLK
> blocksize. However, if your OS can handle an archive file large enough
> to hold all of your chunks and any physical log records written during
> the archive period, then you can set TAPESIZE to zero (0) and ontape
> will continue to write to the file until the filesystem fills up or the
> OS returns a 'too large' error before prompting for a new tape file.
>
> Art S. Kagel
> Oninit
>
>> first thanks:
>>
>> I want backup database use "ontape -s -L 0" to backup informix
>> database to disk.
>> but, If i set TAPEDEV too small, it will prompt user "press Enter to
>> continue...", and wait for input, (read key)
>> if I set TAPEDEV too big, it will squander too many disk spaces.
>>
>> I make a NFS filesystem and mount it to : /home/informix/backup/
>> <--vtape file.
>> I want use "ontape" to backup my database, it create 1G
>> files(rationality), and when ontape prompt me change tape, I must copy
>> vtape to a new file, just like: vtape.1, and then press <enter> to
>> continue.,and go on ......etc
>>
>> Question:
>> User must be a normal unix user, and can input shell command,
>> I wan't do it though program or shell scripts or "crontab", user
>> only need click mouse from web, and wait for user input <enter> not
>> need, shell script will copy vtape file to vtape.$n......
>>
>> hehe. Chinese user, and opretor can't do any unix command. !!!!!
>>
>> use STDIO as TAPEDEV, I never do it, try it later....
>> "Jack Parker" <jack.parker4@verizon.net> wrote in message
>> news:mailman.548.1204030072.20610.informix-list@iiug.org...
>>
>>> With v10 you can set TAPEDEV in your $ONCONFIG to STDIO or a disk
>>> file name
>>> (full path + file - e.g. /opt/informix/backup/tape). There is also a
>>> TAPESIZE in which you can indicate whatever size you want. I'm not
>>> sure why
>>> you would want to change "tapes" at 1GB. ontape will prompt you to
>>> change
>>> tapes, I suppose you could use "expect" to watch for that, rename your
>>> tapefile to something and then send a return to ontape - but I don't
>>> understand why you would want to. It might make sense if you were
>>> backing
>>> up 2TB of disk to a little 100GB drive and had to swap out occasionally.
>>> But for that sort of thing you really should be using "onbar" and a
>>> storage
>>> manager anyway. I would recommend reading the "Backup and Restore
>>> Guide".
>>>
>>> Note, if you do use "expect", and TAPEDEV=file, you will always
>>> backup to
>>> that file, you will need to move the backed up file out of the way
>>> (rename
>>> it) and place a new "empty" file in it's place:
>>>
>>> mv $INFORMIXDIR/backup/tape $INFORMIXDIR/backup/tape.$n
>>> touch $INFORMIXDIR/backup/tape
>>> n = n + 1
>>>
>>> What you might also consider is backing up through a compression
>>> program.
>>> Set TAPEDEV to STDIO and then "ontape -s -L 0 | gzip - > backup.gz"
>>> (doing
>>> from memory, may have something off there). This will compress your
>>> backup
>>> on the fly and make it take less space and run faster. It reduces
>>> I/O work
>>> which is typically the bottleneck - but CPU will peak higher.
>>>
>>> cheers
>>> j.
>>>
>>> Sane ego te vocavi. Forsitan capedictum tuum desit.
>>>
>>> -----Original Message-----
>>> From: informix-list-bounces@iiug.org
>>> [mailto:informix-list-bounces@iiug.org]On Behalf Of spender@163.com
>>> Sent: Monday, February 25, 2008 11:20 PM
>>> To: informix-list@iiug.org
>>> Subject: how to ontape to disk
>>>
>>>
>>> Hello:
>>>
>>> Environment:
>>> AIX 5.3
>>> IDS 10 FC6
>>>
>>> How to use "ontape" command to backup database to file(juse 1G), and
>>> automatic change volume name like vtape.1, vtape.2, vtape.3 etc....
>>>
>>> game me some support
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Informix-list mailing list
>>> Informix-list@iiug.org
>>> http://www.iiug.org/mailman/listinfo/informix-list
>>>
>>>
>>
>>
>> _______________________________________________
>> Informix-list mailing list
>> Informix-list@iiug.org
>> http://www.iiug.org/mailman/listinfo/informix-list
>>
>> ===========================================================================================
>>
>> Please access the attached hyperlink for an important electronic
>> communications disclaimer:
>> http://www.oninit.com/home/disclaimer.php
>>
>> ===========================================================================================
>>
>>
>>
>>
>
>
>
> ===========================================================================================
>
> Please access the attached hyperlink for an important electronic
> communications disclaimer:
> http://www.oninit.com/home/disclaimer.php
>
> ===========================================================================================
>
>