查询以检测静态锁并动态卸下静态锁
我们目前正在执行隔夜批处理,由于某些问题(仍在分析中),我们将在批处理完成后遇到桌锁的错误。现在,我们每天都在批处理前手动卸下锁,是否有一种方法可以使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论