查询以检测静态锁并动态卸下静态锁

发布于 2025-01-22 08:02:00 字数 479 浏览 2 评论 0原文

我们目前正在执行隔夜批处理,由于某些问题(仍在分析中),我们将在批处理完成后遇到桌锁的错误。现在,我们每天都在批处理前手动卸下锁,是否有一种方法可以使用DB中的桌子锁定自动化的lock,并删除是否发现?

我当前正在运行这两行代码:

选择DISTINTAR(table_name),所有者,stattype_lock从dba_tab_statistics中sed andal ='所有者'and stattype_locked ='alll''; ally';

exec exec dbms dbms dbms_stats.unlock_stats.unlock_table_stable_stats(''ally ';所有者','table1');

exec dbms_stats.unlock_table_stats('所有者','table2');

对此的任何帮助将非常有帮助!

tia

We are currently executing an overnight batch and due to some issues ( still under analysis) we are getting an error of table lock after the batch is completed. Right now we are manually removing the lock before batch everyday, is there a way that can be used to automate the search for table locks in DB and remove if any found ?

I am currently running these 2 lines of code :

select distinct(table_name),owner,STATTYPE_LOCKED from dba_tab_statistics where owner = 'owner' and STATTYPE_LOCKED = 'ALL';

EXEC DBMS_STATS.unlock_table_stats('owner','table1');

EXEC DBMS_STATS.unlock_table_stats('owner','table2');

Any help on this would be very much helpful!

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文