Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

checking if a database can be dropped/renamed/exported

$
0
0
Hi, I have searched for this question, could not find a similar question.

I need to do an overnight rename of a DB but occasionally the rename fails with the message


425: Database is currently opened by another user.

107: ISAM error: record is locked.


Is there a simple way to check from the script before I execute the rename if the DB is locked ?

I guess the answer is onstat -g ses and then check each session and check the "Current Database field".

However, the output of onstat -g ses <sid> is not the most friendly to parse, is there an alternative or an option to format the output of onstat to be more easily parsed or could I execute a query equivalent to onstat -g ses ?

Thanks all for your help

Viewing all articles
Browse latest Browse all 13329

Trending Articles