Backup and recovery of DB2 databases in Linux

Source: Internet
Author: User

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.
 

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.