Today, we will focus on the actual application code for backing up and recovering DB2 databases in Linux, I saw data on the actual application code of the DB2 database backup and recovery in the Linux environment on the relevant website two days ago. I thought it was good and I would like to share it with you.
Linux, environment, database Linux, database, Environment
Restore the database backed up by the following backup script
DB2 database backup script:
- ./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. I hope you will have some gains.
The above content is an introduction to the backup and recovery of the DB2 database in the Linux environment. I hope you will have some gains.