Three methods for backing up Informix-Online Databases

Source: Internet
Author: User

Informix-Online databases are widely used for their high performance, high reliability, and support for data integrity definition/check. For databases in use, the security and reliability of data backup has become the focus of attention. Based on years of study and experience, I have summarized and compared three data backup methods commonly used in Informix-Online databases. Most backups are hot backups backed up to tapes.

I. Use the ontape tool for data backup

1. Functions of the ontape Tool
The ontape tool has the following features: backup and recovery of Online data, backup and recovery of logical logs, change of Database Log status, etc. This article focuses on the data backup function ).

2. Execute the ontape data backup syntax
Ontape backup Syntax:
Ontape-s-L backup level 0, 1, 2)
When online is in online or static mode, Informix users or users with DBA permissions can back up data by executing the preceding command. Backup levels 0, 1, and 2 according to the backup plan. Level 0 backup backs up all the data in the entire database; Level 1 backup backs up only the data modified after level 0 backup; level 2 backup only backs up the data modified after Level 1 backup.

3. Notes for using the ontape tool for data backup
1) Before performing an ontape backup, set the TAPEDEV, TAPEBLK, and TAPESIZE parameters in the Onconfig file correctly.
2) In order to shorten the data recovery time, priority should be given to level 0 and backup level 1 and level 2 should be minimized. Data of important departments such as banks should be backed up at level 0 every day.
3) if you need to recover the data backed up by ontape to another server, the quantity and size of the disk space of the two server models, operating systems, Onconfig configuration files, and non-temporary Dbspace must be consistent; otherwise, the data cannot be restored normally.
4) Make sure there are sufficient logical log files available. If the remaining logical log space is less than 50% of the size of a single logical log, Informix-online rejects the backup operation. You must back up the used logical logs before backing up data.
5) keep a copy of The Onconfig file. After level 0 backup, The Onconfig file should be backed up, because the Onconfig file information needs to be read when the level 0 backup is restored. If the online configuration is modified, data recovery will fail, if this level 0 backup is restored, the current configuration must be restored.
6) backup can be performed online or in static mode. The online operation mode cannot be changed during the backup process. Otherwise, the backup will be interrupted.
7) do not use the background mode to execute the BACKUP command under UNIX &), because backup is performed in interactive mode.

2. Use the dbexport command to back up data

1. dbexport command Introduction
The dbexport command writes data to a file or backup media, such as a tape, in an ASCII format ). Dbexport files include database mode files and data files.

2. The dbexport command syntax is as follows:
Dbexport [-X] [-c] [-q] [-d] [-ss] [{-o-t-B-s [-f]}]
The parameters in the preceding command have the following meanings:
<> The content in [] is required.
-C: indicates that if there is no error, all information is output.
-Q: no error messages, warnings, and SQL data definition statements are displayed on the standard output device.
-D: only the blob descriptor is output, and no blob data is output.
-Ss: outputs server-specific information for creating databases and tables in the mode file, for example: the size of the initial extent and the attached extent, the locking method, and the dbspace where the table resides.
-O: Specifies the disk directory of the data output file.
-T: Specifies the backup media name of the data output file.
-B: Specifies the size of the backup media block.
-S: specifies the maximum storage capacity of the backup media.
-F: Specifies the mode file name stored on the backup media.
Database: Specifies the name of the backup database.

Dbexport functions and precautions
1) The dbexport command must be an Informix user or a user with DBA access permissions;
2) data backed up using dbexport must be restored using the dbimport command;
3) You can edit the mode file to change the database generated by dbimport, such as changing the database name or related table information;
4) dbexport exclusivemode exclusively occupies the database. During the backup, other users cannot query, modify, or insert the database;
5) the mode file does not retain the Database Log Files. When you use the dbimport command to create a database, You must select an ANSI, buffered, and nobuffered log type for the new database );
6) You can use the dbexport/dbimport command to convert data under Informix-online and Informix-SE. You can also convert data between different versions of Informix-online, this type of conversion has no special requirements on the database server structure and online configuration;
7) using the dbexport/dbimport command to back up/restore data can eliminate space fragments allocated to data and improve the overall operational efficiency of the database.

3. Use the Onunload command to back up data

1. Onunload command Introduction
The Onunload command, in the unit of pages, uses binary form to unload data, which is more efficient than dbexport.

2. Onunload command syntax
Onunload [-l] [-t] [-B] [-s] [: [owner>.>
The preceding parameters indicate the following meanings:
<> The content included in is mandatory, and the content in [] is optional.
-L: indicates that onunload reads the tape device, block size, and backup device capacity values from the configuration parameters TAPEDEV, TAPEBLK, and TAPESIZE respectively.
-T: Specifies the backup device name.
-B: Specify the block size of the backup device.
-S: Specifies the storage capacity of the backup device.
Database: Specifies the database to be backed up.
Owner: Specifies the owner of the table.
Table: Specifies the table to be detached.
Notes for using onunload
1) The onunload backup data must be restored using the onload command;
2) onunload/onload cannot implement data transfer between different versions of online;
3) onunload/onload is the binary data stored in units of disk page size. The computer for picking and receiving data must have the same disk page size;
4) Only the onunload unload data can be loaded into the online management database or table;
5) You must have the DBA access permission to execute the onunload command;
6) onunload does not retain the access privileges defined in the initial table;
7) onunload does not retain synonyms defined in the initial table.

The preceding three data backup methods have their own characteristics. ontape backup requires high consistency before and after the online parameter configuration, but the data backup and recovery operations are simple and the backup and recovery speed is fast; the onunload backup is highly efficient in binary format in units of pages, as long as the computer disk page size is consistent during data recovery; the backup made by dbexport can realize data conversion between different versions and different Informix products, and the data transfer is flexible and convenient.

To ensure secure data recovery, You must select at least two backup methods. By analyzing, comparing and summarizing the three common backup methods of Informix-Online Database, you can select a backup method that suits your needs based on the actual situation to ensure secure data recovery and transfer.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.