Thursday 17 October 2013

DB2 Backup and Restore commands

It is very common in projects to keep the backup of database and restoring the new copies of database. Following are the two commands which will be helpful in backup and restore of database

DB Backup :

  • Open db2cmd prompt
  • Navigate to the directory where you want to take the backup of your database
  • Enter the command db2 backup db DBNAME compress  (Replace DBNAME with your database name)
DB Restore: 

  • Open db2cmd prompt
  • Navigate to the directory where your database copy exists or the database which you want to restore
  • Enter the command db2 restore db DBNAME (Replace DBNAME with your database name)

Note : Sometimes after restore of the database WC Server might not start properly. In such cases do a setdbtype and the server will start properly