grep & findstr

Background

Depending on your OS, grep on Linux and findstr on Windows might be one of your better friends.

Wish

Let us digest DB/2 Buffer Pool utilization on Linux and MS Windows.

OS

Linux

Syntax


db2 GET SNAPSHOT FOR BUFFERPOOLS ON [database] | grep 'pattern-1\|pattern-2'

Sample


db2 GET SNAPSHOT FOR BUFFERPOOLS ON WideWrld | grep 'Bufferpool name\|Current size'

Output

metadata.currentSize.20181106.0315PM.PNG

MS Windows

Syntax


db2 GET SNAPSHOT FOR BUFFERPOOLS ON [database] | findstr /C 'pattern-1' /C 'pattern-2'

Sample


db2 GET SNAPSHOT for bufferpools on WIDEWRLD | findstr /C:"Bufferpool name" /C:"Current size"<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;">&#65279;</span>

Output

metadata.currentSize.WIDEWRLD.20181106.0349PM

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s