Hi,
I'm working on an Oracle Database 11g Release 11.1.0.6.0 - 64bit Production With the Real Application Clusters option.
I've to extract a recordset of about 2milions record and write them in a csv.
The records are from yesterady's, I mean, after midnight I select all records writte into a specific table yesterday.
The problem is that the select fails with the error
ORA-01555 snapshot too old
The select is quite an simple select:
SELECT e.id_data, e.id_device, to_char(d.date_write,'yyyymmddhh24miss') date_receive, to_char(e.date_event,'yyyymmddhh24miss') date_event, e.date_event date_event_dt,
dispatch.pk_test.get_data_hash(d.id_data) data, d.id_type_communication, dispatch.pk_test.get_event_hash(d.id_data) event, length(d.data) packet_length,
dispatch.pk_device_inout.get_ign_off(e.id_device) ign_off
FROM dispatch.t_data d, dispatch.t_event e
WHERE d.date_write >= trunc(sysdate-1) AND d.date_write < trunc(sysdate)
AND date_process is not null
AND e.id_data = d.id_data;
This dispatch.pk_test.get_data_hash returns from a vertical table where I've N records for the same id_data, an horizontal, ";" contatenade string of values of acolumn.
dispatch.pk_test.get_event_hash does the same with another table.
Finally this one dispatch.pk_device_inout.get_ign_off simply read another table, do an IF on a value and return a number depending on the IF result.
When the query doesn't fail (sometime happens) it took more or less 2 hours and a half.
Any suggestion to avoid/solve the ora-01555?
Thanks in advance,
Samuel