Wednesday, October 12, 2011

SQL2104N The ADMIN_MOVE_TABLE procedure could not be completed at this time by this user. Reason code: "9". SQLSTATE=5UA0M

So Here is the new error that I encountered when I executed  a procedure in my testing database.

CALL SYSPROC.ADMIN_MOVE_TABLE('SEP11','ALL_DATA_SEP11', 'USERSPACE1','USERSPACE1','USERSPACE1','', '', '', '','','MOVE')

 To know more details about the above procedure please check out this link

SYSPROC.ADMIN_MOVE_TABLE

Right after executing this procedure for about 2 mins I stopped it ,as I had to change the tablespace where my indexes should reside.

After changing the procedure call as follows

 CALL SYSPROC.ADMIN_MOVE_TABLE('SEP11','ALL_DATA_SEP11', 'USERSPACE1','TS8','USERSPACE1','', '', '', '','','MOVE');

 I have re run the procedure , that ended with an error

SQL2104N  The ADMIN_MOVE_TABLE procedure could not be completed at this time by this user.  Reason code: "9".  SQLSTATE=5UA0M

Steps to follow to get rid of this are :

1.Issue the following command for the table which was used in the procedure call

delete from SYSTOOLS.ADMIN_MOVE_TABLE where key = 'LOCK' and TABNAME='ALL_DATA_SEP11'



2. Call the  SYSPROC.ADMIN_MOVE_TABLE procedure for the same table with cancel option


CALL SYSPROC.ADMIN_MOVE_TABLE('SEP11','ALL_DATA_SEP11', 'USERSPACE1','TS8','USERSPACE1','', '', '', '','','CANCEL');

3.Call the procedure with the same tablename but now with MOVE option again

CALL SYSPROC.ADMIN_MOVE_TABLE('SEP11','ALL_DATA_SEP11', 'USERSPACE1','TS8','USERSPACE1','', '', '', '','','MOVE');


The first procedure call which was canceled ,if it doesn't create any temporary table then this should be enough to re run the procedure successfully. If it creates a table with some temporary name then the above procedure call generates this error.

SQL0601N  The name of the object to be created is identical to the existing name "SEP11.ALL_DATA_SEP11AIFdfZt" of type "TABLE".  SQLSTATE=42710

4. Issue the delete command only for the temporary table, be careful don't delete the original table.

delete table SEP11.ALL_DATA_SEP11AIFdfZt ;

5. Issue the procedure call for successfully starting the table movement.

CALL SYSPROC.ADMIN_MOVE_TABLE('SEP11','ALL_DATA_SEP11', 'USERSPACE1','TS8','USERSPACE1','', '', '', '','','MOVE');


Hope this was helpful ....!!!!!!!!

Any alternate way is always welcomed.....!!!