DB2 Linux history command

12 January,2011 by Tom Collins

The history command , at it’s most simple will display the history list of recently recorded commands which are called events.

In troubleshooting – DB2 problems – I’ve found it to be very useful – particularly in verifying whether certain commands have been executed. There are many other methods of verifying history – either through DB2 logging and application layer logs .

 Executing the command is  and the example below , I’ve displayed the last 10 commands executed.

 [root@myserver logs]# history



  988  ls

  989  /root/bin/db2_storage.sh db2inst1

  990  cd logs

  991  ls

  992  cat BACKUP_WEEKLY_110111.log

  993  su - db2inst1

  994  ls

  995  su - db2inst1

  996  ls

  997  history



I’ve found it to be useful in situations such as , an administrator denying they have executed a command . In that case , a simple output can clear up misunderstandings.


I’ve presented a simple example , but there are more interesting ways of using the command for DB2 administrators – consider:

a)Export the list for future use:


history –w history_DDMMYY.out


 Ref:Jack Vamvas(http://www.dba-db2.com)


Author: Rambler(http://www.dba-db2.com)


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on DB2 Linux history command

Comments are moderated, and will not appear until the author has approved them.

dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright