【发布时间】:2015-06-24 11:30:14
【问题描述】:
我在表 A 的 x 列中插入了一组大约 900 个查询。
然后我使用基本的 for 循环来循环并使用 Execute Immediate x ,问题是我想识别需要很长时间才能执行的查询,比如说 10 分钟以优化它们。 如果某些查询超过 10 分钟,是否有任何方法可以获取执行时间,我将其停止并将其 ID 记录在另一个表中并继续循环。
begin
for query in (select x from A)
loop
-- Some method to put a listner on the execution time
execute immediate query.x;
end loop
end;
谢谢
【问题讨论】:
-
什么是数据库类型? mssql/mysql?是存储过程吗?
标签: sql oracle oracle11g sqlplus