Question
How do you use backup and restore filters with Informix Dynamic Server 11.10?
Answer
With IBM® Informix® Dynamic Server™ 11.10, it is possible to apply filters during a backup and restore with both ontape and onbar. These filters basically are external programs which are called before the data is written or read either to or from disk or the storage manager. The filter programs expect data from stdin and will send their output, the processed data, to stdout. The most common example for that is to call a compression program, but it can also be used for encryption or other changes to the data.
If you want to use a filter to compress the data of your backup, you can define a backup filter in the Informix Configuration file like below
Example
- For UNIX platforms:
- BACKUP_FILTER /usr/bin/compress
For Microsoft® Windows platforms:
- BACKUP_FILTER c:\cygwin\bin\gzip.exe
Doing a Level 0 Backup with ontape
ontape -s -L 0
Returns the following
D:\data\backup>ontape -s -L 0
Using the backup and restore filter c:\cygwin\bin\gzip.exe.
10 percent done.
20 percent done.
30 percent done.
40 percent done.
100 percent done.
File created: d:\data\backup\LBNOTE_2_L0
Please label this tape as number 1 in the arc tape sequence.
This tape contains the following logical logs:
27
Program over.
Comparing the size of this file with a backup done without compression shows that the filter was used.
D:\data\backup>dir
....
28.11.2007 11:50 19.775.488 LBNOTE_2_20071128_115015_L0
28.11.2007 12:46 1.171.164 LBNOTE_2_L0
There is no hint in the Informix message log about the usage of the filter, it is only shown in the output of the ontape. To restore, you will need to define a restore filter also in the Informix Configuration file, which will put the data back into the standard format the restore expects.
So, to restore the backup data with the filter defined above, you need to set in the Informix Configuration file.
For UNIX platforms:
- RESTORE_FILTER /usr/bin/uncompress
For Microsoft® Windows platforms:
- RESTORE_FILTER 'c:\cygwin\bin\gzip.exe -d'
Execute a restore with ontape
ontape -r
Returns the following output
Restore file d:\data\backup\LBNOTE_2_L0 and press Return to continue ...
Archive Tape Information
Tape type: Archive Backup Tape
Online version: IBM Informix Dynamic Server Version 11.10.TC2
Archive date: Wed Nov 28 12:46:30 2007
User id: ebach
Terminal id: LBNOTE
Archive level: 0
Tape device: d:\data\backup\
Tape blocksize (in k): 16
Tape size (in k): system defined for directory
Tape number in series: 1
Using the backup and restore filter c:\cygwin\bin\gzip.exe -d.
...
If you try to do a restore of a backup which has used a backup filter without the matching restore filter, you will receive an error message like in the following
Example
D:\data\backup>ontape -r
Restore file d:\data\backup\LBNOTE_2_L0 and press Return to continue ...
Archive Tape Information
Tape type: Archive Backup Tape
Online version: IBM Informix Dynamic Server Version 11.10.TC2
Archive date: Wed Nov 28 12:46:30 2007
User id: ebach
Terminal id: LBNOTE
Archive level: 0
Tape device: d:\data\backup\
Tape blocksize (in k): 16
Tape size (in k): system defined for directory
Tape number in series: 1
Physical restore failed - function Invalid archive tape failed code -1 errno 2
Program over.
http://www-01.ibm.com/support/docview.wss?uid=swg21287313
'Informix > informix reference' 카테고리의 다른 글
Inserting Data into a BLOB Column (TEXT) using ESQL/C (0) | 2013.02.04 |
---|---|
How to determine the number of concurrent connection/users on Informix server? (0) | 2013.01.29 |
How to check the real memory used by locks in different Informix Server versions (0) | 2012.11.18 |
How to isolate High CPU usage from for Informix (0) | 2012.11.18 |
Adding logical logs in a HDR pair environment (0) | 2012.11.15 |