How to upload a logically consistent data set from several tables to the database under OLTP load?
For these purposes, ORACLE can use the wonderful tool FLASHBACK.
FB is positioned by ORACL as a dba tool providing retrospective table queries.
to restore lost information for any reason, or roll back all changes to a point in time in the past.
One of the reading modes works on the option SCN (System Change Number).
By fixing the SCN value, you can read an arbitrary amount of logically consistent information of approximately DB_FLASHBACK_RETENTION_TARGET minutes.
The post does not claim to be an exhaustive description of the FB functional, so the example below is schematic and sufficient to demonstrate its unconventional use.
Check the availability of the option FLASHBACK.
SELECT FLASHBACK_ON FROM V$DATABASE;
We issue an account under which the unloading works the necessary rights.
grant execute on SYS.DBMS_FLASHBACK to LOADER;
')
The SCN value can be obtained in several ways.
select sys.DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from dual; select TIME_DP, SCN from sys.smon_scn_time order by scn desc; SELECT TIMESTAMP_TO_SCN(sysdate-1/(24*60)) from dual;
Check the bike on the go.
create table FB_TABLE( p1 VARCHAR2(64)); select sys.DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from dual; GET_SYSTEM_CHANGE_NUMBER 8842201836421 insert into FB_TABLE (p1) values ('string_1'); commit; select sys.DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from dual; GET_SYSTEM_CHANGE_NUMBER 8842201836472 update FB_TABLE set p1='string_2'; commit; select sys.DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from dual; GET_SYSTEM_CHANGE_NUMBER 8842201836530 select t.* from FB_TABLE AS OF SCN 8842201836421 t; P1 select t.* from FB_TABLE AS OF SCN 8842201836472 t; P1 string_1 select t.* from FB_TABLE AS OF SCN 8842201836530 t; P1 string_2
According to this technology, several years of online gathering information from several dozen OLTP servers to an analytics server.