The implementation of DB2 database backup and recovery is in the Linux environment

Source: Internet
Author: User

This article describes how to back up and restore a DB2 database in a Linux environment. The following article describes how to back up and restore a DB2 database in a Linux environment, I hope it will help you in this regard.

Solution, Linux, environment, database Linux, database, Environment

Restore the database backed up by the following backup script

Backup script:

 
 
  1. ./Home/db2admin/sqllib/db2profile
  2. Db2 backup db datedb online to/dbbackup/date include logs
  3. Cd/dbbackup/datetoday = 'date + "% Y % m % d "'
  4. File1 = "* $ today *"
  5. Ftpfile = 'ls $ file1'
  6. Echo $ ftpfile
  7. Lftp-c "open ftp address; user username and password @ \ $0; put $ ftpfile"
  8. 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:

 
 
  1. [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 describes the backup and recovery of the DB2 database in the Linux environment, hoping to provide you with some help in this regard.

Related Article

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.