Oracle快照在静态数据上太旧了

时间:2015-05-29 08:31:29

标签: oracle oracle11g oracle11gr2

我的报告是在一夜之间运行的。以前报告在select子句中保存了硬编码变量,但现在我想从静态数据表中读取。

到目前为止,我已经创建了一个新表,该表在报告中使用,并且在报告运行之前从中删除并插入和提交;发生的情况。

以下是流程:

@sql/regenerate_table.sql
spool data/report.csv
@sql/report.sql
spool off
quit;

regenerate_table.sql看起来像这样:

delete from schema.static_table_used_in_report@dblink;

insert into schema.static_table_used_in_report@dblink select * from
schema.master_table@dblink;

commit;

然后该报告沿着;

select x,y,z from 
(select x,y,y from @db1 where not in select * from     
schema.static_table_used_in_report@dblink
union all
select x,y,y from @db2 where not in select * from
schema.static_table_used_in_report@dblink
union all

etc.
group by x, y, z;

目前,schema.static_table_used_in_report中的数据与上一次报告中的硬编码值相同,但之前的报告大约需要1小时,而快照太旧则在启动后大约4小时内发生。我已尝试过硬编码与dblink的时间安排,两者之间没有任何明显的差异。

据我了解,只有在连续的查询/事务发生时才需要撤消 - 因为没有其他数据使用schema.static_table_used_in_report@dblink表,因此可以读取它们并不需要读取一致性。直接从磁盘重新读取。

有什么想法吗?

0 个答案:

没有答案
相关问题