步骤1.做一个全备
·db2 terminate
·db2 force
application all
·db2 backup database
sample to /oracle/log_archive
步骤2.模拟故障
·db2
terminate
·db2 force
application
·db2 drop database sample
尝试连接到数据库
·db2 connect to
sample
会接收到如下错误
SQL1013N The database alias
name or database name "SAMPLE" could not be
found.
SQLSTATE=42705
步骤3.创建一个新的数据库
创建的数据库要和原先被删除的数据库的名字一样
·db2 create database sample
确保数据库被创建
·db2 list db directory
步骤4.还原数据库
还原备份片
·db2 restore database sample from
/oracle/log_archive taken at 20141030164120 into sample
会收到如下提醒:
SQL2523W Warning! Restoring to an
existing database that is different from
the database
on the backup image, but have matching