Identifying tables with compression ratio > 7.95 before Netezza Performance Server 11.2.1.5 upgrade on SaaS and PaaS environment

Created by Fatimah Zaidi on Wed, 03/16/2022 - 16:36
Published URL:
https://www.ibm.com/support/pages/node/6564067
6564067

How To


Summary

Create a list of all the databases that have tables with a compression ratio > 7.95 to backup before the upgrade.

Steps

  1. Create the following scripts in a folder. Make sure both scripts are placed in the same folder.
    compressedratioscript.sh
    ```
    #!/bin/bash
    
    mkdir compressedratio_reports
    for database in `/nz/support/bin/nz_get_database_names`
    do
            echo "Database: $database"
            for table in `/nz/support/bin/nz_get_table_names $database`
            do
                /nz/support/bin/nz_compressedTableRatio "$database" "$table" -size 0 >> compressedratio_reports/"${database}".out
            done
    done
    ```
    listtables.sh
    ```
    #!/bin/bash
    
    mkdir tablelist
    for database in `/nz/support/bin/nz_get_database_names`
    do
            echo "Database: $database"
            cat compressedratio_reports/"${database}".out | grep "," | grep -v "^Total For This Database" | awk '{ if($2 >= 7.95) { print $1}}' > tablelist/${database}_TABLELIST.out
    done
    ```
  2. Make the two scripts executable.
  3. Run compressedratioscript.sh and wait for it to complete:
    ./compressedratioscript.sh
  4. Once the previous script is finished, run listtables.sh and wait for it to complete:
    ./listtables.sh
  5. Run:
    cd tablelist
    ls
    Each file in this folder will have the format DBNAME_TABLELIST.out.
  6. Open each file to list the tables. All the tables listed in these files are tables with a > 7.95 compression ratio.
  7. List all the databases that have the tables with > 7.95 compression ratio and backup of all those databases.  You can also unload tables to backup before the upgrade. These tables need to be truncated, and can be restored after the upgrade.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSTNZ3","label":"IBM Netezza for Cloud Pak for Data"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Product Synonym

NPS;Netezza

Document Information

Modified date:
06 October 2022

UID

ibm16564067