How to fix a SQLCODE=-148 in a RC/Migrator strategy with a clone table
search cancel

How to fix a SQLCODE=-148 in a RC/Migrator strategy with a clone table

book

Article ID: 104031

calendar_today

Updated On:

Products

RC/Migrator for DB2 for z/OS RC Compare for DB2 for z/OS

Issue/Introduction

A RC/Migrator for Db2 for z/OS (RCM) Compare strategy generated the following ALTER statements to add a column to a clone table.
 
ALTER TABLE ... DROP CLONE;
ALTER TABLE ... ADD ... to add the column.
ALTER TABLE ... ADD CLONE ... to add again the clone table.

This last ALTER statement was wrong and it created an SQLCODE = -148, the versioning has to be removed with a Reorg Utility after the ALTER TABLE ... ADD statement to add the column.
 
DSNT408I SQLCODE = -148, ERROR:  THE SOURCE TABLE OR TABLESPACE
         XXXXXX.CLONE_SAMPLE CANNOT BE ALTERED. REASON 09
DSNT418I SQLSTATE   = 42809 SQLSTATE RETURN CODE                
DSNT415I SQLERRP    = DSNXICLN SQL PROCEDURE DETECTING ERROR                                           
...

Resolution

In order to resolve the SQLCODE -148, you need to work with the following steps.

1) Analyze again the Compare strategy using a Utility Model which has Online Reorg utilities defined.

_ Y OREORGT T PENDING DDL ONLINE REORG
_ Y OREORGTS TS PENDING DDL ONLINE REORG

The analysis will generate an Online Reorg utility statement after the ALTER TABLE ... ADD ... which adds a column to the base table.
 
2) Before executing the newly created strategy, you need to set the continue if warning to 'Y' in the Batch Processor Interface panel.
 
CONTINUE IF:               
 -WARNING            ===> Y