Tuesday, May 20, 2014

Netezza Backup History

Managing Netezza backup is not that flexible.  While you can get the backup history from nzbackup -history, there's nothing much you can do.  So, you still need to go the the catalog level and play with it.  Below is the query to get all the backup history from the catalog

select dbname, decode(type,0,'FULL',1,'DIFF',2,'CUM',4,'SCHEMA') TYPE,  
decode(status,0,'ACTIVE',1,'COMPLETED',2,'FAILED') STATUS,
date_trunc('day',starttime) start_date,
date_trunc('hour',starttime) start_time
from _t_backup_history
order by 3,4

Below describes the code and its meaning from the backup history catalog.

type 0 - Full
     1 - Diff
     2 - Cum
     3 - none
     4 - Schema

status 0 - Active
         1 - Completed
 2 - Failed

Monday, May 19, 2014

of nzsql, nzload and nz_migrate

Many times I have to run data refresh between Production to Development to unload and load data for testing,development SIT and UAT.  There are two methods which I used.  First option is nzsql and nzload.  Second is nz_migrate which is the easiest and most flexible.


nzsql -u <USERNAME> -pw <PASSWORD> -d <DATABASE> -host <HOSTNAME> -A -t -F{ -f <SQL_FILE>.sql -o <SQL_OUTPUT>.dat

-A - Unaligned table output mode (-P format=unaligned)
-t - Print rows only (-P tuples_only)
-F - delimiter

nzload -host <HOSTNAME> -db <DATABASE> -u <USERNAME> -pw <PASSWORD> -t <TABLE_NAME> -df <SQL_OUTPUT>.dat -delim "{" -dateDelim "-" -dateStyle "YMD" -nullValue ''

nz_migrate
The command can be run either from source or target host.  Make sure the parameter value is correct.  Otherwise, you will be overwriting your Production source.

nz_migrate -shost <SOURCE_HOST> -thost <TARGET_HOST>
-sdb <SOURCE_DATABASE>
-tdb <TARGET_DATABASE>
-stable <SOURCE_TABLE>
-ttable <TARGET_TABLE>
-suser <SOURCE_USERNAME> -spassword <SOURCE_PASSWORD>
-tuser <TARGET_USERNAME> -tpassword <TARGET_PASSWORD>
-CreateTargetTable y -TruncateTargetTable n CreateTargetDatabase n -threads 4

Sunday, May 18, 2014

About Netezza Skimmer, TwinFin12 and TwinFin48

First entry on Netezza. I've been working on Netezza since 2012. The Netezza is hosting our Business Intelligence DW using TDW model. We have Skimmer, TwinFin12 and TwinFin48. Some info for Skimmer, TF12 and TF48 below:

nzstats

Skimmer

Model IBM Netezza 100-1
Num SFIs 0 
Num SPAs 1 
Num SPUs 1 
Num Data Slices 8

TwinFin12
 
Model IBM PureData System for Analytics N1001-010 
Num SFIs 0 
Num SPAs 2 
Num SPUs 12 
Num Data Slices 92

TwinFin48
Model IBM PureData System for Analytics N1001-040 
Num SFIs 0 
Num SPAs 8 
Num SPUs 56 
Num Data Slices 368