Enormous acount of archive log produced for inserts
521878Jul 6 2006 — edited Jul 18 2006Hi there,
This is my first post on a forum ever. I have set up a test database that we will be installing on a customer site soon. One table is going to be very large (about 520 million rows). It is partitioned by range (on date) 53 ways (one for every week of the year + 1). I have written a PL/SQL script to load the table with about 1 million rows but I am baffled by the amount of archive log produced. Here is the PL/SQL script :
declare
TYPE hash_a IS TABLE OF VARCHAR2(15) INDEX BY VARCHAR(15);
TYPE array_a IS TABLE OF VARCHAR2(15) INDEX BY PLS_INTEGER;
min_to_meid hash_a;
min_array array_a;
temp VARCHAR2(20);
begin_time TIMESTAMP(0);
end_time TIMESTAMP(0);
begin
-- Initialise
FOR i IN 1..3000 LOOP
temp := TO_CHAR(6162500000 + i);
min_array(i) := temp;
-- Convert to hex char :
SELECT TO_CHAR(130791510000+i, 'xxxxxxxxx') INTO min_to_meid(temp) FROM DUAL;
END LOOP;
SELECT SYSTIMESTAMP INTO begin_time FROM DUAL;
begin_time := begin_time - interval '1' year;
end_time := begin_time + interval '1' minute;
FOR i IN 1..365 LOOP
FOR j IN 1..3000 LOOP
INSERT INTO SESSIONTAB (ms_msid, session_type, start_time, finish_time, call_type, error_type, cm_instance, term_state)
VALUES (min_array(j), 21, begin_time, end_time, 'OTAPA', 0, 1, 'ok');
END LOOP;
begin_time := begin_time + interval '1' day;
end_time := end_time + interval '1' day;
END LOOP;
end;
/
Essentially it is putting 3000 entries for each day into the table. Each partition increases in size by about 2,5MB -- ie 130MB in total. Yet the amount of archive log produced is crazy -- about 1GB (and that is multiplexed two ways meaning 2GB appear on disk!). All tablespaces for the table and its indexes are LOGGING. Surely this amount is excessive though? Any ideas what is going on??