Implementation of Automatic Backup in HA dual-host environment

Source: Internet
Author: User
Db2 instances and databases are installed on shared disks. To back up the DB2 database by using the crontab scheduled task, because it is in the HA environment, consider the feet on the two machines.

Db2 instances and databases are installed on shared disks. To back up the DB2 database by using the crontab scheduled task, because it is in the HA environment, consider the feet on the two machines.

Db2 instances and databases are installed on shared disks. To use a crontab scheduled task to back up the DB2 database, because it is in the HA environment, you must consider the scripts on the two machines.

Edit crontab and set scheduled tasks
Log on to the system as a root user
Crontab-e: edit a definition task
0 4 ** 6/script/backup 1>/dev/null 2>/dev/null # Full backup database on every Saturday
You need to edit crontab-e on both machines.
The/script/backup script is run on both hosts.


/Script/backup script content
If [-f/home/db2inst/sqllib/backupdb]; then
Su-db2inst "-c/home/db2inst/sqllib/backupdb"
Fi

/Home/db2inst/sqllib/backupdb is located on the shared disk. The script determines that/home/db2inst/sqllib/backupdb is executed if it exists. Otherwise, it will not be executed. Because resources under HA can only be owned by one machine, only one machine has/home/db2inst/sqllib/backupdb at the same time.
The database backup script is in/home/db2inst/sqllib/backupdb.

/Home/db2inst/sqllib/backupdb only has one simple sentence:
Db2 "backup database test online to/backup/backupdata"

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.