In DB2 offline database backup can be taken through below command
$db2 backup database <database name>
Backup successful. The timestamp for this backup image is : <snapshot id>
In DB2 offline database restoration can be do through below command
$db2 "restore db <database name> from <location-doesn’t require to include backup file name> taken at <snapshot id> on <directory of database> into <database name> redirect without prompting"
Online database backup can be taken through below command
$db2 backup database <database name> ONLINE to <location to store backup> INCLUDE LOGS
Online database backup restoration command
db2 RESTORE DATABASE <database name> FROM <backup_dir> LOGTARGET <log_dir>