Level 0 archive restore on Informix 7.24
Posted in 1999
Topics: Backup & Restore, Storage & Space Management, Stored Procedures & SPL, Error Codes & Troubleshooting, Server Administration, Platform-Specific Issues
I am new to Informix Database Administration. We are running Informix 7.24
on RS-6000 AIX version 4.2.1.0. Our daily backup scripts stack the level 0
archives on device /dev/rmt0.1. We are trying to restore a level 0 archive
from the tape to a newly built system as follows....
mt -t /dev/rmt0 rewind
mt -t /dev/rmt0.1 fsf 1
We then changed the onconfig file to point TAPEDEV to /dev/rmt0.1 and
started the "ontape -r". The initial dbspace information is displayed and
the program asks if we would like to proceed followed by if we would like to
save the last log. After this, the restore simply comes back with the
"program ended" message with no diagnostics.
We then tried to use dd to restore the archive to disk and then use it from
there.
dd if=/dev/rmt0 of=/temp/ddarc bs=16k
The file restores to disk but after changing the TAPEDEV to /temp/ddarc and
starting "ontape -r", the program simply does not even show the dbspace
information. It simply gives error opening /temp/ddarc file message with an
error code 1 and stops.
Anyone faced these problems before? Restoring a database from a tape should
be a fairly standard procedure.
Thanks!!!
Thanks for the response. You are right... rmt0.1 is the non-rewind option
for rmt0. The rewind/non-rewind option come into effect at the end of the
read operation. That is why "dd if=/dev/rmt0.1 of=/temp/ddarc bs=16k" will
work as well as /dev/rmt0. The only difference between the two operations is
that after using /dev/rmt0, the tape will rewind whereas for rmt0.1 it will
not. We did restore the database archive using dd because we know that the
first file is only a tape directory worth a few kilobytes but we had a 2GB
file at the end of the dd restore.
Our database is 2.6 GB. Is that the reason why our restores might be
failing? What are my options for a database larger than 2 GB?
Thanks!!!
=========================================
I'm a bit confused. Is /dev/rmt0.1 a no-rewind device? If so, you can't
restore from it directly because ontape incorporates a rewind near the
begining of its restore operations.
So, one alternative is to dd to file system (provided the archive is <
2GBytes in size). Which is what you've done, except, so far as I can see,
you've not dd'd the ontape archive but whatever's at the beginging of the
tape.
Shouldn't you be doing?:
mt -t /dev/rmt0 rewind
mt -t /dev/rmt0.1 fsf 1
dd if=/dev/rmt0.1 of=/temp/ddarc bs=16k
Or am I missing something?
Neil Truby
Londis Stores
Hampton Hill, UK
==================================================
Rajesh wrote in message <384001e6_4@news1.prserv.net>...
>I am new to Informix Database Administration. We are running Informix 7.24
>on RS-6000 AIX version 4.2.1.0. Our daily backup scripts stack the level 0
>archives on device /dev/rmt0.1. We are trying to restore a level 0 archive
>from the tape to a newly built system as follows....
>
>mt -t /dev/rmt0 rewind
>mt -t /dev/rmt0.1 fsf 1
>
>We then changed the onconfig file to point TAPEDEV to /dev/rmt0.1 and
>started the "ontape -r". The initial dbspace information is displayed and
>the program asks if we would like to proceed followed by if we would like
to
>save the last log. After this, the restore simply comes back with the
>"program ended" message with no diagnostics.
>
>We then tried to use dd to restore the archive to disk and then use it from
>there.
>
>dd if=/dev/rmt0 of=/temp/ddarc bs=16k
>
>The file restores to disk but after changing the TAPEDEV to /temp/ddarc and
>starting "ontape -r", the program simply does not even show the dbspace
>information. It simply gives error opening /temp/ddarc file message with an
>error code 1 and stops.
>
>Anyone faced these problems before? Restoring a database from a tape should
>be a fairly standard procedure.
>
>Thanks!!!
>
>
In article <38409ce8_2@news1.prserv.net>,
"Rajesh" <kapur@attglobal.net> wrote:
Rajesh,
Neil has it ALMOST right. You cannot use a non-rewind device for
an Informix restore, not because Informix rewinds the tape but because
it DOES NOT rewind the tape. It simply closes the device and reopens
it and expects that it will have rewound by itself, as a rewind device
or disk file will do. Now because of this, which ontape does twice
(opening the tape device a total of three times), you cannot restore
from any file on tape EXCEPT the first file. To restore the archive
you will have to dd the second tape file to disk, assuming your
filesystem will permit you to create a file larger than 2GB, or to
another tape as the first file. This is why Informix specifies that
you do NOT use norewind tape devices for backups so that the archive
will always be the first file.
My guess as to why your attempt at using dd to extract the archive
failed is that you probably did so immediately after the ontape failed
without repositioning the tape which would then have been positioned
after the second block. Ontape reads the header block, closes the
file, and prompts you to verify that the header info is as you
expected. Ontape then reads the header and disk file information,
closes the tape again and verifies that all the disk files are
available with the proper permissions (this is where your ontape
session failed because it did not find the header followed by the disk
information it only got back disk information). Finally it reopens the
device and begins to restore the database.
So if you had repositioned the tape (mt -f /dev/rmt0.1 rewind; mt -f
/dev/rmt0.1 fsf) then dd'd (with bs set to the same as TAPEBLK)
assuming the file was not too large for your filesystem, it should have
succeeded.
Art S. Kagel
> Thanks for the response. You are right... rmt0.1 is the non-rewind
option
> for rmt0. The rewind/non-rewind option come into effect at the end of
the
> read operation. That is why "dd if=/dev/rmt0.1 of=/temp/ddarc bs=16k"
will
> work as well as /dev/rmt0. The only difference between the two
operations is
> that after using /dev/rmt0, the tape will rewind whereas for rmt0.1 it
will
> not. We did restore the database archive using dd because we know that
the
> first file is only a tape directory worth a few kilobytes but we had a
2GB
> file at the end of the dd restore.
>
> Our database is 2.6 GB. Is that the reason why our restores might be
> failing? What are my options for a database larger than 2 GB?
>
> Thanks!!!
> =========================================
> I'm a bit confused. Is /dev/rmt0.1 a no-rewind device? If so, you
can't
> restore from it directly because ontape incorporates a rewind near the
> begining of its restore operations.
>
> So, one alternative is to dd to file system (provided the archive is <
> 2GBytes in size). Which is what you've done, except, so far as I can
see,
> you've not dd'd the ontape archive but whatever's at the beginging of
the
> tape.
>
> Shouldn't you be doing?:
> mt -t /dev/rmt0 rewind
> mt -t /dev/rmt0.1 fsf 1
> dd if=/dev/rmt0.1 of=/temp/ddarc bs=16k
>
> Or am I missing something?
>
> Neil Truby
> Londis Stores
> Hampton Hill, UK
>
> ==================================================
>
> Rajesh wrote in message <384001e6_4@news1.prserv.net>...
> >I am new to Informix Database Administration. We are running Informix
7.24
> >on RS-6000 AIX version 4.2.1.0. Our daily backup scripts stack the
level 0
> >archives on device /dev/rmt0.1. We are trying to restore a level 0
archive
> >from the tape to a newly built system as follows....
> >
> >mt -t /dev/rmt0 rewind
> >mt -t /dev/rmt0.1 fsf 1
> >
> >We then changed the onconfig file to point TAPEDEV to /dev/rmt0.1 and
> >started the "ontape -r". The initial dbspace information is displayed
and
> >the program asks if we would like to proceed followed by if we would
like
> to
> >save the last log. After this, the restore simply comes back with the
> >"program ended" message with no diagnostics.
> >
> >We then tried to use dd to restore the archive to disk and then use
it from
> >there.
> >
> >dd if=/dev/rmt0 of=/temp/ddarc bs=16k
> >
> >The file restores to disk but after changing the TAPEDEV to
/temp/ddarc and
> >starting "ontape -r", the program simply does not even show the
dbspace
> >information. It simply gives error opening /temp/ddarc file message
with an
> >error code 1 and stops.
> >
> >Anyone faced these problems before? Restoring a database from a tape
should
> >be a fairly standard procedure.
> >
> >Thanks!!!
> >
> >
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.