Informix Online Database Maintenance tips

Source: Internet
Author: User
Tags informix backup

The establishment of database query user

Informix_on_line database As a result of storing a large number of important information of depositors, for the security of the database must have strict rules on the operation of the data, such as access to the On_line database to perform strict procedures, which in some cases to find problems caused inconvenience, Therefore, it is necessary to set up a dynamic query user, the user only has the read access to the database. The following measures are:

1. Create a query user, the user should have the environment of database use

2. Connect the query user to the database (for example, work users)

Ln-s/homel/work/homel/read (connect the query user read with the database user);

3. Using the database by the work user, the Connect permission is given to read user grant connect to read;

4. Select right for each table in the database to read user

Grant SELECT on ABC to read. (Assign select permission to read user)

In this way, the read user registration, the database has a readable operation, to find problems such as easy to bring.

Second, database consistency check

a.以informix登录
b.将数据库状态置为off_line
  onmode-ky
用onstat-检查数据库状态为off_line
c.将数据库状态置为单用户模式
onmode -s
用onstat-检查数据库状态为quiesent
d.检查数据库保留页状态
oncheck-cr 1>/tmp/oncheck.cr 2>&1
e.检查数据库目录页一致性
oncheck-cc 1 >/tmp/oncheck.cc 2>&1
f.检查数据库数据的一致性
oncheck-cD workdb 1>/tmp/oncheck.cd 2>&1
g.检查数据库索引的一致性
oncheck-cI workdb 1>/tmp/oncheck.ci 2>&1
h.检查/tmp下oncheck.cr,oncheck.
cc,oncheck.cd,oncheck.ci文件,
查看有无错误信息,如没有,
则数据库状态正常,反之亦然。
i.将数据库状态置为online
onmode-m
用onstat-检查数据库状态为online

Third, database backup and recovery

1.dbexport Backup and Dbexport recovery

Dbexport Backup is a stylistic file backup, the backup will be the information in the database as a text file, to note that the backup must ensure that there is no visitors to the database, otherwise do Dbexport will not succeed, dbexport the general format of the backup (in the case of database workdb)

dbexport workdb-d -s workdbs /path
2.dbimport恢复是将用dbexport备份的文件恢复到数据库中
a.停止一切数据库操作→删除数据库;
b.$dbimport workdb-d workdbs -i/path;
c.用工具onmonitor将参数TAPEDEV改为/dev/null;
d.ontap -s -u workdb.
廯 e.检查workdb是否改为U状态.
f.将TAPEDEV值改回原先的值

It should be pointed out that in the dbimport recovery process, there is a lot of information to write in the logical log file, in this way, can avoid writing logical log files, speed up the dbimport.

3. Database Level 0 Backup

Database level 0 Backup is an important backup tool, regular tape backup, often used to do major operations before the backup, the data often need to restore, and tape 0 backup data due to the large amount of data, the recovery takes a long time, so you can use the hard disk to do 0-level backup method.

A. Draw a large enough space on your hard disk for the storage of your files.

B. Use Onmonitor to point the parameter Tapedev reformulation to the level 0 backup file.

If the/cs2000 in the 0-level backup file Oback storage space, you can change the parameters to Tapedev=/cs2000/oback, which can do a hard drive level 0 backup, backup recovery time is only 1/6 of the tape drive. The tail-f online.log should be monitored during the recovery process. Restore the process until the database status becomes online ...

C. Change the parameter tapedev=/cs2000/oback to taredev=/dev/rmt/0m;

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.