Saturday, November 5, 2022

Post Cutover R12.2 - Clear the old editions script


SQL> 

select

 '/* '||e.object_name||' '||s.osuser||' '||s.username||' '||s.program||' */' info

 , 'ALTER SYSTEM KILL SESSION '||''''||s.sid||','||s.serial#||''';' kill

 from

 v$session s

 , v$process p

 , database_properties run /* run edition name */

 , dba_objects_ae e

 where s.type <> 'BACKGROUND'

 and p.addr = s.paddr

 and run.property_name = 'DEFAULT_EDITION'

 and e.object_id = s.session_edition_id

 and e.object_name < run.property_value

 order by 1

 /

No comments:

Post a Comment