Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Tuesday, March 15, 2011

DDL Locks on Objects


Create Or Replace Force View Sys.Av_lock_ddl_on_obj (Sid,
                                                     Serial#,
                                                     Owner,
                                                     Obj_name,

                                                     Type,
                                                     Mode_held,
                                                     Mode_requested,
                                                     Terminal,
                                                     Username,
                                                     Osuser,
                                                     Program,
                                                     Last_call_et,
                                                     Killstmt
                                                    )
As
   Select   S.Sid, S.Serial#, L.Owner, L.Name Obj_name, L.Type, L.Mode_held,
            L.Mode_requested, S.Terminal, S.Username, S.Osuser, S.Program,
            S.Last_call_et,
               'Alter SYSTEM Kill Session '
            || ''''
            || S.Sid
            || ','
            || S.Serial#
            || ''' '
            || 'IMMEDIATE;' Killstmt
       From Dba_ddl_locks L, V$session S
      Where S.Sid = L.Session_id
        And L.Owner Like 'HOME%'
   Order By Obj_name;

No comments: