1

We are using the Edition Based Redefinition feature in some software and as a DBA, I want to be able to determine which edition each given connection is using. This way, we can be sure all connections to the database are using the correct edition. How can I tell the edition being used by any given session?

2

Query V$SESSION and include the column SESSION_EDITION_ID which contains the value you are looking for.

The link http://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3016.htm#REFRN30223 defines all the column meanings for that dynamic view; I would probably do a query like

SELECT SID, USERNAME, SCHEMANAME, OSUSER, 
   PROCESS, MACHINE, TERMINAL, PROGRAM, 
   SESSION_EDITION_ID 
from V$SESSION  
order by SESSION_EDITION_ID;
| improve this answer | |
  • This returns 400 rows. How do I know which one is the correct one? – Superdooperhero Aug 30 '17 at 10:49
  • @Superdooperhero -- It depends; for me it might be adding criteria based on PROGRAM, OSUSER, or SCHEMANAME. If you have control over the creation of the session, you can use the columns MODULE and ACTION in the query, and when you create a session, invoke exec DBMS_APPLICATION_INFO.SET_MODULE(module_name=>'My_Module', action_name=>'do stuff'); then query for those values. – Mark Stewart Aug 30 '17 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.