1.列出备份:
ls -l /db2_backups
- 总字节数:549014184
- 文件列表:
-rw-r----- 1 db2inst1 1004 21 Jan 21 16:16 ISIMDB.0.db2inst1.DBPART000.20250121155030.001
因为/opt剩余空间1T,能放下500G的数据库,
2.新建一个目录
sudo mkdir /opt/isimdb
sudo chown db2inst1:db2iadm1 /opt/isimdb
3.切换到db2inst1
su – db2inst1
4.执行数据库恢复命令
db2 restore db ISIMDB from /db2_backups taken at 20250121155030 to /opt/isimdb redirect without prompting
输出:SQL1277W A redirected restore operation is being performed. During a table space restore, only table spaces being restored can have their paths reconfigured. During a database restore, storage group storage paths and DMS table space containers can be reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
5.设置存储组路径
db2 “SET STOGROUP PATHS FOR IBMSTOGROUP ON ‘/opt/isimdb'”
输出:DB20000I The SET STOGROUP PATHS command completed successfully.
6.继续恢复
db2 restore db ISIMDB continue