删除当前正在使用的表 [sybase]
有没有办法强制删除sybase中当前正在使用的表? 或者有什么办法可以解除锁定。
强制下降将是一个更好的选择。但力下降存在吗?
Is there any way to force drop a table in sybase which is currently in use ?
Or any way to get rid of the lock.
Force drop will be a better option. But does a force drop exist ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Sybase是完全在线的,并且是多用户的,不需要单用户模式。
如果您有足够的权限,您可以执行各种操作。这些操作都不会“破坏数据或数据库或引用完整性”,该 id 已在 DDL 中定义:
如果问题是表(而不是页面)被锁定,并且您希望消除表锁,这会阻止其他操作访问该表的用户,
杀死
spid
。sp_lock
将识别服务器进程 ID
。如果您确实想删除该表,但它已被锁定,请首先
杀死
spid
;然后删除该表。(有一个“强制删除”命令,但该命令没有记录且不受支持;更重要的是,它对于特殊情况而言,而不是您的情况所必需的。)
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.)
不,你不能,因为如果这样做,Sybase 将破坏数据库的完整性。
想象一下:一个用户正在从表中读取数据,同时另一个用户正在破坏同一张表!
如果你想强制它,你必须将数据库打开为“单用户”,之后没有人 - 除了你 - 可以连接到数据库并做你想做的事......
尝试 http://www.tek-tips.com/viewthread.cfm?qid=220392&page =49
用于切换到单用户。
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.