Oracle从查询中删除挂在非常小的数据集上

时间:2014-10-01 22:45:19

标签: sql oracle oracle11g sqlplus

您好我正在尝试使用oracle 11g在sqlplus中运行删除语句。它工作正常,因为每次我测试我的程序时,我需要删除几千行,再次测试它,这只是程序的本质。然而,它突然停止删除行,现在只是挂起。我不确定为什么。

SQL> explain plan for delete from ip_address_usages where datetime= '30-SEP-14 22:44:00';

Explained.

SQL> SELECT * 
FROM   TABLE(DBMS_XPLAN.DISPLAY);  2  

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 250311489

----------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------
|   0 | DELETE STATEMENT   |                   |  2295 | 39015 |     7   (0)| 00:00:01 |
|   1 |  DELETE            | IP_ADDRESS_USAGES |       |       |            |          |
|*  2 |   TABLE ACCESS FULL| IP_ADDRESS_USAGES |  2295 | 39015 |     7   (0)| 00:00:01 |
----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter("DATETIME"=TO_TIMESTAMP('30-SEP-14 22:44:00'))

14 rows selected.

SQL> delete from ip_address_usages where datetime= '30-SEP-14 22:44:00';
20分钟后仍然坐在那里没有改变。

0 个答案:

没有答案