November 26, 2012

How to reset user's Start Centers

Today I have discovered a nice script called cleanstartcenters.bat that can be used to force the reload of the Start Center for a specific set of users. The usage of this script is documented in this IBM TechNote.
Unfortunately, the script seems have some problems or I'm am too silly to use it :-) so I decided to develop my own set of SQL commands.

First of all you have to identify the set of start centers to be reset. In this example I want to reset all the start centers of the user's belonging to MYGROUP security group. Run this select and check the results.

SELECT * FROM scconfig WHERE groupname='MYGROUP';

Now replace the star (*) character with scconfigid and you will have something like this.

SELECT scconfigid FROM scconfig WHERE groupname='MYGROUP'

Now replace [SCLIST] in the following SQL delete statements with the previous select and execute them.

DELETE FROM rsconfig WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM faconfig WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM inbxconfig WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM kpilconfig WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM kpigconfig WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM actionscfg WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM portletdisplay WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));

If everything is fine you can run the last two deletes.

DELETE FROM layout WHERE layoutid IN (SELECT layoutid FROM layout WHERE scconfigid IN ([SCLIST]));
DELETE FROM scconfig WHERE scconfigid IN ([SCLIST]);


No comments:

Post a Comment