Informix restore question
Posted in 2011
Topics: Backup & Restore, Storage & Space Management, Server Administration, Clustering, Grid & MACH11
Hi,
We take a backup of the Informix database using the following command:
sudo -u ccxcluster ontape -v -s -L 0 -t STDIO | gzip /common/db_backup.gz
The zip file is clean and has no errors.
We are trying to restore the database using the command inside a bash shell
script:
sudo -u ccxcluster gunzip -c /common/db_backup.gz | ontape -r -v -t STDIO 2>&1
When restoring the database is in shutdown state. The TAPEDEV setting in
onconfig is set to STDIO.
We are seeing the following error:
gunzip: stdout: Broken pipe
The test box is a VM with RHEL5.0 and 4GB RAM.
1. What is causing this error and how to resolve it?
2. Is there an alternate way to restore the DB without unzipping the file to
disk - we have limited disk space and cannot hold the unzipped file on disk.
Thanks
You cannot do the restore that way. Ontape opens the archive file twice.
Once to read the reserved pages which is uses to make sure that all of the
chunk files exist, and to restore just the reserved pages to the root
chunk. Then it closes the file, starts oninit with -r and reopens the
archive file and begins the full restore. This close and reopen is the
broken pipe. You have two choices: 1. gunzip the file to disk and restore
from the uncompressed file, 2. use the BACKUP_FILTER and RESTORE_FILTER
instead (no you cannot use the RESTORE_FILTER to restore the file you
archived already because using BACKUP_FILTER ontape writes out the reserved
pages uncompressed and only begins compression after those pages are
written, so your existing archive has the wrong format).
Archive:
set TAPEDEV to the directory (/common) or to the file that you want to
archive written to (/common/db_backup) - don't use the .gz extension
set BACKUP_FILTER to gzip -c
sudo -u ccxcluster ontape -v -s -L 0
Restore:
set RESTORE_FILTER to gunzip -c
sudo -u ccxcluster ontape -r
You can use -t STDIO >/common/db_backup if you want instead of using
TAPEDEV, but, again don't use the .gz extension since the file is not
strictly a gzip file and that would become confusing later on.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. 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, Nov 22, 2011 at 1:39 AM, SRIDHAR CHANDRASEKHARAN <sridhcha@cisco.com
> wrote:
> Hi,
>
> We take a backup of the Informix database using the following command:
>
> sudo -u ccxcluster ontape -v -s -L 0 -t STDIO | gzip /common/db_backup.gz
>
> The zip file is clean and has no errors.
>
> We are trying to restore the database using the command inside a bash shell
> script:
>
> sudo -u ccxcluster gunzip -c /common/db_backup.gz | ontape -r -v -t STDIO
> 2>&1
>
> When restoring the database is in shutdown state. The TAPEDEV setting in
> onconfig is set to STDIO.
>
> We are seeing the following error:
>
> gunzip: stdout: Broken pipe
>
> The test box is a VM with RHEL5.0 and 4GB RAM.
>
> 1. What is causing this error and how to resolve it?
> 2. Is there an alternate way to restore the DB without unzipping the file
> to
> disk - we have limited disk space and cannot hold the unzipped file on
> disk.
>
> Thanks
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001517740626dffbf504b250a41c
I have used the following similar commands to archive/restore. Maybe it will
help you:
Archive
ontape -s -L 0 -t STDIO | openssl enc -aes-256-cbc > tapedev >>>> Note thisprompts you for a password you will need in the restore.
Restore
- cat tapedev | openssl enc -d -aes-256-cbc -pass pass:anything | ontape -r -t
STDIO -v
Hope This Helps,
Dan
PS It would most likely be better to use the archive and restore filters
however this does work.
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of SRIDHAR
CHANDRASEKHARAN
Sent: Tuesday, November 22, 2011 1:40 AM
To: ids@iiug.org
Subject: Informix restore question [25448]
Hi,
We take a backup of the Informix database using the following command:
sudo -u ccxcluster ontape -v -s -L 0 -t STDIO | gzip /common/db_backup.gz
The zip file is clean and has no errors.
We are trying to restore the database using the command inside a bash shell
script:
sudo -u ccxcluster gunzip -c /common/db_backup.gz | ontape -r -v -t STDIO 2>&1
When restoring the database is in shutdown state. The TAPEDEV setting in
onconfig is set to STDIO.
We are seeing the following error:
gunzip: stdout: Broken pipe
The test box is a VM with RHEL5.0 and 4GB RAM.
1. What is causing this error and how to resolve it?
2. Is there an alternate way to restore the DB without unzipping the file to
disk - we have limited disk space and cannot hold the unzipped file on disk.
Thanks
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.