This content originally appeared on DEV Community and was authored by Eduardo Issao Ito
Creating the backup
Exporting DDL from EXAMPLE schema:
db2look -d MYDB -z EXAMPLE -e -o EXAMPLE.sql
Exporting data from schema:
db2move MYDB export -sn EXAMPLE
The db2move
command will create a lot of files, incluing db2move.lst
.
It contains internal tables like EXPLAIN_* and ADVISE_*. If you don't need them just delete de corresponding lines from db2move.lst
.
Restoring backup
Creating objects:
db2 -t -f EXAMPLE.sql
Restoring data:
db2move MYDB import
db2move MYDB import -io insert_update
This content originally appeared on DEV Community and was authored by Eduardo Issao Ito

Eduardo Issao Ito | Sciencx (2022-04-14T13:07:58+00:00) DB2 backup/restore schema. Retrieved from https://www.scien.cx/2022/04/14/db2-backup-restore-schema/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.