db2top Change Columns Order

Reordering of columns

What good is a tool if you can’t customize it to your liking? Fortunately, db2top is quite customizable. In today’s post, we will look at how you can customize the order in which columns are presented for the majority of those screens in db2top that present their information in a table.

If you remember our look at the .db2toprc file, we saw that column order could be specified for many of the screens by listing out a new order for each screen in the .db2toprc file. Of course, you either needed a very good memory or to have db2top open in some other window while you performed this task. As an alternative, you can set these column orders directly in db2top by pressing the ‘c’ key when you are on any of the screens for which column reordering is supported.

When you press the ‘c’ key on, say, the Locks screen, you get a screen like the following:

db2top Change column order screen for Locks screen
db2top Change column order screen for Locks screen

To reorder the columns, you simply type the numbers you see in the Pos column in the order you would like the columns to be shown and separate them by commas. For example, if you want to see Application Status before Application Name, you simply type 2,1 and press Enter. All the other columns will maintain their positions.

Column 0 is always the first column. If you list a zero in your comma-separated list, it will simply print the first column a second time.

The “Change columns order” screen is not available for some screens that have tables:

  • Partitions
  • Memory
  • Bottlenecks
  • Skew