DB2 offline backup and recovery

Source: Internet
Author: User
Tags db2 connect db2 connect to quiesce

The simplest command for offline DB2 backup can be: db2 backup db sample to c: \ db2bak, but which of the following is so simple during the actual regular backup, I have compiled scripts for timed offline backup in UNIX/Linux and Windows. very useful.UNIX/Linux:1. Create a directory and authorize it to store the backup file [root @ O11g64 tmp] #Id db2inst1Uid = 1051 (db2inst1) gid = 1010 (db2iadm1) groups = 1010 (db2iadm1), 1020 (db2fadm1)Mkdir/db2bakChown-R db2inst1: db2iadm1/db2bak2. Create the BAT file db2bkoffline. sh.

# Author: xiongchuanliang # Pause database db2 connect to xcldbdb2 quiesce database immediate force connectionsdb2 connect reset # Disconnect all applications db2 force application all # offline backup db2 backup db xcldb to "/db2bak" with 2 buffers buffer 1024 parallelism 1 without prompting # cancel database pause db2 connect to xcldbdb2 unquiesce databasedb2 connect resetexit

3. Authorization Chmod a + x/tmp/db2bkoffline. sh4. Run backup Su-db2inst1-c "/tmp/db2bkoffline. sh">/db2bak/db2bkoffline. log Windows:1. Create the BAT file db2bkoffline. bat
; Author: xiongchuanliang; pause database db2 connect to xcldbdb2 quiesce database immediate force connectionsdb2 connect reset; disconnect all applications db2 force application all ;; offline backup of db2 backup db xcldb to "c: \ db2bak" with 2 buffers buffer 1024 parallelism 1 without prompting; cancel database pause db2 connect to xcldbdb2 unquiesce databasedb2 connect resetexit;
2. Run backup Db2cmd/c/w/I db2bkoffline. bat> c: \ db2bkoffline. log
Parameter description: -- 2 buffers: two caches -- buffer 1024: the cache size is 1024 -- parallelism 1: parallelism. When these parameters are backed up, DB2 will be automatically adjusted to the relevant value if they are not specified.
Offline backup recoveryIt is also very simple Db2 list history backup all for xcldb Db2 resotre db xcldb from/db2bak taken at Timestamp
MAIL: xcl_168@aliyun.comBlog: http://blog.csdn.net/xcl168

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.