Tuesday, February 21, 2017

nz_migrate - Migrating data from one netezza box to another (or same) box


nz_migrate 

Purpose of  this command is to copy or migrate data from one one NPS server to another. It can be also used to make a copy of a database/table on the same server.


Sample Command : 
./nz_migrate -shost <source Host name>  -thost <Target Host name> -sdb  <Source Database Name> -tdb  <Target Database Name> -suser  <Source User Name> -spassword <Source Password> -tuser <Target User Name> -tpassword <Target Password>  -t <list of tables , seperated by comma. >   -cksum fast -genStats Full -threads 5  -CreateTargetTable yes -CreateTargetDatabase yes   >> /tmp/nz_migrate_0220_3.log &


If you are want to migrate all table under database (don't mention -t flag) -

./nz_migrate -shost <source Host name>  -thost <Target Host name> -sdb  <Source Database Name> -tdb  <Target Database Name> -suser  <Source User Name> -spassword <Source Password> -tuser <Target User Name> -tpassword <Target Password>    -cksum fast -genStats Full -threads 5  -CreateTargetTable yes -CreateTargetDatabase yes   >> /tmp/nz_migrate_0220_3.log &



If you are migrating data to new box, I will recommend you to run this command on new box. If you run this command on new box, it will save some memory and processing of your old box.


Note : You might get some error message saying "group/user "username" not found, "function 'COVAR_POP(FLOAT8, FLOAT8)' does not exist" , ignore it while doing the migration. These errors might not have any impact on data transfer.


1 comment:

  1. can we use nz_migrate in live conditions whille sessions are running?

    ReplyDelete