cross clmn

Thursday 26 May 2016

Check Environment details on IBM Netezza



Check Environment details on IBM Netezza 

HPF version: 

cat /nzlocal/scripts/version.txt    

MODEL 

cat /nzlocal/scripts/model                   

FDT version :      
                                               
head -2 /opt/Netezza/FW/PSeries/version.txt                          
head -2 /opt/nz/fdt/version.txt    
                               
RedHat version:                                                      
lsb_release -i -r    
                                             
As nz user:                                                          
NPS version:
nzrev                          
                        
Current System Stats: nzstats  
Hardware stataus  
nzhw -issues
nzds -issues
                             
As root user:                                                        
uname -n        


model of the system                                                      
dmidecode -t 1  

Callhome                                                
cat /nz/data/config/callHome.txt   

Thursday 19 May 2016

Netezza Database refresh from prod to Dev --- Incremental Refresh nzbackup nzrestore

Netezza Database refresh from prod to Dev --- Incremental Refresh nzbackup nzrestore

1. Once We have done with full backup and restore, Then we may start incremental backup and restore .

Incremental backup 
crontab Entry:-
1 * * * * /export/home/nz/scripts/refresh/incr_backup_refresh.sh PMACDW      > /dev/null 2>&1

######################Incremental Backup shell script #######################
#!/bin/sh
##Pass Database name with space
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
email_list="EDW_Support@gmail.com"
DBA="NZRed@gmail.com,EDW_Support@gmail.com"
echo "Please call DBA , If It's not acknowledged by DBA" > /tmp/massage.log
HOST=`hostname`
if [ $# > 0 ]; then
    i=$1
    DBNAME=$(nzsql -l|grep -w $i |awk '{ print $i}'|cut -d '|' -f1|cut -d " " -f2)
    if [ $i = "$DBNAME" ]; then
                DBNAME=$i
                DB=$DBNAME
                DB=`echo "${DB,,}"| cut -c 2-`
                BKTP=DIFF
                DB_TYPE=PROD
                LOG_DIR=/export/home/nz/scripts/log
                LOG=$LOG_DIR/$DBNAME_backup_`hostname`_`date +%y%m%d%H%M%S`.log
                BKP_LOG_DIR=/nz/kit/log/backupsvr/
                file1=/nz/$DB/triggers/$DB.done
                file1a=/nz/$DB/triggers/$DB.wip
                file1b=/nz/$DB/triggers/$DB.bkup_done
                file1c=/nz/$DB/triggers/$DB.bkup_aborted
                ########checking logfile status
                if [ -f "$file1" ]; then
                        echo " Initiate incremental backup - trigger file available" > $LOG
                        mv $file1 $file1a
                        echo "incremental  backup of Database $DBNAME" >>$LOG
                 #######Backup
                NOW=$(date +"%Y-%m-%d")
                nzbackup -u admin -db $DBNAME -connector netbackup -connectorArgs "DATASTORE_SERVER=edp-nbu-120-ap:DATASTORE_POLICY=phx_netezza"  -differential -streams 8 -v  >>$LOG
                        if [ $? -ne 0 ]; then
                                cat /tmp/massage.log | mailx -s "FAILED:Backup(Refresh) NZ  $DBNAME $BKTP Database Backup on  $HOST " -a $LOG $DBA
                                 mv $file1 $file1c
                        else
                                BKPSTS=$(nzsql  -qc  "SELECT  status  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                BKPLOG=$(nzsql  -qc  "SELECT  logfile  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                STATUS=`echo $BKPSTS|cut -d " " -f3`
                                LOGFILE=`echo $BKPLOG|cut -d " " -f3`
                                cd $BKP_LOG_DIR
                                BKP_DT=`echo $LOGFILE|cut -d "." -f3`
                                echo $BKP_DT
                                        if [ $BKP_DT = $NOW ] && [ $STATUS = "COMPLETED" ]; then
                                                cat $BKP_LOG_DIR/$LOGFILE | mailx -s "SUCCESS:$DB_TYPE NZ  $DBNAME $BKTP Database Backup on  $HOST " $email_list
                                                /bin/touch /dbbackup/refresh_trigger/bnr/.incr_bkups_$DBNAME.done
                                                mv $file1a $file1b
                                        else
                                        cat /tmp/massage.log | mailx -s "FAILED:Backup(Refresh)NZ $DBNAME $BKTP Database Backup on  $HOST " -a $BKP_LOG_DIR/$LOGFILE $DBA
                                        mv $file1a $file1c
                                        fi
                        fi
                        else
                        echo "Triiger file does not exist `date`" > $LOG
                        exit;
                        fi
    else
     echo "$i Database does not exist on $HOST"| mailx -s "Notification:$DB_TYPE  NZ $i  Database Backup failed on  $HOST " $DBA
    fi
else
echo "Please specify database name " >>$LOG
exit 1;

fi


################################################################################
Incremental Restore Script to Refresh 
################################################################################
Crontab Entry 

/export/home/nz/scripts/refresh/incr_restore_refresh.sh PMACDW 

#############################################################################
#!/bin/sh
##Pass Database name with space
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
email_list="EDW_Support@gmail.com"
DBA="NZRed@gmail.com,EDW_Support@gmail.com"
HOST=`hostname`
if [ $# > 0 ]; then
    i=$1
    DBNAME=$(nzsql -l|grep -w $i |awk '{ print $i}'|cut -d '|' -f1|cut -d " " -f2)
    if [ $i = "$DBNAME" ]; then
                DBNAME=$i
                DB=$DBNAME
                DB=`echo "${DB,,}"`
                BKTP="INCR:REST"
                DB_TYPE=DEV
                LOG_DIR=/export/home/nz/scripts/log
                LOG=$LOG_DIR/$DBNAME_restore_`hostname`_`date +%y%m%d%H%M%S`.log
                RST_LOG_DIR=/nz/kit/log/restoresvr/
               file1=/dbbackup/refresh_trigger/bnr/.incr_bkups_$DBNAME.done
               file1a=/dbbackup/refresh_trigger/bnr/.incr_restore_$DBNAME.wip
               file1b=/dbbackup/refresh_trigger/bnr/incr_restore_$DBNAME.done
               file1c=/export/home/nz/dba/scripts/bnr/.incr_restore_$DBNAME.abort
                ########checking logfile status
                if [ -f "$file1" ]; then
                echo " Initiate incremental restore - trigger file available" >> $LOG
                mv $file1 $file1a
                echo "Starting incremental restore of Database $DBNAME" >>$LOG
                 #######Restore
                NOW=$(date +"%Y-%m-%d")
                nzrestore -db $DBNAME -sourcedb $DBNAME  -connector netbackup -connectorArgs DATASTORE_SERVER=edp-nbu-120-ap  -streams 8 -v  -npshost 7836279-H1 -increment REST -lockdb T >>$LOG
                        if [ $? -ne 0 ]; then
                              echo "FAILED:$BKTP Refresh $DBNAME Database on $HOST "| mailx -s "FAILED:$BKTP Refresh NZ  $DBNAME $BKTP Database Restore on  $HOST " -a $LOG $DBA
                              mv -f $file1a $file1c
                        else
                                RSTSTS=$(nzsql  -qc  "SELECT  status  FROM  _v_Restore_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_Restore_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                RSTLOG=$(nzsql  -qc  "SELECT  logfile  FROM  _v_Restore_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_Restore_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                STATUS=`echo $RSTSTS|cut -d " " -f3`
                                LOGFILE=`echo $RSTLOG|cut -d " " -f3`
                                cd $RST_LOG_DIR
                                RST_DT=`echo $LOGFILE|cut -d "." -f3`
                                echo $RST_DT
                                        if [ $RST_DT = $NOW ] && [ $STATUS = "COMPLETED" ]; then
                                                cat $RST_LOG_DIR/$LOGFILE | mailx -s "SUCCESS:$BKTP Refresh NZ  $DBNAME Database  on  $HOST " $email_list
                                             #   /bin/touch /dbbackup/refresh_trigger/bnr/.full_bkups_$DBNAME.done
                                                mv -f $file1a $file1b
                                        else
                              echo "FAILED:$BKTP Refresh $DBNAME Database on $HOST "| mailx -s "FAILED:$BKTP NZ Refresh $DBNAME Database Restore on  $HOST " -a $RST_LOG_DIR/$LOGFILE $DBA
                                        mv -f $file1a $file1c
                                        fi
                        fi
                        else
                        echo "Triiger file does not exist `date`" > $LOG
                        exit;
                        fi
    else
     echo "$i Database does not exist on $HOST"| mailx -s "Notification:$DB_TYPE  NZ $i  Database Restore failed on  $HOST " $DBA
    fi
else
echo "Please specify database name " >>$LOG
exit 1;
fi

Netezza Database refresh from prod to Dev --- Full Refresh nzbackup nzrestore

1. Using backup scirpt it will take backup of database specified after trigger file found and it will create a trigger file on dev to start restore PMACDW  database.

crontab Entry try every 15 min and wait for trigger file

00,15,30,45 4-10 * * 6 /export/home/nz/scripts/refresh/full_backup_refresh.sh PGCIDWSEC   > /dev/null 2>&1
#############################Full Backup script#################################

#!/bin/sh
##Pass Database name with space
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
email_list="EDW_Support@gmail.com"
DBA="NZRed@gmail.com,EDW_Support@gmail.com"
echo "Please call DBA , If It's not acknowledged by DBA" > /tmp/massage.log
HOST=`hostname`
if [ $# > 0 ]; then
    i=$1
    DBNAME=$(nzsql -l|grep -w $i |awk '{ print $i}'|cut -d '|' -f1|cut -d " " -f2)
    if [ $i = "$DBNAME" ]; then
                DBNAME=$i
                DB=$DBNAME
                DB=`echo "${DB,,}"| cut -c 2-`
                BKTP=FULL
                DB_TYPE=PROD
                LOG_DIR=/export/home/nz/scripts/log
                LOG=$LOG_DIR/$DBNAME_backup_`hostname`_`date +%y%m%d%H%M%S`.log
                BKP_LOG_DIR=/nz/kit/log/backupsvr/
                file1=/nz/$DB/triggers/$DB.done
                file1a=/nz/$DB/triggers/$DB.wip
                file1b=/nz/$DB/triggers/$DB.bkup_done
                file1c=/nz/$DB/triggers/$DB.bkup_aborted
                ########checking logfile status
                if [ -f "$file1" ]; then
                        echo " Initiate incremental backup - trigger file available" > $LOG
                        mv $file1 $file1a
                        echo "Starting Full backup of Database $DBNAME" >>$LOG
                 #######Backup
                NOW=$(date +"%Y-%m-%d")
                nzbackup -u admin -db $DBNAME -connector netbackup -connectorArgs "DATASTORE_SERVER=edp-nbu-120-ap:DATASTORE_POLICY=phx_netezza"  -streams 8 -v  >>$LOG
                        if [ $? -ne 0 ]; then
                                cat /tmp/massage.log | mailx -s "FAILED:Backup(Refresh) NZ  $DBNAME $BKTP Database Backup on  $HOST " -a $LOG $DBA
                                                                mv $file1 $file1c
                        else
                                BKPSTS=$(nzsql  -qc  "SELECT  status  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                BKPLOG=$(nzsql  -qc  "SELECT  logfile  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                STATUS=`echo $BKPSTS|cut -d " " -f3`
                                LOGFILE=`echo $BKPLOG|cut -d " " -f3`
                                cd $BKP_LOG_DIR
                                BKP_DT=`echo $LOGFILE|cut -d "." -f3`
                                echo $BKP_DT
                                        if [ $BKP_DT = $NOW ] && [ $STATUS = "COMPLETED" ]; then
                                                cat $BKP_LOG_DIR/$LOGFILE | mailx -s "SUCCESS:$DB_TYPE NZ  $DBNAME $BKTP Database Backup on  $HOST " $email_list
                                                /bin/touch /dbbackup/refresh_trigger/bnr/.full_bkups_$DBNAME.done
                                                mv $file1a $file1b
                                        else
                                        cat /tmp/massage.log | mailx -s "FAILED:Backup(Refresh)NZ $DBNAME $BKTP Database Backup on  $HOST " -a $BKP_LOG_DIR/$LOGFILE $DBA
                                        mv $file1a $file1c
                                        fi
                        fi
                        else
                        echo "Triiger file does not exist `date`" > $LOG
                        exit;
                        fi
    else
     echo "$i Database does not exist on $HOST"| mailx -s "Notification:$DB_TYPE  NZ $i  Database Backup failed on  $HOST " $DBA
    fi
else
echo "Please specify database name " >>$LOG
exit 1;
fi


################################################################################
2. After we get the trigger file on dev it will hit Full restore on DEV for PMACDW  database.
crontab 
00,15,30,45 5-11 * * 6 /export/home/nz/scripts/refresh/full_restore_refresh.sh PMACDW >/dev/null 2>&1

###############################Full Restore script ################################
#!/bin/sh
##Pass Database name with space
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
email_list="EDW_Support@gmail.com"
DBA="NZRed@gmail.com,EDW_Support@gmail.com"
HOST=`hostname`
if [ $# > 0 ]; then
    i=$1
    DBNAME=$(nzsql -l|grep -w $i |awk '{ print $i}'|cut -d '|' -f1|cut -d " " -f2)
    if [ $i = "$DBNAME" ]; then
                DBNAME=$i
                DB=$DBNAME
                DB=`echo "${DB,,}"`
                BKTP=FULL
                DB_TYPE=DEV
                LOG_DIR=/export/home/nz/scripts/log
                LOG=$LOG_DIR/$DBNAME_restore_`hostname`_`date +%y%m%d%H%M%S`.log
                RST_LOG_DIR=/nz/kit/log/restoresvr/
               file1=/dbbackup/refresh_trigger/bnr/.full_bkups_$DBNAME.done
               file1a=/dbbackup/refresh_trigger/bnr/.full_restore_$DBNAME.wip
               file1b=/dbbackup/refresh_trigger/bnr/.full_restore_$DBNAME.done
               file1c=/export/home/nz/dba/scripts/bnr/.full_restore_$DBNAME.abort
                ########checking logfile status
                if [ -f "$file1" ]; then
                ##This is to capture user sessions during LQC full restoration
                nzsession | grep $DBNAME  > /export/home/nz/cap_session
                #cat /export/home/nz/cap_session | mail -s "List of EDW-NTZ-LQC on $DBNAME user session on `date` " $email_list
                #End of user tracing during full restore set2

                # Kill users connected to dbs to be dropped
                for killpid in `nzsession | grep $DBNAME | awk '{print $1}'`; do
                echo "PID killed"
                echo $killpid
                nzsession abort -id ${killpid} -force
                done
                # Drop  database $DBNAME before restoring new ones
                /nz/kit/bin/nzsql < /export/home/nz/dba/scripts/bnr/dropdbs_$DBNAME.sql
                 if [ $? -ne 0 ]; then
                echo "DATABASE $DBNAME DROP COMMAND FAILED CAUSES EXISTING REFRESH,It will try again after 15 min."|mailx -s "FAILED:$BKTP Refresh NZ $DBNAME $BKTP Database Restore on $HOST"  $DBA
                exit;
                else
                 echo "DATABASE DROPPED"
                 fi
                echo " Initiate FULL restore - trigger file available" >> $LOG
                mv $file1 $file1a
                echo "Starting FULL restore of Database $DBNAME" >>$LOG
                 #######Restore
                NOW=$(date +"%Y-%m-%d")
                nzrestore -db $DBNAME -sourcedb $DBNAME  -connector netbackup -connectorArgs DATASTORE_SERVER=edp-nbu-120-ap  -streams 8 -v  -npshost 7836279-H1 -lockdb T >>$LOG
                        if [ $? -ne 0 ]; then
                            echo " FAILED:$BKTP Refresh NZ DB  $DBNAME  on  $HOST"| mailx -s "FAILED:$BKTP Refresh NZ DB $DBNAME  on  $HOST " -a $LOG $DBA
                            mv -f $file1a $file1c
                        else
                                RSTSTS=$(nzsql  -qc  "SELECT  status  FROM  _v_Restore_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_Restore_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                RSTLOG=$(nzsql  -qc  "SELECT  logfile  FROM  _v_Restore_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_Restore_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                STATUS=`echo $RSTSTS|cut -d " " -f3`
                                LOGFILE=`echo $RSTLOG|cut -d " " -f3`
                                cd $RST_LOG_DIR
                                RST_DT=`echo $LOGFILE|cut -d "." -f3`
                                echo $RST_DT
                                   if [ $RST_DT = $NOW ] && [ $STATUS = "COMPLETED" ]; then
                                   cat $RST_LOG_DIR/$LOGFILE | mailx -s "SUCCESS:$BKTP Refresh NZ  $DBNAME Database  on  $HOST " $email_list
                                   #/bin/touch /dbbackup/refresh_trigger/bnr/.full_bkups_$DBNAME.done
                                   mv -f  $file1a $file1b
                                   else
                                   echo "FAILED:$BKTP NZ Refresh DB $DBNAME on  $HOST " | mailx -s "FAILED:$BKTP NZ Refresh DB $DBNAME on  $HOST " -a $RST_LOG_DIR/$LOGFILE $DBA
                                   mv -f $file1a $file1c
                                   fi
                        fi
                        else
                        echo "Triiger file does not exist `date`" > $LOG
                        exit;
                        fi
    else
     echo "$i Database does not exist on $HOST"| mailx -s "Notification:$DB_TYPE  NZ $i  Database Restore failed on  $HOST " $DBA
    fi
else
echo "Please specify database name " >>$LOG
exit 1;
fi

Shell Script Incremental Backup on netezza Puredata IBM nzrestore

#Shell Script Incremental Backup on netezza Puredata IBM

#1* * * * /export/home/nz/scripts/refresh/incr_backup_refresh.sh PMACDW

#!/bin/sh
##Pass Database name with space
email_list="NZRed@gmail.com,GCIT-PHXNOC@gmail.com"
DBA="NZyellow@gmail.com"
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
HOST=`hostname`
echo "Please call DBA on call, If It's not acknowledged by DBA" > /tmp/massage.log
if [ $# > 0 ]; then
    for i in "$@"
        do
    DBNAME=$(nzsql -l|grep -w $i |awk '{ print $i}'|cut -d '|' -f1)
    if [ $i = $DBNAME ]; then
                DBNAME=$i
                BKTP=DIFF
                DB_TYPE=PROD
                LOG_DIR=/export/home/nz/scripts/log
                LOG=$LOG_DIR/$i_backup_`hostname`_`date +%y%m%d%H%M%S`.log
                BKP_LOG_DIR=/nz/kit/log/backupsvr/
        echo "Starting Incremental  backup of Database $DBNAME on `date +%y%m%d%H%M%S`" >$LOG
        #######Backup
          NOW=$(date +"%Y-%m-%d")
          nzbackup -u admin -db $DBNAME -connector netbackup -connectorArgs "DATASTORE_SERVER=edp-nbu-120-ap:DATASTORE_POLICY=phx_netezza" -differential -streams 8 -v >>$LOG
                        if [ $? -ne 0 ]; then
                                cat /tmp/massage.log | mailx -s "FAILED:$DB_TYPE NZ  $DBNAME $BKTP Database Backup on  $HOST " -a $LOG $email_list
                        else
                                BKPSTS=$(nzsql  -qc  "SELECT  status  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                BKPLOG=$(nzsql  -qc  "SELECT  logfile  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                STATUS=`echo $BKPSTS|cut -d " " -f3`
                                LOGFILE=`echo $BKPLOG|cut -d " " -f3`
                                cd $BKP_LOG_DIR
                                BKP_DT=`echo $LOGFILE|cut -d "." -f3`
                                echo $BKP_DT
                                        if [ $BKP_DT = $NOW ] && [ $STATUS = "COMPLETED" ]; then
                                                #cat $BKP_LOG_DIR/$LOGFILE | mailx -s "SUCCESS:$DB_TYPE NZ  $DBNAME Incremental Database Backup on  $HOST " $email_list
                                                echo "Backup Success"
                                        else
                                        cat /tmp/massage.log | mailx -s "FAILED:$DB_TYPE NZ $DBNAME Incremental Database Backup on  $HOST " -a $BKP_LOG_DIR/$LOGFILE $email_list
                                        fi
                        fi
    else
     echo "$i Database does not exist on $HOST"| mailx -s "Notification:$DB_TYPE  NZ $i  Database Incremental Backup failed on  $HOST " $DBA
    fi
    done
else
echo "Please specify database name " >>$LOG
exit 1;
fi

Netezza Full Backup on Puredata nzbackup

#Shell script for Netezza Full Backup on  Puredata
##Full database Backup  crontab entry
30 15 * * 1 /scripts/NZfullbackup.sh PCTGDM > /export/home/nz/scripts/log/NZfullbackup.log  2>&1
####################################################################
#!/bin/sh
##Pass Database name with space
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
email_list="NZRed@gmail.com,GCIT-PHXNOC@gmail.com"
DBA="NZyellow@gmail.com"
echo "Please call DBA on call, If It's not acknowledged by DBA" > /tmp/massage.log
HOST=`hostname`
if [ $# > 0 ]; then
    for i in "$@"
        do
    DBNAME=$(nzsql -l|grep -w $i |awk '{ print $i}'|cut -d '|' -f1)
    if [ $i = $DBNAME ]; then
                DBNAME=$i
                BKTP=FULL
                DB_TYPE=PROD
                LOG_DIR=/export/home/nz/scripts/log
                LOG=$LOG_DIR/$i_backup_`hostname`_`date +%y%m%d%H%M%S`.log
                BKP_LOG_DIR=/nz/kit/log/backupsvr/
        echo "Starting Full backup of Database $DBNAME" >$LOG
        #######Backup
                NOW=$(date +"%Y-%m-%d")
                nzbackup -u admin -db $DBNAME -connector netbackup -connectorArgs "DATASTORE_SERVER=edp-nbu-120-ap:DATASTORE_POLICY=phx_netezza"  -streams 8 -v  >>$LOG
                        if [ $? -ne 0 ]; then
                                cat /tmp/massage.log | mailx -s "FAILED:$DB_TYPE NZ  $DBNAME $BKTP Database Backup on  $HOST " -a $LOG $email_list
                        else
                                BKPSTS=$(nzsql  -qc  "SELECT  status  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                BKPLOG=$(nzsql  -qc  "SELECT  logfile  FROM  _v_backup_history     WHERE   optype='${BKTP}'    AND     dbname = '${DBNAME}'  AND     starttime = (SELECT MAX(starttime) FROM _v_backup_history where OPTYPE='${BKTP}' and DBNAME = '${DBNAME}');")
                                STATUS=`echo $BKPSTS|cut -d " " -f3`
                                LOGFILE=`echo $BKPLOG|cut -d " " -f3`
                                cd $BKP_LOG_DIR
                                BKP_DT=`echo $LOGFILE|cut -d "." -f3`
                                echo $BKP_DT
                                        if [ $BKP_DT = $NOW ] && [ $STATUS = "COMPLETED" ]; then
                                                #cat $BKP_LOG_DIR/$LOGFILE | mailx -s "SUCCESS:$DB_TYPE NZ  $DBNAME $BKTP Database Backup on  $HOST " $email_list
                                                 echo "Backup Success"
                                        else
                                        cat /tmp/massage.log | mailx -s "FAILED:$DB_TYPE NZ $DBNAME FULL Database Backup on  $HOST " -a $BKP_LOG_DIR/$LOGFILE $email_list
                                        fi
                        fi
    else
     echo "$i Database does not exist on $HOST"| mailx -s "Notification:$DB_TYPE  NZ $i  Database Backup failed on  $HOST " $DBA
    fi
    done
else
echo "Please specify database name " >>$LOG
exit 1;
fi

Monday 2 May 2016

Shell script to Netezza System status (NPS) IBM Netezza

#Shell script to Netezza System status (NPS) IBM Netezza
#Manish Jaiswal
#!/bin/sh
# =============================================================================
# Netezza  NPS Status
# =============================================================================
# Script configuration - Static values only.
# =============================================================================
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
NPS_STATE=`nzstate | awk '{print $4}' | tr -d "[.']" | tr "[a-z]" "[A-Z]"`
# ------------------------------------------------------------------------
# Make sure the system is online.
# ------------------------------------------------------------------------
if [ "${NPS_STATE}" = "ONLINE" ]
then
   echo "${NPS_STATE}"
        SYSTEMSTATE=0
else
   echo "NPS ${NPS_STATE} OFFLINE During Hostbackup!"
   echo  " NPS is Offline on  $HOST in Current state: [${NPS_STATE}]"|mailx -s "CRITICAL:NZHOSTBACKUP  on  $HOST " $email_list
   exit;
fi

Shell script to Generate Table skew Report on IBM Netezza System(nz_skew).

#Shell script to Generate Table skew  Report  on IBM Netezza System(nz_skew).
#Manish Jaiswal
#!/bin/sh
# =============================================================================
# Netezza Table Skew script
# =============================================================================
# Script configuration - Static values only.
# =============================================================================
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
export email_list="NZGreen@gmail.com,EDW_Support@gmail.com"
#export email_list="manish.jaiswal@gmail.com"
export SCRIPTOUTPUTDIR=/export/home/nz/scripts/MONITOR
export VIPHOSTNAME=EDW-NTZ-001-LQC
export SCRIPTSTART=$(date -d "$1" +"%Y%m%d")
export NZSUPPORT7207BINDIR=/nz/support-IBM_Netezza-7.2.0.7.P1-160122-1638/bin
export RPT_FILE="${SCRIPTOUTPUTDIR}/${VIPHOSTNAME}.skew.${SCRIPTSTART}.txt"
find $SCRIPTOUTPUTDIR/*txt  -mtime +5 -exec rm {} \;

# -----------------------------------------------------------------------------
# Run the nz_skew command and generate report.
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Start the checks.
# -----------------------------------------------------------------------------
echo "Starting table skew check for ${VIPHOSTNAME}"

${NZSUPPORT7207BINDIR}/nz_skew -sort size | grep -v "^ [DPQ]MISC"   > ${RPT_FILE} 2>&1

RetCode=$?

# Check the outcome.
if [ ${RetCode} -eq 0 ]
then
        echo "Successful."
else
        echo "FAILED!"
echo  "Table skew check report generation failure! [${VIPHOSTNAME}]" |mailx -s "Notification:Table skew check report generation failure! [${VIPHOSTNAME}]" $email_list
exit;
fi

echo "Finished table skew check for ${VIPHOSTNAME}"
# -----------------------------------------------------------------------------
# Distribute the table skew check report.
# -----------------------------------------------------------------------------
echo "Distributing table skew report for ${VIPHOSTNAME}"

echo  "Netezza Table Skew Report for  ${VIPHOSTNAME}" |mailx -s "Netezza Table Skew Report for  ${VIPHOSTNAME} " -a ${RPT_FILE} $email_list

# =============================================================================
# Script Completion
# =============================================================================

shell script to Monitor Disk on Netezza IBM system disk_monitor

#shell script to Monitor Disk on Netezza IBM system  disk_monitor
#Manish Jaiswal
#!/bin/sh
# =============================================================================
# Netezza Disk Monitor Template
# =============================================================================
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
email_list="NZRed@gmail.com,EDW_Support@gmail.com"
SCRIPTOUTPUTDIR=/export/home/nz/scripts/MONITOR
VIPHOSTNAME=EDW-NTZ-001-LQC
SCRIPTSTART=$(date -d "$1" +"%Y%m%d")
export NZSUPPORT7207BINDIR=/nz/support-IBM_Netezza-7.2.0.7.P1-160122-1638/bin
export RPT_FILE="${SCRIPTOUTPUTDIR}/${VIPHOSTNAME}.DiskMonitor.${SCRIPTSTART}.txt"
export CLEAN_RPT_FILE="${SCRIPTOUTPUTDIR}/${VIPHOSTNAME}.DiskMonitor.${SCRIPTSTART}.clean.txt"
export ACTIONS_FILE="${SCRIPTOUTPUTDIR}/${VIPHOSTNAME}.DiskMonitor.${SCRIPTSTART}.actions.txt"
find $SCRIPTOUTPUTDIR/*txt  -mtime +5 -exec rm {} \;
# -----------------------------------------------------------------------------
# Start the disk checks.
# -----------------------------------------------------------------------------
echo  "Starting disk monitor for ${VIPHOSTNAME}"

#/nz/support-IBM_Netezza-7.2.0.7.P1-160122-1638/bin/adm/disk_monitor \

${NZSUPPORT7207BINDIR}/adm/disk_monitor   > ${RPT_FILE} 2>&1

RetCode=$?

# Check the outcome.
if [ ${RetCode} -eq 0 ]
then
        echo "Successful."
else
        echo "FAILED!"
        echo  "Disk monitor report generation failure! [${VIPHOSTNAME}]" |mailx -s "Notification:Disk monitor report generation failure! [${VIPHOSTNAME}]" $email_list
fi

echo  "Finished disk monitor for ${VIPHOSTNAME}"
# -----------------------------------------------------------------------------
# Check for actionable items and alert as needed.
# -----------------------------------------------------------------------------

echo "Checking ${VIPHOSTNAME} disk monitor report for actionable items"

# Strip the stderr output from the report.
sed -ne '/^[A-Z]/d;p' "${RPT_FILE}"  | sed -e '/Fewer lines on second insert/d' > ${CLEAN_RPT_FILE}

# Extract the actionable portion of the report.
sed -n '/Actionable/,/^(/p' ${CLEAN_RPT_FILE} > ${ACTIONS_FILE}

# Get the number of actionable items.
ActionableItems=`grep "^(" ${ACTIONS_FILE} | sed 's/[^0-9]*//g'`

# If we dont have any actions to take then we're done.  Otherwise send an alert.
if [ ${ActionableItems} -eq 0 ]
then
echo  "No actions needed"
        #echo  "No actions needed"|mailx -s "Notification:Disk monitor report generation suceed! [${VIPHOSTNAME}]" $email_list
else
        echo "${ActionableItems} actionable items found!"
        echo "Disk monitor report found actionable items! [${VIPHOSTNAME}]"

       echo  "Disk failure Found in [${VIPHOSTNAME}]" |mailx -s "Disk failure Found in [${VIPHOSTNAME}] " -a ${ACTIONS_FILE} $email_list
fi

# =============================================================================
# Script Completion
# =============================================================================

Shell Script to check invalid Views on IBM Netezza System (nz_check_views)

#Shell Script to check invalid  Views on IBM Netezza System
#Manish Jaiswal
#!/bin/sh
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
DBA_email="EDW_Support@gmail.com"
DATE=`date +%Y-%m-%d:%H:%M:%S`
LOG=/export/home/nz/scripts/log/check_invalid_views_lp_$DATE.log
echo "Starting view check on `hostname` " > $LOG
for i in `cat /export/home/nz/scripts/PRD_LP_DB_List.lst`
        do
         echo "Starting view check of Database $i " >> $LOG
         nz_check_views $i >> $LOG
done
echo " Find the NZ View check  Report for `hostname` server in attachment"| mailx -s "`hostname` NZ View check  Report for Netezza  on `date +%y%m%d%H%M%S` " -a $LOG "$DBA_email"

Shell Scripts to Generate Statistics on IBM Netezza System ( nz_genstats) GENERATE EXPRESS STATISTICS

#Shell Scripts to Generate Statistics on IBM Netezza System ( nz_genstats) GENERATE EXPRESS #STATISTICS
#Manish Jaiswal
#!/bin/sh
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
### Database List needed to be analyzed
DB_LIST=$(nzsql -l |awk ' NR > 3'|sed '$d' |awk '{ print $1 }'|sed '$d')
##############
DBA_email="EDW_Support@gmail.com"
DAY=`date '+%a'`
LOG_DIR=/export/home/nz/scripts/log
LOG=$LOG_DIR/analyzed_`hostname`_`date +%y%m%d%H%M%S`.log
###Delete 15 days old log
find $LOG_DIR/*.log  -type f -mtime +15 -exec rm -f {} \; 2> /dev/null
##############################
###Main Function
analyze_db_fn()
{
### Genrate Gather stats  for $DAY listed databses
  for i in `echo $DB_LIST`
           do
           echo "Starting Gather stats of Database $i on `date +%y%m%d%H%M%S` " >> $LOG
  nz_genstats ${i} >> $LOG
  if [ $? -eq 0 ]; then
  echo "Succeeed GENERATE EXPRESS STATISTICS of database $i on `date +%y%m%d%H%M%S` " >> $LOG
  else
  echo "Failure GENERATE EXPRESS STATISTICS of database $i on `date +%y%m%d%H%M%S` " >> $LOG
  fi
   done
echo " Please find GENERATE STATISTICS Report in attachment for `hostname`"| mailx -s " Gather Stats  Report for Netezza $DAY `hostname` server on `date +%y%m%d%H%M%S` " -a $LOG "$DBA_email"
}
##############################
##Call Funtion to Genrate stats
analyze_db_fn
##

Shell Scripts for NZ GROOM on Netezza IBM system

#Shell Scripts  for NZ GROOM on Netezza IBM system
#Manish Jaiswal
#!/bin/sh
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
### Database List needed to be groom
##Big Databases
DB_LIST_WED_SAT=$(nzsql -l |awk ' NR > 3'|sed '$d' |awk '{ print $1 }'|sed '$d'|egrep -E '(PGCIDW|PGCRDW|PMFIDW|PMACDW)')
##small Databases
DB_LIST_SUN=$(nzsql -l |awk ' NR > 3'|sed '$d' |awk '{ print $1 }'|sed '$d'|egrep -v '(PGCIDW|PGCRDW|PMFIDW|PMACDW)')
##############
DBA_email="EDW_Support@gmail.com"
DAY=`date '+%a'`
LOG_DIR=/export/home/nz/scripts/log
LOG=$LOG_DIR/groom_`hostname`_`date +%y%m%d%H%M%S`.log
###Delete 15 days old log
find $LOG_DIR/*.log  -type f -mtime +15 -exec rm -f {} \; 2> /dev/null
##############################
###Main Function
groom_db_fn()
{
### running groom for $DAY listed databses
echo "groom started for `hostname1` " > $LOG
  for i in `echo $GROOM_DB_LIST`
           do
           echo "Starting Groom of Database $i on `date +%y%m%d%H%M%S` " >> $LOG
           Table_name=$(nzsql -A -c "select  objname as table_name from _v_sys_relation_xdb sys where database='$i';"|awk ' NR > 1 '|sed '$d')
              for T in `echo $Table_name`
               do
                   nz_groom ${i} $T -records >> $LOG
                   if [ $? -eq 0 ];then
                   echo "Completed: Groom of Table $T Database $i on `date +%y%m%d%H%M%S` " >>$LOG
                   else
                   echo "Failed: Groom of Table $T Database $i on  " >> $LOG
                   fi

               done
   done
echo " Find the Groom Report for Netezza `hostname` server in attachment"| mailx -s " Groom Report for Netezza $DAY `hostname` server on `date +%y%m%d%H%M%S` " -a $LOG "$DBA_email"
}
##############################
###checking the day
if [ $DAY == "Wed" ] || [ $DAY == "Sat" ]; then
        GROOM_DB_LIST=$DB_LIST_WED_SAT
echo "second block"
       groom_db_fn
        echo $DAY
elif [ $DAY == "Sun" ]; then
        echo $DAY
                GROOM_DB_LIST=$DB_LIST_SUN
                groom_db_fn
else
        echo "GROOM Dont not run on $DAY" > LOG
        exit;
fi

Script for NZHostbackup on IBM Netezza

##Script for NZHostbackup on IBM Netezza
## Manish Jaiswal
#!/bin/sh
cd /export/home/nz
. ~/.bashrc
export PATH=/nz/kit/bin:/nz/kit/sbin:/nz/kit/bin/adm:/bin:/usr/bin:/usr/local/bin:.:/nz/support/bin
DATE=`date +%Y-%m-%d:%H:%M:%S`
HOST=`hostname`
email_list=manish.jaiswal@gmail.com
EVENT_LOG_FILE_BEFORE=/export/home/nz/scripts/log/EVENT_LOG_FILE_BEFORE_$DATE.log
NZ_HOST_BACKUP_DMP_FILE=/dbbackup/nz_hostbackup/edw-ntz-001-lqc/nz_hostbackup_$DATE.dmp
NZ_HOST_BACKUP_LOG_FILE=/dbbackup/nz_hostbackup/edw-ntz-001-lqc/nz_hostbackup_$DATE.log
NPS_STATE=`nzstate | awk '{print $4}' | tr -d "[.']" | tr "[a-z]" "[A-Z]"`

# -----------------------------------------------------------------------------
# Make sure the system is online and no backups are running.
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Make sure the system is online.
# ------------------------------------------------------------------------
if [ "${NPS_STATE}" = "ONLINE" ]
then
   echo "${NPS_STATE}"
SYSTEMSTATE=0

#elif [ "${NPS_STATE}" = "STOPPED" ]
#then
        echo "${NPS_STATE}"

else
   echo "NPS ${NPS_STATE} ONLINE REQUIRED EXITING!"
   echo  "NZHostbackup Required NPS state of online not the current state! Current state: [${NPS_STATE}]"|mailx -s "Notification:NZHOSTBACKUP  on  $HOST " $email_list
   exit;
fi

# ------------------------------------------------------------------------
# Make sure that there are no backups & Restore under execution.
# ------------------------------------------------------------------------
COUNT_OF_BACKUP_PROCESSES=`ps -ef | grep nzbackup | grep -v grep | wc -l`
COUNT_OF_RESTORE_PROCESSES=`ps -ef | grep nzrestore | grep -v grep | wc -l`

if [ ${COUNT_OF_BACKUP_PROCESSES} -eq 0 ] && [ ${COUNT_OF_RESTORE_PROCESSES} -eq 0 ]
then
        echo " NO Backup & Restore is running "
BACKUPSTATE=0
else
BR_COUNT=${COUNT_OF_BACKUP_PROCESSES} + ${COUNT_OF_RESTORE_PROCESSES}
     echo  "NPS having ${COUNT_OF_BACKUP_PROCESSES} RUNNING BACKUPS FOUND EXITING!"
     echo  "NZHostbackup  Catalog backups cannot run with other backups! Found ${BR_COUNT} running backup(s)."|mailx -s "Notification:NZHOSTBACKUP  on  $HOST" $email_list
     exit;
fi
# -----------------------------------------------------------------------------
# Disable the state change events on the system.
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Log the state of the events on the system.
# ------------------------------------------------------------------------
nzevent show -maxColW 4096 -orient vertical   > ${EVENT_LOG_FILE_BEFORE}
RetCode=$?

if [ ${RetCode} -eq 0 ]
then
        echo "Successful"
else
        echo "FAILED!"
        echo "NZHostbackup Error logging system events! Error: [${RetCode}]"|mailx -s "Notification:NZHOSTBACKUP  on  $HOST " $email_list
        exit;
fi

# ------------------------------------------------------------------------
# Disable the events.
# ------------------------------------------------------------------------
# Cut the event listing down to the name of the event, the state, and the type.  Then loop on the output.
nzevent show -maxColW 4096 -orient vertical | grep -E  ^'Name|On |Event Type' | while read line
do

# If we're reading a Name then grab the 2nd field as the value.
if [ `echo ${line} | grep -c "^Name"` -eq 1 ]
then
        EvtName=`echo ${line} | awk '{print $2}'`
        continue
fi

# If we're reading a status line then grab the 2nd field as the value.
if [ `echo ${line} | grep -c "^On"` -eq 1 ]
then
        EvtOn=`echo ${line} | awk '{print $2}'`
        continue
fi

# If we're reading a type line then grab the 3rd field as the value.
if [ `echo ${line} | grep -c "^Event Type"` -eq 1 ]
then
        EvtType=`echo ${line} | awk '{print $3,$4,$5}'`
fi

# Only attempt to disable an event if we have all three values present.
if [ ${#EvtName} -gt 0 -a ${#EvtOn} -gt 0 -a ${#EvtType} -gt 0 ]
then
    # Only deal with the target event type.
    if [ "${EvtType}" = "Sys State Changed" ]
    then
        # If the event is enabled then we have something to do.
        # Otherwise we don't care.
        if [ "${EvtOn}" = "yes" ]
        then
           echo "   Disabling event: ${EvtName}"

           nzevent modify -name ${EvtName} -on false
           RetCode=$?

           if [ ${RetCode} -eq 0 ]
           then
               echo "Successful"
           else
               echo "FAILED!"
               echo "NZHOSTBACKUP DISABLE event error: ${EvtName} on ${BACKUP_HOST}! [${RetCode}]"|mailx -s "Notification:NZHOSTBACKUP  on  $HOST " $email_list
               exit;
           fi
        fi
    fi
fi
done

# ------------------------------------------------------------------------
# Execute the catalog backup.
# ------------------------------------------------------------------------
echo "Performing host catalog backup of ${HOST}"

BACKUP_START=`date "+%Y-%m-%d %H:%M:%S"`

nzhostbackup ${NZ_HOST_BACKUP_DMP_FILE}       > ${NZ_HOST_BACKUP_LOG_FILE} 2>&1
RetCode=$?

# Check the outcome.
if [ ${RetCode} -eq 0 ]
then
     BACKUP_END=`date "+%Y-%m-%d %H:%M:%S"`
     BACKUP_STATUS="COMPLETED"
echo "NZHOSTBACKUP host catalog backup of ${HOST} Success [${RetCode}]"|mailx -s "Success :NZHOSTBACKUP  on  $HOST " $email_list
else
     BACKUP_STATUS="FAILED"
     rm -f ${NZ_HOST_BACKUP_DMP_FILE}
     echo "NZHOSTBACKUP host catalog backup of ${HOST} failure! [${RetCode}]"|mailx -s "Failed:NZHOSTBACKUP  on  $HOST " $email_list

fi
# ------------------------------------------------------------------------
# Enable the events.
# ------------------------------------------------------------------------
# Cut the event listing down to the name of the event, the state, and the type.  Then loop on the output.
nzevent show -maxColW 4096 -orient vertical | grep -E  ^'Name|On |Event Type' | while read line
do

  # If we're reading a Name then grab the 2nd field as the value.
  if [ `echo ${line} | grep -c "^Name"` -eq 1 ]
  then
          EvtName=`echo ${line} | awk '{print $2}'`
          continue
  fi

  # If we're reading a status line then grab the 2nd field as the value.
  if [ `echo ${line} | grep -c "^On"` -eq 1 ]
  then
          EvtOn=`echo ${line} | awk '{print $2}'`
          continue
  fi

  # If we're reading a type line then grab the 3rd field as the value.
  if [ `echo ${line} | grep -c "^Event Type"` -eq 1 ]
  then
          EvtType=`echo ${line} | awk '{print $3,$4,$5}'`
  fi

  # Only attempt to Enable an event if we have all three values present.
  if [ ${#EvtName} -gt 0 -a ${#EvtOn} -gt 0 -a ${#EvtType} -gt 0 ]
  then
      # Only deal with the target event type.
      if [ "${EvtType}" = "Sys State Changed" ]
      then
          # If the event is disabled then we have something to do.
          # Otherwise we don't care.
          if [ "${EvtOn}" = "no" ]
          then
              echo" Enabling event: ${EvtName}"
              nzevent modify -name ${EvtName} -on true
              RetCode=$?

              if [ ${RetCode} -eq 0 ]
              then
                      echo "Successful"
              else
              echo "FAILED!"
              echo "NZHOSTBACKUP ENABLE event error: ${EvtName} on ${BACKUP_HOST}! [${RetCode}]"|mailx -s "Notification:NZHOSTBACKUP  on  $HOST " $email_list      
 exit;
              fi
          fi
      fi
  fi
done
###Done

Wednesday 13 April 2016

Netezza Puredata Backup failure with Error: NZ-02465: Stream unresponsive after 300 seconds, operation aborted. Check concurrency limits on server.

Netezza Puredata Backup failure with Error: NZ-02465: Stream unresponsive after 300 seconds, operation aborted. Check concurrency limits on server.


I have seen similar kind issue in Puredata system 7.2.0.5

Basically, Netezza backup processes check that number of streams requested is supported by the backup tool. If Yes,  then only backup process starts.
If the check fails due to connection timeouts, the nzbackup process exits with the following

Error Message(NZ-02465): Stream unresponsive after 300 seconds, operation aborted. Check concurrency limits on server.

Cause:- It may  happens due to Media server which is associated with storage taking more than 5 min  to acquire the necessary mounts, If its taking more than 5 min(default 300sec).

Solution:-
Change the timeout to 600 seconds ( from the default of 300 seconds)

Method:-1

$ nzsystem pause

Are you sure you want to pause the system (y|n)? [n] y

$ nzsystem showRegistry | grep bnrStreamInitTimeoutSec

host.bnrStreamInitTimeoutSec      = 300

$ nzsystem set -arg host.bnrStreamInitTimeoutSec=600

Are you sure you want to change the system configuration (y|n)? [n] y

$ nzsystem resume

check Status

$nzstate

Method 2:-
A. make changes in  /nz/data/config/system.cfg by adding the below parameter:

host.bnrStreamInitTimeoutSec=600


B. Restart the NPS System  using the "nzsystem restart" command.

Tuesday 12 April 2016

Frequently Asked Questions: - IBM PureData System for Analytics Netezza

Frequently Asked Questions: - IBM PureData System for Analytics Netezza

What components of a PureData System for Analytics appliance are available for Upgrade?
There are three main components of a system that can be upgraded: NPS, FDT, and HPF.

What is NPS?
NPS is the Netezza Performance Server, the main high performance database server for the system.

What is HPF?
HPF is the Host Platform. The HPF software contains kernel updates, firmware, and other special software used by the PureData System host servers. The HPF upgrade and downgrade process includes extensive error-checking, backups, and logging.

What is FDT?
FDT is the Firmware Diagnostics and Tools and contains the firmware updates for the hardware components of the PureData System for Analytics.

Where can I find the minimum versions of HPF and FDT required for the NPS I wish to upgrade to?
see "fixcentral" in the Related information section
Product Group: Information Management
Select from Information Management: IBM Netezza NPS Software and Clients
Install Version: desired NPS version
Platform: all
From here you will need to download the file called nz-npsdoc-vVersion.tar.gz. The pdf with this information is titled "Netezza Software Upgrade."

What should I download if having an NPS only upgrade performed?
We will need the NPS package from:
see "fixcentral" in the Related information section
Product Group: Information Management
Select from Information Management: IBM Netezza NPS Software and Clients
Install Version: desired NPS version
Platform: all
The package should be titled nz-nps-vVersion.tar.gz please download and place in the /nzscratch/upgrade directory
on the server.

see "fixcentral" in the Related information section
Product Group: Information Management
Select from Information Management: IBM Netezza Tools
Install Version: desired SWTools version(Typically match the NPS version)
Platform: all
Select the desired SWTools package and download the file called IBM_Netezza_Software_Support_Tools-vVersion.tar.gz

see "fixcentral" in the Related information section
Product Group: Information Management
Select from Information Management: IBM Netezza Tools
Install Version: latest HWTools version
Platform: all
Select the latest HWTools package and download the file called nz-hwsupport-tf-VVersion.tar.gz

What should I download if having a full upgrade performed?
The NPS packages listed above are needed, as well as the following HPF and FDT packages.
For HPF:
see "fixcentral" in the Related information section
Product Group: Information Management
Select from Information Management: IBM Netezza Platform
Install Version: desired HPF version
Platform: all
Select the desired HPF package and download the file called nz-hpf-vVersion.tar.gz.

For FDT:
see "fixcentral" in the Related information section
Product Group: Information Management
Select from Information Management: IBM Netezza Platform
Install Version: desired FDT version
Platform: all
Select the desired FDT package and download the file called nz-fdt-vVersion.tar.gz

What information about the system should I provide when opening the upgrade PMR?
Output to the following commands as nz user:
cat /nzlocal/scripts/version.txt
cat /nzlocal/scripts/MODEL
head -2 /opt/Netezza/FW/PSeries/version.txt
head -2 /opt/nz/fdt/version.txt
cat /etc/redhat-release
nzrev
nzstats

As root user:
dmidecode -t 1

Also please provide the address of the server to send the IBM on-site technician to be on-site for the duration of the upgrades, if needed.

Does my upgrade require an IBM technician to be on-site?
We require an IBM technician to be on-site for all FDT upgrades to versions FDT 3.0.5.4 and lower. The IBM on-site technician is there to perform the Host firmware updates on the physical system. Upgrades to FDT 4.1 and higher do not require an IBM SSR on-site as the hosts are able to be updated remotely.

When can I schedule upgrades?
We are available 24/7 for upgrade activity however there are a few restrictions for providing a tentative schedule:
For scheduling a full upgrade for a weekdays please provide at least 1 weeks notice. For scheduling on the weekends please contact your local Support to speak to them about lead times needed for upgrades. For NPS only upgrades please provide at least 48 hours notice for a tentative schedule. While we will do our best to meet customer requests we may, on occasion, need to look for other dates and times to carry out the requested upgrades. The more notice we can have the more likely we can accommodate your provided schedule.

Is a pre-upgrade check required?
Yes, we require a pre-upgrade check to be performed on the system 3-7 days prior to the scheduled upgrade date. The pre-upgrade checks are non-intrusive and can be run while the system is online. It is important that the pre-upgrade check is performed a maximum of 7 days prior to the upgrade to minimize the possibility of issues arising between pre-check and upgrade.

Do upgrades require root access?
Yes, all upgrades and pre-upgrade checks require root access to the system. Please have root passwords ready for scheduled pre-upgrade checks and upgrades.

How will the remote technician access my system?
We have two ways to access systems to perform upgrades. The first is Webex where we will send an invitation to the customer and they will share their desktop to connect to the system. Second method of access is if the customer has previously set up remote access we will be able to access those systems remotely to perform the upgrades.

Do I need to resolve hardware issues prior to upgrading?
Yes we require that all hardware issues be resolved before performing the upgrades, whether it is disk replacements, SPU repair, etc.

Can I schedule an upgrade with another activity such as Hardware replacement?
No, full upgrades typically take 5-8 hours to complete, scheduling any hardware activity for the same outage can cause delays in the upgrade and creates more risk that issues may arise during the upgrade activity.

What components of Firmware get updated in FDT?
The firmware components of FDT are as follows: Hosts, Remote Power Controllers, Spa Management Modules, Spa Gigabit switches, Spa SAS switches, Rack Management switches, Rack Fabric switches, Spa power supplies, Blades, HBA, Storage Enclosures, and Storage Media.

Where can I find what is new in each version of FDT?
You can extract the files from the nz-fdt-vVersion.tar.gz file to get the release notes and what fw levels were updated in this version of FDT.

What is sys_rev_check?
Sys_rev_check is a script that checks the current firmware levels of the system and compares them to the levels of firmware that the FDT expects. This tells us which components need to be updated during the FDT upgrades.

How often should I upgrade?
You should upgrade your system HPF and FDT once a year. NPS can also be updated to the latest at this time or customer can choose not to update NPS as well if satisfied with current version.

How long do upgrades take?
If the system meets the minimum requirements(HPF and FDT) for the desired NPS release then we can perform an NPS only upgrade which takes approximately 1 hour to complete. If it does not meet the minimum requirements for that release of NPS then we will have to perform a full upgrade(NPS, HPF, FDT) which takes roughly 8 -12 hours to complete. On average a 8 hours outage window is needed, yet for a system with 48 SPUs or higher, an outage window of at least 12 hours is required.

The rough time estimates on these are:
NPS: 1 hour
HPF: 1 hour
FDT: 6 -10 hours

Here is the breakdown of the approximate time for each component of FDT

AMM - 1-3 hrs
Blades - 2-6 hrs
Storage Media - 30min - 1 hr.
Host Bios Firmware - 2 (1 hr for each host)- can take upto 3 hrs(1.5 hrs per host) sometimes
HBA - 15 min

Please note that the upgrade may vary depending on the system. There are several factors that influence this such as
- The current and the desired levels of NPS/FDT/HPF
- Was the system recently upgraded ?
- Size of the system- sometimes blade updates may take longer to complete on big systems
- No hardware or platform issues are encountered during the course of the upgrade. We do check the system for any issues prior to the upgrade but this does not guarantee that no issues will be encountered during the course of the upgrade.

The time frame provided above are approximates based on a typical upgrade. There is no guarantee that the upgrade will not take longer than anticipated. If any components fail or firmware upgrades do not take, the support engineer needs to perform active troubleshooting which includes restarts and this adds time to upgrade and hence the outage.

If currently using INZA(IBM Netezza Analytics), do I need to install a new version of INZA?

Please check the pre-requisites section of the IBM_Netezza_Analytics_Administrators_Guide.pdf to confirm that your current version of INZA is compatible with the desired version of NPS. If the INZA requires an upgrade as well please open a ticket with our Database Technical Support team to have a compatible version of INZA installed on your system.