db database restore redirect

写这篇文章,只是想把自己遇到的问题做个记录,方便以后查询和跟踪.

 

参考文章如下:http://space.itpub.net/267386/viewspace-371901

 

数据库是DB29.5

数据库配置信息:logretain on,tracemod on,userexit on

 

起因:项目需要把数据库迁移到另外一台服务器上(全部为AIX系统)

 

1.在线备份需要迁移的数据库B37R2,同时把LOG文件COPY出来.

   查看日志文件可用 db2 get db cfg for B37R2

2.set tablespace container

如下:

   set tablespace containers for 0 using (file "/app/db2inst1/db2inst1/NODE0000/B37R2/T0000000/C0000000.CAT" 24576);

3.把备份文件及日志文件FTP到目标服务器

4.整理SQL文件.内容如下:

restore database B37R2 from /app/db2inst1/backup/DBS/DBS_1.0.0/20100512/ on /app/db2inst1 into B37R2 REDIRECT;
set tablespace containers for 0 using (file "/app/db2inst1/db2inst1/NODE0000/B37R2/T0000000/C0000000.CAT" 24576);

.....

restore database B37R2 continue;
rollforward db B37R2 to end of logs and stop overflow log path '(/app/db2inst1/backup/DBS/DBS_1.0.0/20100512/log)';

  

5.db2 -tvf  *.sql

 

你可能感兴趣的:(sql,.net,db2,AIX)