Mass Unlock Definitions

If you have a number of developers in your organisation working in your master development environment, then chances are there are a lot of locked definitions (through change control locking).

The idea of locking definitions is to signify to other developers that you are working with that object. Once you are finished what you are doing and the changes have been migrated, you should unlock these definitions to mark them as being free for other developers to use.

However, over time, people forget to unlock definitions (or have moved on and no longer work in your organisation) so a mass clean up is typically in order.

You can mass unlock definitions through Application Designer using:

  • Tools > Change Control > View Locked Definitions

This lets you go through locked objects by type and user and unlock them in bulk. You can also set the user field to (all) and go through locked definition for all users.

Here's a screenshot of some of the record definitions I had locked:

mass-unlock-definitions.png

Selecting all the definitions (click on the first one, hold SHIFT, click on the last one) and using right click brings up the unlock definitions menu. Once you click on this, you will be asked to provide an unlock object comment:

mass-unlock-definitions-comment.png

You can also use the CTRL key to select particular definitions in the list.

I have noticed a bug with PeopleTools 8.48.15 and unlocking SQL definitions this way - it doesn't seem to work. If you have noticed something similar please comment.

While this is certainly handy, the one thing that is hard to determine is what objects are locked by a particular user. For this, you can use the following queries which work off the Change Control Lock (PSCHGCTLLOCK) PeopleTools table.

Summary of objects locked by users

This query gives you a summary count of locked objects by operator ID:

select
    OPRID,
    count(OBJECTVALUE1) as LOCKED_OBJECTS
from 
    PSCHGCTLLOCK
group by 
    OPRID
order by 
    LOCKED_OBJECTS desc;

Objects locked 90 or more days ago

This query returns all objects that were locked 90 or more days ago. These hopefully don't need to be locked any more.

select
    DTTM_STAMP,
    OPRID,
    OBJECTTYPE,
    OBJECTID1,
    OBJECTVALUE1,
    PROJECTNAME
    INCIDENT_ID,
    DESCRLONG as COMMENTS
from 
    PSCHGCTLLOCK
where
    DTTM_STAMP <= sysdate - 90
order by
    DTTM_STAMP asc
;

Locked objects by operator ID

Shows what objects are locked by a user. Object type translates are based on this article and I've added some extra ones but this may still not be 100% correct, so please comment if you find others.

Remember to replace <OPRID> with the appropriate operator ID.

select
    DTTM_STAMP,
    OPRID,
    OBJECTTYPE,
    decode(OBJECTTYPE
    ,0,'Record'
    ,1,'Index'
    ,2,'Field'
    ,3,'Format definition'
    ,4,'Translate'
    ,5,'Page'
    ,6,'Menu'
    ,7,'Component'
    ,8,'Record PeopleCode'
    ,9,'Menu PeopleCode'
    ,10,'Query'
    ,11,'Tree structure'
    ,12,'Tree'
    ,13,'Access group'
    ,14,'Color'
    ,15,'Style'
    ,16,'Not used'
    ,17,'Business process'
    ,18,'Activity'
    ,19,'Role'
    ,20,'Process definition'
    ,21,'Process server'
    ,22,'Process type'
    ,23,'Process job'
    ,24,'Process recurrence'
    ,25,'Message catalog entries'
    ,26,'Dimension'
    ,27,'Cube definitions'
    ,28,'Cube instance definitions'
    ,29,'Business interlink'
    ,30,'SQL definition'
    ,31,'File layout definition'
    ,32,'Component interfaces'
    ,33,'Application Engine program'
    ,34,'Application Engine section'
    ,35,'Message node'
    ,36,'Message channel'
    ,37,'Message definition'
    ,38,'Approval rule set'
    ,39,'Message PeopleCode'
    ,40,'Subscription PeopleCode'
    ,41,'Not used'
    ,42,'Component interface PeopleCode'
    ,43,'Application engine PeopleCode'
    ,44,'Page PeopleCode'
    ,45,'Page field PeopleCode'
    ,46,'Component PeopleCode'
    ,47,'Component record PeopleCode'
    ,48,'Component record field PeopleCode'
    ,49,'Image'
    ,50,'Style sheet'
    ,51,'HTML'
    ,52,'Not used'
    ,53,'Permission list'
    ,54,'Portal registry definitions'
    ,55,'Portal registry structures'
    ,56,'URL definitions'
    ,57,'Application Packages'
    ,58,'Application Package PeopleCode'
    ,59,'Portal Registry User homepage'
    ,60,'Problem type definition'
    ,61,'Archive templates'
    ,62,'XSLT'
    ,63,'Portal Registry User Favorite'
    ,64,'Mobile page'
    ,65,'Relationships'
    ,66,'Component Interface Property PeopleCode'
    ,67,'Optimization Models'
    ,68,'File References'
    ,69,'File Reference Type Code'
    ,70,'Archive object definitions'
    ,71,'Archive Templates Type 2'
    ,72,'Diagnostic Plug-Ins'
    ,73,'Analytic Models'
    ,79,'Service'
    ,80,'Service Operation'
    ,81,'Service Operation Handler'
    ,82,'Service Operation Version'
    ,83,'Service Operation Routing'
    ,84,'IB Queues'
    ,85,'XMLP Template Definition'
    ,86,'XMLP Report Definition'
    ,87,'XMLP File Definition'
    ,88,'XMLP Data Source Definition'
    ,89,'Merge'
    ,255,'Project'
    ,OBJECTTYPE) as OBJECTYPE_DESCR,
    OBJECTID1,
    OBJECTVALUE1,
    OBJECTID2,
    OBJECTVALUE2,
    OBJECTID3,
    OBJECTVALUE3,
    OBJECTID4,
    OBJECTVALUE4,
    PROJECTNAME,
    INCIDENT_ID,
    DESCRLONG as COMMENTS
from
    PSCHGCTLLOCK
where
    OPRID = '<OPRID>'
order by
    OBJECTTYPE
;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License