ontape -s to local directory on UNIX
Posted in 2009
User on IDS 7.20 couldn't make ontape -s write to a local directory, getting repeated "could not write archive tape" prompts. Answers: backup-to-directory didn't exist in 7.20 — TAPEDEV must be an existing file owned by informix with 660 perms, and TAPESIZE should stay under 2 GB. He worked around the size limit by setting TAPEDEV to a named pipe feeding compress. Restore then appeared to hang because ontape opens the archive twice (once to show header info, then again to restore); restarting the uncompress into the pipe before confirming made the restore work, with progress visible via onstat -u. A follow-up question on date-stamped directory names was answered with date +%y%m%d.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Backup & Restore
Hi Gurus, I am trying to backup to local directory (TAPEDEV = /mn/dbbkp) but the following message is being given. Please mount tape 1 on /mn/dbbkp and press Return to continue ... could not write archive tape. Please mount tape 1 on /mn/dbbkp and press Return to continue ... could not write archive tape. Please mount tape 1 on /mn/dbbkp and press Return to continue ... could not write archive tape. Informix Database Version is 7.20 UC2 Thanks in advance. Malik
Hi,
the target file must already exist (touch /mn/dbbkp) .
It must have owner/group informix and permissions 660.
Bye
Andreas
-------------------------------------------
SPAR Österreichische Warenhandels-AG
Hauptzentrale
A - 5015 Salzburg, Europastrasse 3
FN 34170 a
Tel: +43 662 4470 24223
Mobile: +43 664 6259575
E-Mail: Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
Wichtiger Hinweis: Der Inhalt dieser E-Mail kann vertrauliche und rechtlich
geschützte Informationen, insbesondere Betriebs- oder Geschäftsgeheimnisse,
enthalten, zu deren Geheimhaltung der Empfänger verpflichtet ist. Die
Informationen in dieser E-Mail sind ausschließlich für den Adressaten
bestimmt. Sollten Sie die E-Mail irrtümlich erhalten haben so ersuchen wir
Sie, die Nachricht von Ihrem System zu löschen und sich mit uns in Verbindung
zu setzen.
Über das Internet versandte E-Mails können leicht manipuliert oder unter
fremdem Namen erstellt werden. Daher schließen wir die rechtliche
Verbindlichkeit der in dieser Nachricht enthaltenen Informationen aus. Der
Inhalt der E-Mail ist nur rechtsverbindlich, wenn er von uns schriftlich
bestätigt und gezeichnet wird.
Sollte trotz der von uns verwendeten Virus-Schutzprogramme durch die Zusendung
von E-Mails ein Virus in Ihre Systeme gelangen, haften wir nicht für evtl.
hieraus entstehende Schäden.
Wir danken für Ihr Verständnis.
Important notice: The contents of this e-mail may contain confidential and
legally protected information that is in particular related to operational and
trade secrets, which the recipient is obliged to treat as confidential. The
information in this e-mail is made available exclusively for use by the
addressee. In the event that the e-mail may have been sent to you in error, we
would ask you to kindly delete this communication from your system and to
contact us.
E-mails sent via the Internet can be easily manipulated or sent out under
someone else's name. We therefore do not accept legal liability for the
information contained in this communication. The contents of the e-mail are
only legally binding if they have been confirmed and signed by us in writing.
If, in spite of our using Antivirus protection software, a virus may have
penetrated your system through the sending of this e-mail, we do not accept
liability for any damage that may possibly arise as a result of this.
We trust that you appreciate our position.
-------------------------------------------
-----Ursprüngliche Nachricht-----
Von: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] Im Auftrag von MALIK
CHAGANI
Gesendet: Montag, 7. September 2009 08:21
An: ids@iiug.org
Betreff: ontape -s to local directory on UNIX [16881]
Hi Gurus,
I am trying to backup to local directory (TAPEDEV = /mn/dbbkp) but the
following message is being given.
Please mount tape 1 on /mn/dbbkp and press Return to continue ...
could not write archive tape.
Please mount tape 1 on /mn/dbbkp and press Return to continue ...
could not write archive tape.
Please mount tape 1 on /mn/dbbkp and press Return to continue ...
could not write archive tape.
Informix Database Version is 7.20 UC2
Thanks in advance.
Malik
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Hi,
there is no "archive to directory" functionality in IDS 7.20.
This is a new feature that was introduced much later, in
version 11.10, I think.
You can only backup to a file. The file must exist prior to
starting the backup. When IDS tells you that the file is full
(determined via the TAPESIZE onconfig parameter), it will
prompt you to change the tape - at this point you need to
move the file (and re-create it) so that ontape can continue
(with backing up to the same file wothout overwriting the
prior content).
Also: probably there will be a problem with files bigger
than 2 GB. Therefore better limit the TAPESIZE to a
maximum of 2 GB.
BTW: IDS 7.20.x is more than 12 years old now. You may
want to start thinking about migrating to a newer version.
Regards, Martin
--
Martin Fuerderer
IBM Informix Development Munich, Germany
Information Management
IBM Deutschland Research & Development GmbH
Chairman of the Supervisory Board: Martin Jetter
Board of Management: Erich Baier
Corporate Seat: Boeblingen, Germany
Reg.-Gericht: Amtsgericht Stuttgart, HRB 243294
ids-bounces@iiug.org wrote on 09/07/2009 08:20:50 AM:
>
> Hi Gurus,
>
> I am trying to backup to local directory (TAPEDEV = /mn/dbbkp) but the
> following message is being given.
>
> Please mount tape 1 on /mn/dbbkp and press Return to continue ...
> could not write archive tape.
>
> Please mount tape 1 on /mn/dbbkp and press Return to continue ...
> could not write archive tape.
>
> Please mount tape 1 on /mn/dbbkp and press Return to continue ...
> could not write archive tape.
>
> Informix Database Version is 7.20 UC2
>
> Thanks in advance.
>
> Malik
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
Thanks all for your great help.
I am able to take backup to disk. However the 2 GB limitation is overcome by
using compress utility;
Backup Steps:
-------------------------------------------------------
1- mknod /var/tmp/mytape.pipe p # create named pipe
2 - TAPEDEV /var/tmp/mytape.pipe # Tape device path [restarted DB engine]
3- /var/tmp/mytape.pipe | compress -c > /var/tmp/mytapebackup.Z &
4- ontape -s [resulted into 588 MB mytapebacku.Z file for approx. 6 GB
database]
Restore Steps:
-------------------------------------------------------
1- onmode -ky
2- uncompress -c /var/tmp/mytapebackup.Z > /var/tmp/mytape.pipe &
3- ontape -r
it shows archive information, dbspaces and chunks then gives the following
prompt
Continue Restore ? [y/n] y
Do you want to back up the logs? [y/n] n
then it is not showing any progress ... how can i check whether it is working
or not.
Thanks in advance for the great help.
Malik
Hi,
OK. This is because ontape will read the first few pages of
the backup to display the information about the backup
(dbspaces, chunks, etc.) so that you can confirm that it
is the correct backup to restore.
After displaying this information (and receiving the
confirmation to continue with the restore), ontape will
close the file and re-open it again, expecting to read
the file again from the beginning, now for actually restoring
those first pages to the disk. This is one reason why
only rewind tape devices are supported.
In your case I'd recommend for the restore to
uncompress the backup to a real file (rather than named
pipe) and then to do the restore from this file (TAPEDEV
set to the file).
Alternatively you could try to interrupt the uncompress
process at the point where ontape asks you for
confirmation, and then to restart it before continuing
the restore with onptape. Though I never tried this.
It may cause some error in ontape if at some point it
would detect that there is no other process at the
writer end of the named pipe. You'd have to try ...
I would keep the restore procedure rather simple as
often it is performed in a stress situation. When this
procedure is complicated it can cause unnecessary
and unnerving delays for an urgent restore (and in
a worst case it can cost the admin his job) ...
Regards, Martin
--
Martin Fuerderer
IBM Informix Development Munich, Germany
Information Management
IBM Deutschland Research & Development GmbH
Chairman of the Supervisory Board: Martin Jetter
Board of Management: Erich Baier
Corporate Seat: Boeblingen, Germany
Reg.-Gericht: Amtsgericht Stuttgart, HRB 243294
ids-bounces@iiug.org wrote on 09/08/2009 02:06:53 PM:
>
> Thanks all for your great help.
>
> I am able to take backup to disk. However the 2 GB limitation is
> overcome by
> using compress utility;
>
> Backup Steps:
> -------------------------------------------------------
> 1- mknod /var/tmp/mytape.pipe p # create named pipe
>
> 2 - TAPEDEV /var/tmp/mytape.pipe # Tape device path [restarted DB
engine]
>
> 3- /var/tmp/mytape.pipe | compress -c > /var/tmp/mytapebackup.Z &
>
> 4- ontape -s [resulted into 588 MB mytapebacku.Z file for approx. 6 GB
> database]
>
> Restore Steps:
> -------------------------------------------------------
>
> 1- onmode -ky
>
> 2- uncompress -c /var/tmp/mytapebackup.Z > /var/tmp/mytape.pipe &
>
> 3- ontape -r
> it shows archive information, dbspaces and chunks then gives the
following
> prompt
>
> Continue Restore ? [y/n] y
>
> Do you want to back up the logs? [y/n] n
>
> then it is not showing any progress ... how can i check whether it
> is working
> or not.
>
> Thanks in advance for the great help.
>
> Malik
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
OK, the problem is that ontape opens the input archive file twice. Once to
get the reserved pages and allow you to verify that this is the correct
archive. Then it closes the file and opens it again to start the actual
restore. So, before replying to the 'Continue with restore?' prompt restart
the uncompress to the pipe. This MAY work it may not. Restores from pipes
are NOT explicitly supported in your version of IDS.
Art
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
On Tue, Sep 8, 2009 at 8:06 AM, MALIK CHAGANI <malik1220@hotmail.com> wrote:
> Thanks all for your great help.
>
> I am able to take backup to disk. However the 2 GB limitation is overcome
> by
> using compress utility;
>
> Backup Steps:
> -------------------------------------------------------
> 1- mknod /var/tmp/mytape.pipe p # create named pipe
>
> 2 - TAPEDEV /var/tmp/mytape.pipe # Tape device path [restarted DB engine]
>
> 3- /var/tmp/mytape.pipe | compress -c > /var/tmp/mytapebackup.Z &
>
> 4- ontape -s [resulted into 588 MB mytapebacku.Z file for approx. 6 GB
> database]
>
> Restore Steps:
> -------------------------------------------------------
>
> 1- onmode -ky
>
> 2- uncompress -c /var/tmp/mytapebackup.Z > /var/tmp/mytape.pipe &
>
> 3- ontape -r
> it shows archive information, dbspaces and chunks then gives the following
> prompt
>
> Continue Restore ? [y/n] y
>
> Do you want to back up the logs? [y/n] n
>
> then it is not showing any progress ... how can i check whether it is
> working
> or not.
>
> Thanks in advance for the great help.
>
> Malik
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--0015174757425b2513047312d95e
Hi,
as Art said you have to start the uncompress twice.
You can monitor the progress afterwards using
onstat -uYou should see at least one thread with increasing page writes.
Regards,
Andreas
-------------------------------------------
SPAR Österreichische Warenhandels-AG
Hauptzentrale
A - 5015 Salzburg, Europastrasse 3
FN 34170 a
Tel: +43 662 4470 24223
Mobile: +43 664 6259575
E-Mail: Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
Wichtiger Hinweis: Der Inhalt dieser E-Mail kann vertrauliche und rechtlich
geschützte Informationen, insbesondere Betriebs- oder Geschäftsgeheimnisse,
enthalten, zu deren Geheimhaltung der Empfänger verpflichtet ist. Die
Informationen in dieser E-Mail sind ausschließlich für den Adressaten
bestimmt. Sollten Sie die E-Mail irrtümlich erhalten haben so ersuchen wir
Sie, die Nachricht von Ihrem System zu löschen und sich mit uns in Verbindung
zu setzen.
Über das Internet versandte E-Mails können leicht manipuliert oder unter
fremdem Namen erstellt werden. Daher schließen wir die rechtliche
Verbindlichkeit der in dieser Nachricht enthaltenen Informationen aus. Der
Inhalt der E-Mail ist nur rechtsverbindlich, wenn er von uns schriftlich
bestätigt und gezeichnet wird.
Sollte trotz der von uns verwendeten Virus-Schutzprogramme durch die Zusendung
von E-Mails ein Virus in Ihre Systeme gelangen, haften wir nicht für evtl.
hieraus entstehende Schäden.
Wir danken für Ihr Verständnis.
Important notice: The contents of this e-mail may contain confidential and
legally protected information that is in particular related to operational and
trade secrets, which the recipient is obliged to treat as confidential. The
information in this e-mail is made available exclusively for use by the
addressee. In the event that the e-mail may have been sent to you in error, we
would ask you to kindly delete this communication from your system and to
contact us.
E-mails sent via the Internet can be easily manipulated or sent out under
someone else's name. We therefore do not accept legal liability for the
information contained in this communication. The contents of the e-mail are
only legally binding if they have been confirmed and signed by us in writing.
If, in spite of our using Antivirus protection software, a virus may have
penetrated your system through the sending of this e-mail, we do not accept
liability for any damage that may possibly arise as a result of this.
We trust that you appreciate our position.
-------------------------------------------
-----Ursprüngliche Nachricht-----
Von: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] Im Auftrag von Art
Kagel
Gesendet: Dienstag, 8. September 2009 17:45
An: ids@iiug.org
Betreff: Re: ontape -s to local directory on UNIX [16902]
OK, the problem is that ontape opens the input archive file twice. Once to
get the reserved pages and allow you to verify that this is the correct
archive. Then it closes the file and opens it again to start the actual
restore. So, before replying to the 'Continue with restore?' prompt restart
the uncompress to the pipe. This MAY work it may not. Restores from pipes
are NOT explicitly supported in your version of IDS.
Art
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
On Tue, Sep 8, 2009 at 8:06 AM, MALIK CHAGANI <malik1220@hotmail.com> wrote:
> Thanks all for your great help.
>
> I am able to take backup to disk. However the 2 GB limitation is overcome
> by
> using compress utility;
>
> Backup Steps:
> -------------------------------------------------------
> 1- mknod /var/tmp/mytape.pipe p # create named pipe
>
> 2 - TAPEDEV /var/tmp/mytape.pipe # Tape device path [restarted DB engine]
>
> 3- /var/tmp/mytape.pipe | compress -c > /var/tmp/mytapebackup.Z &
>
> 4- ontape -s [resulted into 588 MB mytapebacku.Z file for approx. 6 GB
> database]
>
> Restore Steps:
> -------------------------------------------------------
>
> 1- onmode -ky
>
> 2- uncompress -c /var/tmp/mytapebackup.Z > /var/tmp/mytape.pipe &
>
> 3- ontape -r
> it shows archive information, dbspaces and chunks then gives the following
> prompt
>
> Continue Restore ? [y/n] y
>
> Do you want to back up the logs? [y/n] n
>
> then it is not showing any progress ... how can i check whether it is
> working
> or not.
>
> Thanks in advance for the great help.
>
> Malik
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--0015174757425b2513047312d95e
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
thank you all for your great help. You people are genius.
Now, i am able to restore the database from the compress file. I had to run
uncompress twice.
Many Thanks,
Malik
I have another question which i am trying, you might be able to direct me.
Now i am trying to write script file to do the ontape -s.
For this i need to create a directory with pattern PRBKP_YYMMDD.
You input will be great.
Thanks again
malik
Hello,
are you asking how to generate the timestamp YYMMDD ?
On most UNIX systems: date +%y%m%d
DATE=`date +%y%m%d`
mkdir PRBKP_$DATE
Regards,
Andreas
-------------------------------------------
SPAR Österreichische Warenhandels-AG
Hauptzentrale
A - 5015 Salzburg, Europastrasse 3
FN 34170 a
Tel: +43 662 4470 24223
Mobile: +43 664 6259575
E-Mail: Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
Wichtiger Hinweis: Der Inhalt dieser E-Mail kann vertrauliche und rechtlich
geschützte Informationen, insbesondere Betriebs- oder Geschäftsgeheimnisse,
enthalten, zu deren Geheimhaltung der Empfänger verpflichtet ist. Die
Informationen in dieser E-Mail sind ausschließlich für den Adressaten
bestimmt. Sollten Sie die E-Mail irrtümlich erhalten haben so ersuchen wir
Sie, die Nachricht von Ihrem System zu löschen und sich mit uns in Verbindung
zu setzen.
Über das Internet versandte E-Mails können leicht manipuliert oder unter
fremdem Namen erstellt werden. Daher schließen wir die rechtliche
Verbindlichkeit der in dieser Nachricht enthaltenen Informationen aus. Der
Inhalt der E-Mail ist nur rechtsverbindlich, wenn er von uns schriftlich
bestätigt und gezeichnet wird.
Sollte trotz der von uns verwendeten Virus-Schutzprogramme durch die Zusendung
von E-Mails ein Virus in Ihre Systeme gelangen, haften wir nicht für evtl.
hieraus entstehende Schäden.
Wir danken für Ihr Verständnis.
Important notice: The contents of this e-mail may contain confidential and
legally protected information that is in particular related to operational and
trade secrets, which the recipient is obliged to treat as confidential. The
information in this e-mail is made available exclusively for use by the
addressee. In the event that the e-mail may have been sent to you in error, we
would ask you to kindly delete this communication from your system and to
contact us.
E-mails sent via the Internet can be easily manipulated or sent out under
someone else's name. We therefore do not accept legal liability for the
information contained in this communication. The contents of the e-mail are
only legally binding if they have been confirmed and signed by us in writing.
If, in spite of our using Antivirus protection software, a virus may have
penetrated your system through the sending of this e-mail, we do not accept
liability for any damage that may possibly arise as a result of this.
We trust that you appreciate our position.
-------------------------------------------
-----Ursprüngliche Nachricht-----
Von: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] Im Auftrag von MALIK
CHAGANI
Gesendet: Mittwoch, 9. September 2009 12:31
An: ids@iiug.org
Betreff: Re: AW: ontape -s to local directory on UNIX [16919]
thank you all for your great help. You people are genius.
Now, i am able to restore the database from the compress file. I had to run
uncompress twice.
Many Thanks,
Malik
I have another question which i am trying, you might be able to direct me.
Now i am trying to write script file to do the ontape -s.
For this i need to create a directory with pattern PRBKP_YYMMDD.
You input will be great.
Thanks again
malik
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
DIRNAME="PRBKP_$(date +'%y%m%d')"
Or something like that (not on my Linux box right now to check it) - see the
manpage for setftime for the details of the 'date' format string.
Art
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
On Wed, Sep 9, 2009 at 6:31 AM, MALIK CHAGANI <malik1220@hotmail.com> wrote:
> thank you all for your great help. You people are genius.
>
> Now, i am able to restore the database from the compress file. I had to run
> uncompress twice.
>
> Many Thanks,
> Malik
>
> I have another question which i am trying, you might be able to direct me.
>
> Now i am trying to write script file to do the ontape -s.
>
> For this i need to create a directory with pattern PRBKP_YYMMDD.
>
> You input will be great.
>
> Thanks again
>
> malik
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--0022158df8f7034fde0473257c99