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
- 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 ```
- Make the two scripts executable.
- Run compressedratioscript.sh and wait for it to complete:
./compressedratioscript.sh
- Once the previous script is finished, run listtables.sh and wait for it to complete:
./listtables.sh
- Run:
cd tablelist ls
- Open each file to list the tables. All the tables listed in these files are tables with a > 7.95 compression ratio.
- 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
Was this topic helpful?
Document Information
Modified date:
06 October 2022
UID
ibm16564067