Anytime you’ve wanted to investigate the execution plan of a query that ran days (or even hours) ago, you’ve probably found yourself disappointed that the plan file is no longer there. That’s because Netezza only keeps a few thousand plans online. This is configurable. However, doing so also increases the amount of memory that must be allocated for this purpose.
Another way to capture the plans is to simply copy them to a location where you can persist them for as long as you like. The easiest way to do this is with the rsync command.
‘rsync’ can be used to copy these pln files to either another server or simply another directory on the Netezza Linux host. Once copied, you can archive or remove the files as you see fit. For example:
[[ ! -d /tmp/myplan_files ]] && mkdir /tmp/myplan_files
rsync /nz/kit/log/planshist/*/*/*.pln /tmp/myplan_files