Saturday, 13 February 2016

Script to compile Invalid objects



Generic Script:

DECLARE
    l_stmt   VARCHAR2 (2000);

    CURSOR c_invalid IS
          SELECT *
            FROM all_objects
           WHERE     1 = 1
                 AND object_name LIKE 'XX%'
                 AND STATUS = 'INVALID'
                 AND OWNER = 'APPS'
        --AND OBJECT_TYPE='PACKAGE BODY'
        ORDER BY DECODE (OBJECT_TYPE,
                         'VIEW', 1,
                         'PACKAGE', 2,
                         'PACKAGE BODY', 3,
                         4);
BEGIN
    FOR c_rec IN c_invalid
    LOOP
        BEGIN
            IF c_rec.object_type = 'VIEW'
            THEN
                l_stmt := 'ALTER VIEW ' || c_rec.object_name || ' COMPILE ';
            ELSIF c_rec.object_type = 'PACKAGE'
            THEN
                l_stmt :=
                    'ALTER PACKAGE ' || c_rec.object_name || ' COMPILE ';
            ELSIF c_rec.object_type = 'PACKAGE BODY'
            THEN
                l_stmt :=
                    'ALTER PACKAGE ' || c_rec.object_name || ' COMPILE BODY';
            ELSE
                  l_stmt :=
                    'ALTER ' || c_rec.object_type|| '  ' || c_rec.object_name || ' COMPILE';                   
            END IF;

            EXECUTE IMMEDIATE l_stmt;
        EXCEPTION
            WHEN OTHERS
            THEN
                NULL;
        END;
    END LOOP;
END;
/
---------------------------------------------------------

declare
CURSOR c_invalid
is
SELECT object_name
FROM user_objects
WHERE object_NAME LIKE 'OKC\_%' ESCAPE '\'
AND status <> 'VALID'
AND  object_type='SYNONYM';
BEGIN
 FOR c_rec IN  c_invalid
  LOOP
    BEGIN
        EXECUTE IMMEDIATE 'Alter SYNONYM '||c_rec.object_name||' Compile';
    exception
    WHEN OTHERS THEN
     Dbms_Output.put_line(SQLERRM ||'  ' ||c_rec.object_name);
    END;
  END LOOP;
END;
/

declare
CURSOR c_invalid
is
SELECT object_name FROM user_objects
WHERE object_NAME LIKE 'OKC%'
AND status <>'VALID'
AND  object_type='VIEW';
BEGIN
 FOR c_rec IN  c_invalid
  LOOP
    BEGIN
        EXECUTE IMMEDIATE 'Alter VIEW '||c_rec.object_name||' Compile';
    exception
    WHEN OTHERS THEN
     Dbms_Output.put_line(SQLERRM ||'  ' ||c_rec.object_name);
    END;
  END LOOP;
END;
/



declare
CURSOR c_invalid
is
SELECT object_name FROM user_objects
WHERE object_NAME LIKE 'OKC%'
AND status <>'VALID'
AND  object_type='PACKAGE';
BEGIN
 FOR c_rec IN  c_invalid
  LOOP
    BEGIN
        EXECUTE IMMEDIATE 'Alter package '||c_rec.object_name||' Compile';
    exception
    WHEN OTHERS THEN
     Dbms_Output.put_line(SQLERRM ||'  ' ||c_rec.object_name);
    END;
  END LOOP;
END;
/


declare
CURSOR c_invalid
is
SELECT object_name FROM user_objects
WHERE object_NAME LIKE 'OKC%'
AND status <>'VALID'
AND  object_type='PACKAGE BODY';
BEGIN
 FOR c_rec IN  c_invalid
  LOOP
    BEGIN
        EXECUTE IMMEDIATE 'Alter package '||c_rec.object_name||' Compile Body';
    exception
    WHEN OTHERS THEN
     Dbms_Output.put_line(SQLERRM ||'  ' ||c_rec.object_name);
    END;
  END LOOP;
END;
/




OAF Personalization profiles



To personalize a page or region, set the following profiles to YES at appropriate level:

Personalize Self-Service Defn
FND: Personalization Region Link Enabled

Enabling FND logging and getting FND log messages


Enabling FND logging and getting FND log messages
1. Go to System Administrator --> Profiles--> System.
2. Query for 'FND%LOG%' for the current user.
3. Set FND: Debug Log Enabled - 'YES'
       FND: Debug Log Level - 'Statement'
       FND: Debug Log Module - %

4. Log out and Login Again.

5. Run the following query in the database from the backend.
   select max(log_sequence) from fnd_log_messages;
   Note down the log sequence.
6. Reproduce the problem.
7. Run the following query in the database from the backend.
    select max(log_sequence) from fnd_log_messages;
    Note down the log sequence.
11. Run the following query in the database from the backend.
    select module,message_text from fnd_log_messages where log_sequence
between (sequence obtained in step 5) and (sequence obtained in step 7).

Enabling XDO logging in EBS in 12.1.3


Introduction:
Some times ORACLE support team asks to get XDO logs to trouble sheet problems related to XML Publisher reports or where XDO processing is used. 

Follow below steps to enable XDO logging 

Steps:
a. Connect to the Apache server as applmgr
b. Create an $XDO_TOP/temp and an $XDO_TOP/resource directory
c. Create an xdodebug.cfg file in the $XDO_TOP/resource directory (do not re-create if the file already exists), containing the following 2 lines:
LogLevel=STATEMENT
LogDir=[full XDO_TOP]/temp

d. Restart the Apache server.

Note full full XDO_TOP means complete path

Note: The xdodebug.cfg file can also be created in the $OA_JRE_TOP/jre/lib directory.

Contracts Core tables



Library tables:
OKC_ARTICLES_ALL  --> Stores basic article information
OKC_ARTICLE_VERSION  --> Stores article text along with version

OKC_TERMS_TEMPLATES_ALL  -->Terms template definition
OKC_ALLOWED_TMPL_USAGES --> List of document types for which above template can be used


Authoring tables 
OKC_TEMPLATE_USAGES  --> Template and document association table (Template Id + Document Type (ex: PO, RFQ, BID etc.) + Document Id (ex: Po header id, rfq id, bid id etc..). Template applied on a given document.

OKC_K_ARTICLES_B  --> Stores list of applicable clauses for a given document type and document id.

Friday, 29 January 2016

Enabling Forms Personalization Option

Issue:

When you try to access forms personalization menu option, you are getting error
"Function not available to this responsibility...."


Cause:
Profile set to Utilities:Diagnostics to No.


Solution:
Set the above profile to  Yes


The above profile controls access to following  Diagnostics submenu items 
   - Examine, Trace, Debug, Properties, and Custom Code.


For more details, refer to Oracle E-Business Suite System Administrator's Guide - Configuration and Controlling Access to the Oracle Forms-based Applications Diagnostics Menu

Forms personalization not visible

Issue:
Unable to see custom personalizations in any form, though they are present in the table, and seeded personalizations are viewable.

The issue could be because of  profile "FND: Enable Industry Editing" set to Yes.

This is the setting that the Oracle Localizations development uses to create Oracle delivered personalizations.  Oracle delivered personalizations must have a RULE_KEY.

Solution:
Set the profile "FND: Enable Industry Editing" to No and re-test.