In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How to back up Informix-Online database, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Informix-Online database has been widely used because of its high performance, high reliability and supporting data integrity definition / check. For the database in use, the security and reliability of data backup has become the focus of attention. According to years of study and experience, the author summarizes and compares three data backup methods commonly used in Informix-Online database. Most of the backups mentioned by the editor are hot backup methods that are backed up to tape.
one。 Using ontape tool for data backup
Functions of the 1.ontape tool
Ontape tool has the following functions: backup and restore Online data, backup and restore logical logs, change the state of database logs, etc. (this article focuses on the data backup function).
two。 Syntax for performing ontape backup data
The ontape backup syntax is:
Ontape-s-L backup level (0, 1, 2)
When online is in online or static mode, Informix users or users with DBA privileges can make backups by executing the above command. Level 0, level 1, and level 2 backups are arranged according to the backup plan. Level 0 backup is a complete backup of all data in the whole database; level 1 backup is only a backup of data modified after level 0 backup; level 2 backup is only a backup of data modified after level 1 backup.
3. Problems needing attention in data backup with ontape tool
1) the TAPEDEV, TAPEBLK, and TAPESIZE parameters in the Onconfig file should be set correctly before performing the ontape backup.
2) in order to shorten the data recovery time, we should focus on level 0 and minimize level 1 and level 2 backups. The data of important departments such as banks should be backed up at level 0 every day.
3) if you need to restore the data backed up by ontape to another server, the amount and size of the two server models, operating systems, Onconfig configuration files and non-temporarily allocated Dbspace disk space must be the same, otherwise the data cannot be restored normally.
4) you must ensure that sufficient logical log files are available. If the remaining logical log space is less than 50% of a single logical log, the backup operation will be refused. You must back up the used logical logs before you can back up your data.
5) keep a copy of the Onconfig file. After a level 0 backup, you should back up the Onconfig file because you need to read the Onconfig file information when restoring the level 0 backup. If the online configuration is modified, the data recovery will fail. If you restore this level 0 backup, you must restore the configuration at that time.
6) the backup can be carried out in online online or static mode, and the operation mode of online cannot be changed during the backup process, otherwise the backup will be interrupted.
7) do not execute backup commands in the background (& & under UNIX), because backups are done interactively.
two。 Use the dbexport command for data backup
Introduction to 1.dbexport command
The dbexport command writes data to a file or backup media (such as tape) in ASCII code format. The files unloaded by dbexport include database schema files and data files.
The 2.dbexport command syntax is as follows
Dbexport [- X] [- c] [- Q] [- d] [- ss] [{- o-t-b-s [- f]}]
The meaning of the parameters in the above command is as follows:
The content included in is required and the content in [] is optional.
-c: indicates that if there are no errors, all information is output.
-Q: error messages, warnings, and generated SQL data definition statements are not displayed on standard output devices.
-d: only blob descriptors are output, not blob data.
-ss: outputs server-specific information used to create databases and tables in the schema file, such as the size of the initial extent and additional extent, how it is locked, the dbspace where the table resides, and so on.
-o: specifies the disk directory of the data output file.
-t: specifies the backup media name of the data output file.
-b: specifies the backup media block size.
-s: specify the amount of storage of backup media.
-f: used to specify the mode file name stored on the backup media.
Database: specifies the database name of the backup.
Using the function of dbexport and the problems needing attention
1) the execution of the dbexport command must be an Informix user or a user with DBA access
2) the data backed up with dbexport must be restored with the dbimport command
3) users can change the database generated by dbimport by editing the schema file, such as changing the database name or related table information
4) dbexport occupies the database in an exclusive way (exclusivemode), and other users cannot query, modify and insert the database during the backup.
5) the schema file does not retain the log files of the database, and users must select a log mode (ANSI, buffered, nobuffered type) for the new database when using the dbimport command to establish the database.
6) users can use the dbexport/dbimport command to convert the data under Informix-online and Informix-SE, or to convert the data between different versions of Informix-online. This conversion has no special requirements on the structure of the database server and the configuration of online.
7) using dbexport/dbimport command to back up / restore data can eliminate the fragmentation of data allocation space and improve the overall operation efficiency of the database.
three。 Use the Onunload command for data backup
Introduction to 1.Onunload command
The Onunload command unloads data in binary form in pages, which is more efficient than dbexport.
Syntax of the 2.Onunload command
Onunload [- l] [- t] [- b] [- s] [: [owner >. >
The meanings of the above parameters are as follows:
The content included in is required and the content in [] is optional
-l: instructs onunload to read tape device, block size, and backup device capacity values from the configuration parameters TAPEDEV, TAPEBLK, and TAPESIZE, respectively
-t: specify the backup device name
-b: specify the block size of the backup device
-s: specify the storage capacity of the backup device
Database: specify the database to back up
Owner: specify the owner of the table
Table: specify the table to unload
Problems that should be paid attention to when using onunload
1) the data backed up by onunload must be restored with the onload command
2) onunload/onload cannot transfer data between different versions of online.
3) onunload/onload is binary data stored in units of disk page size. The computer that dismounts and receives the data must have the same disk page size.
4) only the data unloaded by onunload can be loaded into a database or table managed by online
5) the user must have DBA access to execute the onunload command
6) onunload does not retain the access privileges defined on the initial table
7) onunload does not retain synonyms defined on the original table.
The above three data backup methods have their own characteristics. Ontape backup requires high consistency before and after the configuration of online parameters, but the operation of data backup and recovery is simple and the speed of backup and recovery is fast. Onunload backup is more efficient in binary form, as long as the computer disk page size is the same during data recovery. The backup made by dbexport can realize the data conversion between different versions and different Informix products, and the data transfer is flexible and convenient.
In order to ensure that the data can be safely restored, data backup should choose at least two ways. Through the analysis, comparison and summary of three commonly used backup methods for Informix-Online database, users can choose the backup method that suits their needs according to the actual situation to ensure the safe recovery and transfer of data.
This is the answer to the question about how to back up the Informix-Online database. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.