Thursday, 20 June 2019

Script to find JDR_UTILS for the OAF page from Back end

--------------------------------------------JDR_UTILS----------------------------------

/******************* JDR_UTILS.LISTDOCUMENTS *******************/       

Use this API to list of all OA Framework documents in the given path/module.
It provides list of all the pages/extensions/personalizations.

Parameters:
1. Full/Partial path of MDS repository
2. TRUE will direct the API to list all Child Documents underneath that tree path

Example:

BEGIN
   jdr_utils.listdocuments ('/oracle/apps/eam/workorder/', TRUE);
END;
/

/******************* JDR_UTILS.LISTCUSTOMIZATIONS  *******************/   
Use this API to list all personalizations/Extensions/COntents of a specific Object.

Example:

BEGIN
   jdr_utils.listcustomizations (
      p_document => '/xxprod/oracle/apps/eam/workorder/webui/CreateUpdateWOPG');
END;
/

 /*******************   JDR_UTILS.PRINTDOCUMENT    *******************/   

This procedure lists the contents of a specific object.
For example, using below code, we can get all the components(items and page properties) of the page -> TrackPG

BEGIN
   jdr_utils.printDocument (
      '/xxprod/oracle/apps/eam/workorder/webui/CreateUpdateWOPG');
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.PUT_LINE (SQLERRM);
END;
/

/******************* JDR_UTILS.DELETEDOCUMENT   *******************/

You can delete a page/personalization/extension by using command below.
For example to delete the Application Module substitution, use command

BEGIN
   jdr_utils.deletedocument (
      p_document => '/oracle/apps/eam/workorder/server/WOCreateUpdateAM');
END;
/

Wednesday, 19 June 2019

SQL to Identify/Remove Locked Objects in Oracle

The Following SQL Script is used to finds the locked Objects in Oracle.

---------------------- SQL to find SID and Serial# number ---------------
-----------------------------------------------------------------------------------
SELECT C.OWNER,
       C.OBJECT_NAME,
       C.OBJECT_TYPE,
       B.SID,
       B.SERIAL#,
       B.STATUS,
       B.OSUSER,
       B.MACHINE
  FROM V$LOCKED_OBJECT A, V$SESSION B, DBA_OBJECTS C
 WHERE B.SID = A.SESSION_ID AND A.OBJECT_ID = C.OBJECT_ID;

-----------------------------------------------------------------------------------

Once we have identified the locked objects, the below script will help us to removes the lock of the objects. Here we need to provide the SID and SERIAL# values from the above query.

---------------------------------- SQL to Kill session ------------------------
-----------------------------------------------------------------------------------
   ALTER SYSTEM KILL SESSION 'SID,SERIAL#';

-----------------------------------------------------------------------------------