First of all, the general situation is that the current production environment (AIX server) has a database product, now want to migrate to the local test environment, because the local server is only Linux server, so you can not directly use Backup and restore recovery. Need to use Db2look and db2move to implement the migration process, this operation is applicable to the migration between various operating systems.
First of all, these are done on the AIX server
1. Use Db2look to export the DDL statements of the product database on AIX.
db2look-d product-a-e-o Product.sql
The output results are:
aix:/home/db2inst1$ db2look -d product-a -e -o product.sql
-- Generate statistics for all creators
-- Creating DDL for table(s)
-- Output is sent to file: product.sql
2. Export IXF and MSG files using the Db2move command
Db2move PDM Export
The screen output resembles the following information
***** DB2MOVE *****
Action: EXPORT
Start time: Tue Mar 11 01:26:43 2008
Connecting to database PRODUCT... successful! Server: DB2 Common Server V8.2.1
EXPORT: 4 rows from table "PROCORE "."PLAN_MASTER"
EXPORT: 3 rows from table "PROCORE "."PERIOD_MASTER"
EXPORT: 3849 rows from table "PROCORE "."PLAN_OBJ"
EXPORT: 26176 rows from table "PROCORE "."REGION"
EXPORT: 340 rows from table "PROCORE "."CTY_MASTER"
After the system is done, a bunch of. IXF and. msg files are generated.
3. Create a directory on the local or target machine (Linux) such as Product,product.sql and the files generated in the previous step are FTP over.
ftp servername
bin
prompt off
mget *
close
quit
Can
4. Create a new database locally the original AIX database has the same name as product
create DATABASE "PRODUCT"
ON ’/home/db2inst1/’
ALIAS "PRODUCT"
USING CODESET ISO8859-1
TERRITORY US
COLLATE USING Compatibility
NUMSEGS 1
DFT_EXTENT_SZ 32;
5. Create all the tables in this database and use the DDL statements generated in the first step to generate
DB2–VTF Product.sql
6. Last step, import all data
Db2move Product Import
Note: This command is to be executed in the directory of those files (*.ixf *.msg) that come down from the third small download
Test DB2 connect to product;
If you see successful information, the DB2 database is successfully migrated from Aix to Linux.