Search This Blog

Friday 9 May 2014

How to kill a hanging session

If something goes badly wrong in a backup session (e.g. a loss of communications, or a process dying unexpectedly) you can end up with the BSM process (bsm.exe on Windows and /opt/omni/lbin/bsm on Linux/Unix) still running even though it doesn't achieve anything. Aborting doesn't help because the session manager process (BSM) tries to send that abort to the disk agent and the media agent, which won't work if they don't exist any more.

All you need to do is kill the relevant BSM process.

Which is easy when there is only one, and hard when you are in the middle of hundreds of backup sessions.

Sometimes it is easy, because you can look at the start time of the process and deduce which session it is.

But here's a way of getting it that's a bit more scientific.

Get the full command-line of the process in question, either with "ps -ef" on Linux / Unix or by fiddling around with the viewed columns in task manager on Windows.

You should see something like:
  bsm -session_key 17 -owner .....

That session key (17 in this case) is the initial data to distinguish one session from another. If your database is incredibly slow, you might even see that in the session monitor for a while. But generally it is so quick to allocate a real session number that the session key is invisible.

That doesn't stop you using the session key though as an argument to any commands; you just have to prefix it with "R-".

For example:
  omnistat -session R-17 -status_only

This will produce output like this:

Session ID    Type    Status     User
=====================================================
2014/05/09-2  Backup  Progress   DP.USER@ifost.org.au

That's the session ID I was looking for, so I know which bsm process to kill now.

[Addendum. I'm running a survey to see if there's interest in getting omniabort modified to support this capability: http://blog.ifost.org.au/2016/01/survey-on-omniabort-extensions-in-data.html ]

Greg Baker is an independent consultant who happens to do a lot of work on HPE DataProtector. He is the author of the only published books on HP Data Protector (http://www.ifost.org.au/books/#dp). He works with HPE and HPE partner companies to solve the hardest big-data problems (especially around backup). See more at IFOST's DataProtector pages at http://www.ifost.org.au/dataprotector, or visit the online store for Data Protector products, licenses and renewals at http://store.data-protector.net/ 

No comments:

Post a Comment