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