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.....!!!



Thursday, July 21, 2011

DB21009E This command must be launched from a command window running with full administrative privileges. Problem resolution in Windows 7

DB21009E This command must be launched from a 
command window running with full administrative privileges. 
Problem resolution in Windows 7


Well I have been receiving this problem in Db2 v9.7 on Windows 7 from the day I started working on it.

In our company all the desktops were updated to have WINDOWS 7 running in them.

I logged in Windows 7 with "administrator" user and installed Db2 V9.7,and while configuring the instance just made sure that the instance is not automatically started when is system is booted.This started my problems

As our company doesn't give all the users admin privileges at the operating system level,I was not able to start the Instance after logging in with a standard user.

Every time I issued "db2cmd" at the run prompt

DB2CMD Windows invocation in Windows 7:



and tried starting the Instance by issuing "db2start" I got this error.

"DB21009E This command must be launched from a command window running with full
administrative privileges.
SQL1092N "USERNAME" does not have the authority to perform the requested command
or operation."

DB2CMD PROMPT WITH ERROR MESSAGE:


I tried adding the user to the "db2admins" Group and "Administrators" group but still there was the same problem.

Resolution:

After adding the user to "Administrators" group at the operating system level, whenever you invoke db2cmd window try to follow these steps


1. Click on Windows 7 START Button
2. In "search Program and files " search bar type "db2cmd" when you find the db2cmd in the program list then right click on it and select “Run as Administrator” from context menu.

3. This should bring elevated db2 command prompt with full Administrators rights.
4. Issue "db2start" from this window and this will start the instance.

Method 2:
1. Click on Start and type db2cmd in search bar
2. And now press crtl+Shift+Enter
3. This will bring up the elevated db2 command prompt with full Administrators rights.
Method 3:
Disable and Turnoff UAC(User Account Control) in Windows 7 from Control Panel

Note: Please keep in mind that if you are not a part of "Administrators" group then you need to enter username and password of administrator user to access elevated db2 command prompt.