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)
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |