Hi everyone,
This is my first time posting. I am quite new to DB2. My company is using DB2/UDB v8.1.6 on a Win2k3 Box to run J.D. Edwards application. I am the unofficial DB2 administrator in the company.
I have a question which I hope someone can help me with. It's regarding deleting a whole bunch of tables in a script files.
To help me speed up the deletion, I know I have to issue a command:
ALTER TABLE table1 ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
to reduce the logging overhead.
My question is that, in my script. If I have 100 tables, do I need to run the ALTER TABLE command for the 100 tables 100 times?
E.g. Script1.sql:
ALTER TABLE table1 ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
DELETE FROM table1;
ALTER TABLE table2 ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
DELETE FROM table2;
ALTER TABLE table3 ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
DELETE FROM table3;
.
.
.
ALTER TABLE table100 ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
DELETE FROM table100;
COMMIT;
Many thanks if anyone could provide some insights.