0

I'm working in DB2 ZOS Version 10, I have been working under data masking project. For this project I have been executing over 100k DDL statements (delete, update,insert) .

So I need to do disable the transaction logs before the whole SCRAMBLE PROCESS starts.

In DB2 iSeries AS400, I already handle the same issue by calling the procedure which helps to disable the TRANSACTION LOG DISABLE.

Like wise, I need to do in DB2 ZOS.

James Z
  • 12,209
  • 10
  • 24
  • 44
Vivek Harry
  • 419
  • 3
  • 11
  • 25
  • 1
    Perhaps being pedantic, but delete/update/insert is DML - Data Manipulation Language. DDL is Data Definition Language, used for changing the structure of the table. As to the question, I don't know that you can disable logging for the DML you mention. I'm pretty sure truncate is not logged, and I'm pretty sure a load can be done without logging, but I don't remember a way of turning off logging otherwise. You can change to some degree how much of the changed rows are logged though. – randomScott May 15 '17 at 15:52
  • @randomscott thanks for sharing this. I will do truncate instead of delete operation. And do you know the query to find archive log details? – Vivek Harry May 17 '17 at 11:43
  • Note that truncate deletes all rows, which may not be what you want. If it is what you want, it's probably faster than delete. There's probably some archive log details in the catalog tables. There's information about log delays and so forth recorded in the SMF data as well. Your best bet though is to talk to your friendly (hopefully) DB2 Sysprog that takes care of the DB2 in question. – randomScott May 18 '17 at 12:25
  • @randomscott thanks for the information – Vivek Harry May 18 '17 at 12:27

1 Answers1

2

You can use the NOT LOGGED attribute for all affected tablespaces, specifies that changes that are made to data in the specified tablespace are not recorded in the DB2 log

Take the following steps for your data masking process:

  1. Take an imagecopy so you can recover
  2. ALTER TABLESPACE database-name.table-space-name NOT LOGGED
  3. Execute data masking process
  4. ALTER TABLESPACE database-name.table-space-name LOGGED
  5. Take an imagecopy to establish a recovery point

You will also probably want to lock all tables with exclusive access so that if you have to recover no one else is affected by your changes

N.B. Make sure you're aware of the recovery implications for objects that are not logged!!!