DB2 Restore backup DB2 database with different database name

Problem

  • I want to Restore backup to another DB2 database with different database name.

Solution

  • Command Pattern
    - [Restore Database name] - original database name
    - [Current Restore Directory] - location of original database backup file
    - [Timestamp Of Full Backup] - Timestamp of original database name
    - [New Database directory] - New Path for New Database
    - [New Database Name] - new name of Database
db2 "RESTORE DATABASE [Restore Database name] FROM [Current Restore Directory] TAKEN AT [Timestamp Of Full Backup] TO [New Database directory] INTO [New Database Name]"
  • Example
db2 "RESTORE DATABASE BFMDB FROM /db2backupbfmdb/ TAKEN AT
20200703141925 TO /db2inst1/BFMIF9P/ INTO BFMIF9P"

db2 "ROLLFORWARD DB BFMIF9P TO END OF LOGS AND COMPLETE"

Another DB2 Step for Restore DB (In Thai) [DB2] Restore แบบ WITHOUT ROLLING FORWARD; แล้ว Error SQL1035N | naiwaen@DebuggingSoft


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.