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