DB2 table-level backup method

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

Database backup is a key part that DBAs need to master. The following describes how to implement table-level backup for DB2 databases for your reference. I hope you will be enlightened.

Sometimes backing up a full database is quite painful for data in a data warehouse. We used TOVILI support in our production environment, and now we switched to VERITAS and didn't purchase the DB2 client. It is troublesome to back up the full database, therefore, we want to implement table-level backup.

Platform: WIN2000; DB2 UDB V8.2; Database

1. F: DAILYDailyExportStmtGen. SQL:
After a SELECT statement is written, an error is always prompted. For details about this statement, see section 1;
2. Compile backup batch files
C: WINNTSYSTEM32Daily_dwbak.bat

@ ECHO OFF

Set dst = % date :~ 4,4% % date :~ 9,2% % date :~ 12,2%

If exist F: dailybackup goto creat_dst

Md F: dailybackup

: Creat_dst

If exist F: dailybackup \ % dst % goto db2_export

Md F: dailybackup \ % dst %

: Db2_export

Db2batch-d dwdb-a db2inst2/ibmdb2-f F: dailyDailyExportStmtsGen. SQL-s OFF-q ON> F: dailyDailyExportScript. SQL

Db2 connect to dwdb user db2inst2 using ibmdb2

Db2-vf F: dailyDailyExportScript. SQL

Db2 connect reset

: Copy_src

Move F: daily *. ixf F: dailybackup \ % dst %

F: Dailyarj284arj a-r F: dailybackup \ % dst %. arj F: dailybackup \ % dst %

Del F: dailybackup \ % dst % *. */S/Q

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.