Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Carmen tried to automate a cold restore with "ontape -r <<file_name" plus piped y/n answers, and got "Physical restore failed - read archive backup failed code 1 errno 2". Replies explained the misunderstanding: ontape doesn't take a filename argument — it reads the device/file named in TAPEDEV in the $ONCONFIG file, and the here-document should just feed the answers (ontape -r <<EOF / y / n / n / n / EOF). Advice was to ensure INFORMIXDIR, PATH, ONCONFIG and INFORMIXSERVER are set as in an interactive session, TAPEDEV points at the backup file, and possibly include a leading blank line for the "mount tape" prompt. Others questioned running unattended cold restores, though one poster does so nightly to refresh a dev system. No confirmation from the original poster is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Please help!
I try to restore a database with ontape -r file_name like :
$INFORMIXDIR/bin/ontape -r <<file_name
y
n
n
n
file_name
The error that I get is if the server is offline is :" Physical restore
failed - function read archive backup failed code 1 errno 2".
Has anyone any idea how do I have write the commad do or what environement
variables do I have to set for that the restore work properly?
Thans a lot,
Carmen
sending to informix-list
↪ replying to Carmen Constantinescu
Neil Truby — — source: Usenet: comp.databases.informix
"Carmen Constantinescu" <carmen@wylog.com> wrote in message
news:bthi4v$ujm$1@terabinaries.xmission.com...
>
> Please help!
>
> I try to restore a database with ontape -r file_name like :
> $INFORMIXDIR/bin/ontape -r <<file_name
>
> y
> n
> n
> n
> file_name
>
> The error that I get is if the server is offline is :" Physical restore
> failed - function read archive backup failed code 1 errno 2".
What are expecting << file_name to do?
Informix will try to restore the data from the device or file defined by the
TAPEDEV parameter in the $INFORMIXDIR/etc/$ONCONFIG file.
So, if this is not set correctly, edit the $ONCONFIG file to set TAPEDEV to
file_name.
--
Neil Truby t:01932 724027
Director m:07798 811708
Ardenta Limited e:neil.truby@ardenta.com
↪ replying to Carmen Constantinescu
Paul Watson — — source: Usenet: comp.databases.informix
something like
onstat -r <<EOFy
n
n
n
EOF
should work, but I wouldn't use it on a production system
Carmen Constantinescu wrote:
>
> Please help!
>
> I try to restore a database with ontape -r file_name like :
> $INFORMIXDIR/bin/ontape -r <<file_name
>
> y
> n
> n
> n
> file_name
>
> The error that I get is if the server is offline is :" Physical restore
> failed - function read archive backup failed code 1 errno 2".
>
> Has anyone any idea how do I have write the commad do or what environement
> variables do I have to set for that the restore work properly?
>
> Thans a lot,
> Carmen
>
> sending to informix-list
--
Paul Watson #
Oninit Ltd # Growing old is mandatory
Tel: +44 1436 672201 # Growing up is optional
Fax: +44 1436 678693 #
Mob: +44 7818 003457 #
www.oninit.com #
"Paul Watson" <paul@oninit.com> wrote in message
news:3FFC576E.292EDEB2@oninit.com...
> something like
>
> onstat -r <<EOF> y
> n
> n
> n
> EOF
>
> should work, but I wouldn't use it on a production system
onstat -r would be quite safe on a production system.I wouldn't use ontape on one though ...
↪ replying to Captain Pedantic
Paul Watson — — source: Usenet: comp.databases.informix
Captain Pedantic wrote:
>
> "Paul Watson" <paul@oninit.com> wrote in message
> news:3FFC576E.292EDEB2@oninit.com...
> > something like
> >
> > onstat -r <<EOF> > y
> > n
> > n
> > n
> > EOF
> >
> > should work, but I wouldn't use it on a production system
>
> onstat -r would be quite safe on a production system.> I wouldn't use ontape on one though ...
OK,OK :-)
--
Paul Watson #
Oninit Ltd # Growing old is mandatory
Tel: +44 1436 672201 # Growing up is optional
Fax: +44 1436 678693 #
Mob: +44 7818 003457 #
www.oninit.com #
↪ replying to Carmen Constantinescu
Andy Kent — — source: Usenet: comp.databases.informix
Why ever would you want to run a cold restore unattended?
Great laxative ...
"Carmen Constantinescu" <carmen@wylog.com> wrote in message news:<bthi4v$ujm$1@terabinaries.xmission.com>...
> Please help!
>
> I try to restore a database with ontape -r file_name like :
> $INFORMIXDIR/bin/ontape -r <<file_name
>
> y
> n
> n
> n
> file_name
>
> The error that I get is if the server is offline is :" Physical restore
> failed - function read archive backup failed code 1 errno 2".
>
> Has anyone any idea how do I have write the commad do or what environement
> variables do I have to set for that the restore work properly?
>
> Thans a lot,
> Carmen
>
> sending to informix-list
andykent.bristol@virgin.net (Andy Kent) wrote in message news:<a3525a11.0401080308.64a1ed12@posting.google.com>...
> Why ever would you want to run a cold restore unattended?
>
> Great laxative ...
>
>
> "Carmen Constantinescu" <carmen@wylog.com> wrote in message news:<bthi4v$ujm$1@terabinaries.xmission.com>...
> > Please help!
> >
> > I try to restore a database with ontape -r file_name like :
> > $INFORMIXDIR/bin/ontape -r <<file_name
> >
> > y
> > n
> > n
> > n
> > file_name
> >
> > The error that I get is if the server is offline is :" Physical restore
> > failed - function read archive backup failed code 1 errno 2".
> >
> > Has anyone any idea how do I have write the commad do or what environement
> > variables do I have to set for that the restore work properly?
> >
> > Thans a lot,
> > Carmen
> >
> > sending to informix-list
We run cold restores all the time without being there. Every night in
fact. The reason is that we like to refresh a development environment
with the latest production data in case there is a problem in
production that is related to current data.
Here is what you need to do:
1) Make sure your informix environment variables are set correctly.
$ONCONFIG, $PATH, INFORMIXDIR, and INFORMIXSERVER should all be
what they are when you run it interactively. (some of these may not be
since you are typing $INFORMIXDIR/bin/ontape, $INFORMIXDIR should be
in your PATH)
2) Make sure that your TAPEDEV variable is set correctly in the
corresponding ONCONFIG file.
I think you need to have a return for the load tape question so it
might need to read like below.
We use the same format but I always use:
ontape -r <<EOF
y
n
n
n
EOF
If this doesn't help post again and I'll find my script for this.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.