This article will introduce you to the actual application code for DB2 database backup and recovery in Linux, and the DB2 database backup script for your reference. I hope it will help you:
./Home/db2admin/sqllib/db2profile
Db2 backup db datedb online to/dbbackup/date include logs
Cd/dbbackup/datetoday = 'date + "% Y % m % d "'
File1 = "* $ today *" ftpfile = 'ls $ file1'
Echo $ ftpfile lftp-c "open ftp address; user
Username and password @ $0; put $ ftpfile"
Find/dbbackup/date-ctime + 15-exec rm {}; Recovery command:
Log on to the server using the root command and switch to the database user name using the su-db2admin command.
Go to the backup file storage directory
Run the following command:
[Db2admin @ localhost db2back] $ db2 restore db datedb from/hom
The above content is an introduction to the backup and recovery of the DB2 database in the Linux environment, hoping to help you gain some benefits.