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"