删除当前正在使用的表 [sybase]

发布于 2024-10-08 21:13:07 字数 78 浏览 0 评论 0原文

有没有办法强制删除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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

秋叶绚丽 2024-10-15 21:13:07

Sybase是完全在线的,并且是多用户的,不需要单用户模式。

如果您有足够的权限,您可以执行各种操作。这些操作都不会“破坏数据或数据库或引用完整性”,该 id 已在 DDL 中定义:

  • 如果问题是表(而不是页面)被锁定,并且您希望消除表锁,这会阻止其他操作访问该表的用户,杀死 spidsp_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 the spid. sp_lock will identify the server process id.

  • if you actually want to drop the table, but it is locked, first kill the spid; 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.)

梦幻的心爱 2024-10-15 21:13:07

不,你不能,因为如果这样做,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文