Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Lock and unlock an APEX workspace (APEX 5.0.3)
Lock and unlock an APEX workspace [message #659953] Mon, 06 February 2017 05:05 Go to next message
John Watson
Messages: 7150
Registered: January 2010
Location: Global Village
Senior Member
The other day we had problems with a database that were caused by work being done by users in a particular workspace. I'm not asking for advice about these problems. To get out of trouble quickly, we locked the wprkspace using the appropriate option in the APEX GUI. Now, accoring tio the docs, locking a workspace is a one way operation:
Quote:
Locking a Workspace
Oracle Application Express administrators can lock a workspace to address security or performance issues. Locking a workspace immediately locks all workspace administrator, developer and user accounts in the workspace. It also changes the status of all applications in the workspace to Unavailable.

Warning:
Locking a workspace makes it permanently inaccessible.
but that is not correct. We have now unlocked the user accounts for that workspace and set the applications to "available" and it all seems to be working.
My first question is whether that is the correct procedure to unlock a workspace. Is it sufficient or have I missed something? Is there a better way?
The second is whether there will be a way to do this programmatically, so it can be scripted if I have to do it again. I did it through the GUI which was OK as there were only a dozen or so users and few applications, for a big workspace that would be impractical. Before I try to find the APIs, I'ld to know if they exist.

Thank you for any insight.
Re: Lock and unlock an APEX workspace [message #659967 is a reply to message #659953] Mon, 06 February 2017 10:49 Go to previous messageGo to next message
Littlefoot
Messages: 21240
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I've never had to do that so I don't have any experience. Although, there's the APEX_UTIL.LOCK_ACCOUNT; maybe you could use it instead of locking the workspace. It might be OK for what you need, but only if it acts immediately. Maybe you could test it (there's an example in documentation, a simple loop through set of users).
Re: Lock and unlock an APEX workspace [message #659968 is a reply to message #659967] Mon, 06 February 2017 11:06 Go to previous messageGo to next message
John Watson
Messages: 7150
Registered: January 2010
Location: Global Village
Senior Member
Ah! Thank you. That would have been a better way. I think one would have to set the session context (or whatever it is called) to the appropriate workspace, and then loop through the accounts to lock/unlock them? I'm sure I could manage to break any exiting sessions.
Re: Lock and unlock an APEX workspace [message #660170 is a reply to message #659968] Fri, 10 February 2017 09:30 Go to previous messageGo to next message
gazzag
Messages: 905
Registered: November 2010
Location: Bristol, UK
Senior Member
John, what about locking the workspace account at the database level:
SQL> ALTER USER <ws_user> ACCOUNT LOCK;'
Re: Lock and unlock an APEX workspace [message #660174 is a reply to message #660170] Fri, 10 February 2017 11:27 Go to previous message
John Watson
Messages: 7150
Registered: January 2010
Location: Global Village
Senior Member
Ta, but I don't think that is enough: users don't logon to the schema that owns all the objects, they come in through a pool of connections to the APEX_% and ORDS_% accounts. Perhaps if one were using an authentication scheme based on Oracle user names (which I think is possible) then it could be done at that level.
Previous Topic: apex with Oracle EBS R12
Next Topic: Prevent line wrap in field on APEX page
Goto Forum:
  


Current Time: Wed Nov 22 12:42:42 CST 2017

Total time taken to generate the page: 0.03364 seconds