Dec 26, 2019

Oracle SQL-PLAN based on SQL query

To generate the cost for the query based on single table or a group of table pls follow the below syntax in TOAD / SQL Developer,

Step 1:

EXPLAIN PLAN FOR
select * from ap_suppliers;

Result =>
Explained.

Step 2:

select plan_table_output from table(dbms_xplan.display('plan_table',null,'basic'));

 Result =>
------------------------------------------
| Id  | Operation         | Name         |
------------------------------------------
|   0 | SELECT STATEMENT  |              |
|   1 |  TABLE ACCESS FULL| AP_SUPPLIERS |
------------------------------------------

Step 3:

select plan_table_output from table(dbms_xplan.display_cursor(null,null,'basic'));

 Result =>

EXPLAINED SQL STATEMENT:
------------------------
select plan_table_output from table(dbms_xplan.display('plan_table',null
,'basic'))

Plan hash value: 2137789089

-----------------------------------------------------
| Id  | Operation                         | Name    |
-----------------------------------------------------
|   0 | SELECT STATEMENT                  |         |
|   1 |  COLLECTION ITERATOR PICKLER FETCH| DISPLAY |
-----------------------------------------------------

Nov 26, 2019

How to Find the exact Error line in SQL Scripts using DBMS_UTILITY.FORMAT_ERROR_BACKTRACE

If you encounter any error in SQL file and many of the times the error console never display the correct line number where the actual error exist. Instead it will display the wrong lines and which will re-route us in somewhere !!!

To avoid this we have an standard API DBMS_UTILITY.FORMAT_ERROR_BACKTRACE and this show the correct line number where our real issue exist !

Sample Script:

DECLARE

err_code NUMBER;
err_msg  VARCHAR2(240);

BEGIN

{
...
.....
Logic of the Program
...
.....
}

EXCEPTION
     WHEN OTHERS THEN

      ROLLBACK;

err_code := SQLCODE;
err_msg  := SQLERRM;

FND_FILE.PUT_LINE(fnd_file.LOG,err_code||'->'||err_msg);
FND_FILE.PUT_LINE(fnd_file.LOG,DBMS_UTILITY.FORMAT_ERROR_STACK);
FND_FILE.PUT_LINE(fnd_file.LOG,DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

END;
/

Note: If your SQL scripts contains commented lines like /* */ or -- or REM then kindly ignore those lines and start your count from actual SQL script starts

Ex: SQL Code 

REM Script Name
-- Development Script version 1.0
/* 
Comments 1
Comments 2
*/

Declare

Line 1
Line 2

BEGIN

Line 3
Line 4

Exception 
When Others then 

Line 5

END;

Total Lines:  23 but actual script contains only 16

Kindly Ignore the comment lines (i.e) first 6 lines and then consider the remaining lines for the error findings


Oct 31, 2019

Oracle Branding Logo Change


Oracle Branding Logo Change



Step 1 : Place the XXX.Png file under $OA_MEDIA directory in App Tier.
Step 2 : Query the Profile & Change the value . 
              System Administrator > Profile - System.
              Query profile "Corporate Branding Image for Oracle Applications"
              Change the SITE level value to the name of the custom image file { XX_CUSTOM_LOGO.jpg }
Step 3 :  Clear the Cache From Functional Administrator.



Oct 17, 2019

TOAD TNS Entry Issue

TOAD for Oracle 9 or TOAD 10 – 64-bit Windows – ORA-12154: could not resolve the connect identifier specified or ORA-6413: connection not open

I recently downloaded the new 10.x version of TOAD and could not connect to my databases. Still running TOAD 9.x, no problem. This really threw me off for a minute, so I thought I would share the resolution.
You are likely running a 64-bit Windows OS and have installed TOAD into C:\Program Files (x86)\....
I simply copied over my entire Quest Software directory from C:\Program Files (x86)\... to C:\Program Files\..., and restarted the TOAD.exe. Everything is working great, without having to reinstall anything.

Sep 26, 2019

OAF Attachment Page with AK Entity

To display the content of attachments in OAF, we need to follow the below approach in JDevloper as well in EBS Application

Step 1: Create the AK Entity for the attachment section and map it to the right database table with Primary column

Responsibility: AK Html Forms
Navigation: AK Entities





Step 2: Under the Page development in JDevloper, create the region and attachment item with type 'attachmentLink'

Create a Region with 'defaultSingleColumn' and create a sub-item with type 'attachmentLink' and map the correct VO in the View Instance. Add the attachment Prompt and Link Text for user convenience.




Step 3: Create the Primary Key and Category Map under the entity map section for attaching the item with AK entities.


Step 4: Tag the correct Primary Key column in the View Attribute column for linking the content with FND_ATTACHED_DOCUMENTS table.

Note: All the uploaded content will be stored in FND ATTACHED DOCUMENTS table with the mapped primary column crId.

 Category is mentioned as MISC (Miscellaneous) under the categoryMap for the uploaded content.















Step 5: Validate the OAF page and result will be displayed like below for the Attachment Section,


















Page Controller to capture the raised attachment events,

    if ("oaAddAttachment".equals(pageContext.getParameter(EVENT_PARAM)) ||
     "oaUpdateAttachment".equals(pageContext.getParameter(EVENT_PARAM)) ||
     "oaDeleteAttachment".equals(pageContext.getParameter(EVENT_PARAM)) ||
     "oaViewAttachment".equals(pageContext.getParameter(EVENT_PARAM)) )

{

System.out.println("Attachment Event Raised");
     
}

Sep 24, 2019

OAF Setup for DB and APP Connection

All the custom page can be developed and tested in our work system with the help of JDeveloper before deploying it to the Oracle Application. But still it need access to Application and DB in order to avoid the unnecessary error while deploying the custom page in the E-Business Suite.

For developing any custom page we need both DB as well APP connection detail string in order to fetch the database objects and application infra for the proper deployment. If the custom development runs well in JDeveloper then it will surely works well in the Application side too.. !!!


A. Database Connection setup

Enter the following details in the DB Setup

Navigation: JDevloper (Tools --> Project Properties --> Oracle Application --> Database Connection)

Step 1: Enter the Database name (Naming Convention can be anything and not related to DB TNS entry)



Step 2: Enter the DB Username and Password


Step 3: Enter the DB Host name, Port and SID as per your DB TNS entry


Step 4: Test the connection and make sure it return the status "SUCCESS"



B. Application Setup for the Login User with DBC file

Keep the DBC file under the path "jdevhome\jdev\dbc_files\secure"



Make sure the FND user have the correct responsibility attached before mapping it in the APP setup

Enter the following details in the APP Setup

Navigation: JDevloper (Tools --> Project Properties --> Oracle Application --> Runtime Connection)

Step 1: Place the DBC file under the specified path as mentioned above and BROWSE and map it under the 'DBC File Name'

Step 2: Enter the Username and Pwd with right Application Short name and Responsibility Key.


Useful Workflow Commands

  WFLOAD apps/columbus789 0 Y DOWNLOAD APEXP_FINDEV.wft APEXP Locations: $PO_TOP/patch/115/import/US/porpocha.wft $PO_TOP/patch/115/import/U...