Home > Database > Mysql Tutorial > body text

Oracle kill session.delete 600w(1.25G)数据 1个多小时无结果

WBOY
Release: 2016-06-07 17:09:32
Original
1305 people have browsed it

mx表中数据太多,查询变慢,备份去年2011年的,然后将2011年数据删掉。delete from t_busi_presend_mx where cjsjlt;to_date(

mx表中数据太多,查询变慢,备份去年2011年的,然后将2011年数据删掉。 

delete from t_busi_presend_mx where cjsj

这个语句,执行1个多小时了,没有反应,,现在决定,把这个session删掉,想别的方法来删除这600W数据,kill session方法如下(按顺序执行sql)。某DBA给我分析:

1.select sum(bytes/1024/1024/1024) GB ,status from dba_undo_extents group by status;

kill session之前:

[sql]

kill session之后:

[sql]

答:

这个delete 操作,会将删除的数据放到 undo 回滚段里面,如果回滚段空间不够,就会等待,你的回滚段只有 14m,可用,所以这个删除操作停在这了。

两个办法

1 等

2 把这个进程杀掉

问:

等  应该是没有结果的吧 因为数据有1.25G 回滚段只有14M 怎么等都等不来吧 这种情况  会有结果么 ? 不是只有14M回滚段?
答:

不知道啥时候出结果,因为你的数据库一直在用。不是 只有 14m,而是只有 14m 可用。你现在没有删除成功,能回滚。杀进程吧。

 

2.select sid,serial#,logon_time,username,program,machine,event from v$session
  where wait_class 'Idle'
  order by logon_time desc
--查当前登录到数据库的会话

kill session之前:

我的电脑名:LEJER0FQOX6AT6H.所以上面第二行记录是我刚才执行的delete会话。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!