设为首页 加入收藏

TOP

TRUNCATETABLEHANG(六)
2015-07-24 10:27:41 来源: 作者: 【 】 浏览:3
Tags:TRUNCATETABLEHANG
k | t | 113747736 | t | 17 relation | 17020 | 11051470 | | | | | | | 2653219764 | 11121 | ShareLock | t | 113747736 | t | 18 relation | 17020 | 11051470 | | | | | | | 2653219764 | 11121 | AccessExclusiveLock | t | 113747736 | t | 18 relation | 17020 | 11051470 | | | | | | | 2653227486 | 11123 | AccessExclusiveLock | f | 113747736 | t | 19 relation | 17020 | 11051470 | | | | | | | 0 | 15309 | AccessShareLock | t | 75284454 | f | 19 relation | 17020 | 11051470 | | | | | | | 2653155802 | 11125 | AccessExclusiveLock | f | 113747736 | t | 20 relation | 17020 | 11051470 | | | | | | | 0 | 15320 | AccessShareLock | t | 75284454 | f | 20 relation | 17020 | 11051470 | | | | | | | 0 | 15330 | AccessShareLock | t | 75284454 | f | 21 relation | 17020 | 11051470 | | | | | | | 2653185053 | 11131 | AccessExclusiveLock | f | 113747736 | t | 21 relation | 17020 | 11051470 | | | | | | | 2653157522 | 11137 | AccessExclusiveLock | f | 113747736 | t | 22 relation | 17020 | 11051470 | | | | | | | 0 | 15341 | AccessShareLock | t | 75284454 | f | 22 relation | 17020 | 11051470 | | | | | | | 2653151279 | 11143 | ShareLock | t | 113747736 | t | 23 relation | 17020 | 11051470 | | | | | | | 2653151279 | 11143 | AccessExclusiveLock | t | 113747736 | t | 23 (48 rows) gtlions=# select distinct pid from pg_locks where relation='gtlions.cannottruncatetable'::regclass and pid!=14027; pid ------- 8822 8824 8827 8832 8838 8844 11121 11123 11125 11131 11137 11143 13091 13098 13118 13135 13146 13773 13789 13807 13830 13858 15309 15320 15330 15341 15567 15569 15572 15577 15583 15589 16256 16258 16261 16266 16271 16277 19567 19593 (40 rows) gtlions=# select procpid,sess_id,current_query,query_start, backend_start,client_addr,application_name from pg_Stat_activity where procpid in (select distinct pid from pg_locks where relation='gtlions.cannottruncatetable'::r gtlions.b-# ; procpid | sess_id | current_query | query_start | backend_start | client_addr | application_name ---------+---------+---------------+-------------+---------------+-------------+------------------ (0 rows) gtlions=# select procpid,sess_id,current_query,query_start, backend_start,client_addr,application_name from pg_Stat_activity where procpid in (select distinct pid from pg_locks where relation='gtlions.cannottruncatetable'::regclass and pid!=14027); procpid | sess_id | current_query | query_start | backend_start | client_addr | application_name ---------+---------+---------------+-------------+---------------+-------------+------------------ (0 rows) 终于发现了点异常情况,这个对象被不存在的会话进程锁住了,顿时觉得有希望了。
午饭过后发现 数据库被重启了,我F**K。。。。。自然而然再次执行truncate是没有问题了,白白丢失了一次可以继续摸索的机会。
附:还有的疑惑就是,之前曾经使用alter table rename to 是没有问题的,而这个命令和truncate应是持有同样级别的锁,按理来说不应该一个成功一个失败。
首页 上一页 3 4 5 6 下一页 尾页 6/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MySQL统计过去12个月的数据(包括.. 下一篇”凉?“的故事

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C语言中,“指针”用 (2025-12-26 15:20:18)
·在c语言的指针运算中 (2025-12-26 15:20:15)
·C语言-函数指针与函 (2025-12-26 15:20:12)
·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)