Preserving plan files with rsync

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

Voila!

Advertisements
This entry was posted in administration, General, Performance and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s