Clear the db locks automatically using script.
In my database server getting db locks and table locks, So manually execute the script and kill the blocking sessions.. this issue has been coming often..
Is there nay way to put the script in crontab, then it will run every Minuit and kill sessions automatically.
if you have any script share me.. It would help me lot.
We can achieve this. However this is a not a recommended way to handle db locks.
Best way is write a script that will report blocking sessions. And when any alert comes , log in to database and analyze the blocking sessions and take actions.
There might be cases, where application would be causing blocking, and if you kill then it might impact the application. So in that case, follow up with application team to find root cause.