Monday, November 5, 2012

Browser Language Setting Can Wreak Havoc

Before this support incident I never realized that browser language setting can "Wreak Havoc" for oracle queries. 

We have supportable application developed in APEX which authenticates users with RSA login and check if necessary responsibility is available with user. The issue occurring was few users were getting access denied custom errors even when they had needed access. 
After many days of debugging efforts we could get to root of Access Denied error users were receiving in Firefox browser.

Usual debugging steps like trying the queries at our end , logging debug messages were not giving expected results. The same user was able to login from different desktop giving suspicion on browser settings.
Usual helpdesk tips like uninstalling browser and re-installing it also didn't worked.

After some brainstorming on debug messages we came to conclusion that query itself is failing and getting changed run time for the user. On close look we found use of _VL tables from Oracle EBS. Then we asked user for browser language and alaas..... user was using en-gb( English United Kingdom) as browser language and this was causing count zero for the query checking active supportable responsibility.



Browser language change set nls language on database session changing native language and queries can fail if US English is not default language. Other altenative is not to use_VL or _TL views from Oracle EBS and to design queries on base tables directly. 

Lesson learned after too many to and fro communications with user and constrained testing environment!!! 

Technical details

Setting language runs below


export NLS_LANG="ENGLISH_UNITED KINGDOM.WE8MSWIN1252"

The purpose of the ALTER SESSION statement is "to specify or modify any of the conditions or parameters that affect your connection to the database. The statement stays in effect until you disconnect from the database." 

Query which caused failure 
    SELECT count(1)
      INTO l_user_resp_cnt
      FROM fnd_user fu,
        fnd_user_resp_groups_all furgd,
        fnd_responsibility_vl frv
      WHERE fu.user_id = furgd.user_id
      AND furgd.responsibility_id = frv.responsibility_id
      AND fu.user_name = APEX_CUSTOM_AUTH.GET_USERNAME
      AND fu.user_name = v_final_user
      AND frv.responsibility_name = 'RH Supportable Self Service'
      AND furgd.start_date <= sysdate
      AND NVL(furgd.end_date, sysdate + 1) > sysdate
      AND fu.start_date  <= sysdate
      AND NVL(fu.end_date, sysdate + 1) > sysdate
      AND frv.start_date <= sysdate
      AND NVL(frv.end_date, sysdate + 1) > sysdate;

    View FND_RESPONSIBILITY_VL uses t.LANGUAGE = USERENV ('LANG') condition which causes no data found and hence count 0

    Fix was to use FND_RESPONSIBILITY_TL  FND_RESPONSIBILITY tables in query

    Good debugging stuff, when ideas are dried up..  right ? :) Keep working 






    Thursday, November 1, 2012

    Patch Wizard in Oracle EBS

    Here is Oracle's  answer to question " How do I know what changes xxx patch does to my system , what is impact"

    Patch Wizard is a Web-based utility in Oracle Applications Manager (OAM)

    Navigation : Login to System Administrator

    Oracle Applications Manager-->Patching and utilities -->
    Select Feature ( Dropdown at right top corner ) Patch Wizard

    There are different task names listed there for performing specific task.

    Patch Staging directory is defined in "Patch Wizard Preferences" task

    "Recommend/Analyze Patches" task allows you to analyze specific patch mentioned in text box.

    Tip : If Metalink login does not connect from the Apps server,
    the patch Zip file can be downloaded from metalink and FTP'ed to
    Patch staging directory and /ad directory . Read light blue note
    below the patch numbers box in "Recommend/Analyze Patches" task

    This submits request set to run and once completed, Impact analysis is done and
    presented in  "Recommended Patches Results" section

    Note : I think there should be way to generate nice impact analysis document
    for presenting it to management , but I could not get something similar yet.
    There can be query to get the details in reader-friendly format.
    Clicking on each hyperlink to see impact is cumbersome

    Details on how to use patch wizard can be found at

    http://www.in-oracle.com/Oracle-Apps/11i/patch-impact-analysis.php

    http://docs.oracle.com/cd/E18727_01/doc.121/e12148/T531058T531063.htm

    P.S. Till today I could not get query which will nicely display impact analysis. Crude way to provide the screen shots after clinking on impact details button  in patch wizard screens. I certainly believe there exists some query which will easily generate user friendly report on patch impact analysis.