电脑技术学习

DB2数据库部分日常实用操作

dn001

  15、数据库恢复的处理

  进行数据库恢复的时候使用以下的命令:

  以下是引用片段:


  restore db db1 to /tstdb2/catalog into db newlogpath /tstdb2/db2log buffer 2048
  replace existing redirect parallelism 16;
  set tablespace containers for 1 using (path '/tstdb2/db2tmp');
  set tablespace containers for 2 using
  (device '/dev/rtstcontlv00' 2621440, device '/dev/rtstcontlv01' 2621440,
  device '/dev/rtstcontlv02' 2621440, device '/dev/rtstcontlv03' 2621440 ) ;
  restore db db1 continue;


  恢复完成以后执行命令db2s时报如下的错误
  以下是引用片段:


  P570:>db2s
  SQL1117N A connection to or activation of database "DB" cannot be made
  because of ROLL-FORWARD PENDING. SQLSTATE=57019
  DB21034E The command was processed as an SQL statement because it was not a
  valid Command Line Processor command. During SQL processing it returned:
  SQL1024N A database connection does not exist. SQLSTATE=08003


  解决办法如下:

  以下是引用片段:


  P570:>db2 rollforward db db to end of logs and complete
  Rollforward Status
  Input database alias = db
  Number of nodes have returned status = 1
  Node number = 0
  Rollforward status = not pending
  Next log file to be read =
  Log files processed = -
  Last committed transaction = 2005-11-20-10.59.23.000000
  DB20000I The ROLLFORWARD command completed successfully.


;