Is there any way to force drop a table in sybase which is currently in use ? Or any way 开发者_JAVA技巧to get rid of the lock.
Force drop will be a better option. But does a force drop exist ?
Sybase is totally online, and multi-user, no need for single user mode.
If you have enough privilege you can perform various actions. None of these actions "break data or database or referential integrity" that id already defined in DDL:
if the problem is that the table (not pages) is locked, and you want you eliminate the table lock, which is preventing other users accessing the table,
kill
thespid
.sp_lock
will identify theserver process id
.if you actually want to drop the table, but it is locked, first
kill
thespid
; then drop the table.
(There is a "force drop" command, but that is undocumented and unsupported; more important it is for special cases, not necesary for your case.)
No you can't because if it does, Sybase would break the integrity of the database. Imagine : an user is reading datas from a table and at the same time another is destroying this same table !!
If you want to force it, you have to turn on the database into "single-user" and after that no one -but you- will can connect to the database and do what you want...
try http://www.tek-tips.com/viewthread.cfm?qid=220392&page=49 for switching to single user.
精彩评论