How to Compile Forms in Oracle Applications Release 11i and Release 12?



Steps to compile forms  in  Oracle Applications Release 12.1.x and 12.2.x


Login to Application Tier node as applmgr user


Change to $AU_TOP/forms/US


Execute the Below command to generate form files.


frmcmp_batch userid=apps/<password> module=formname.fmb
output_file=$PROD_TOP/forms/US/<name>.fmx module_type=form batch=no compile_all=special


After execution of the above command, verify there are no compilation errors in output displayed and the fmx is created succesfully.



Steps to compile forms  in  Oracle Applications Release 11i


Login to Application Tier node as applmgr user


Change to $AU_TOP/forms/US


Execute the Below command to generate form files.


f60gen module=$AU_TOP/forms/US/<custom_form>.fmb  userid=apps/<passwd> output_file=$PRODUCT_TOP/forms/<customformname>.fmx module_type=form compile_all=yes




Tips:


Use command “f60gen help=y” or “frmcmp_batch.sh help=y” to find the optional parameters.


Using Compile_all= yes changes cached version in the source file in addition to compiling pl/sql in the utput fmx file.



How to Restore context file in oracle applications?

Scenario: Your Applications context file is either accidentally deleted or Corrupted. You do not have any latest backup of context file available.

Below are the steps to recreate context file 

The Applications context file can be retrieved by running the adclonectx.pl script.

perl /clone/bin/adclonectx.pl retrieve

Above script prompts for Database connection Info, apps username/password , Available Context files and the location to which context files can be restored.When prompted for the context file to be retrieved, select the option of retrieving the Applications tier context file that has been lost and retrieve it to the default location as in $CONTEXT_FILE parameter.

The above command can be used only when INST_TOP the is still intact. Incase if INST_TOP is also lost, the Applications tier context file may be retrieved as follows:

Execute the following command on the Database tier:
perl /appsutil/clone/bin/adclonectx.pl retrieve

When prompted for the context file to be retrieved, select the option of retrieving the Applications tier context file that has been lost.Choose the location to any writeable location and copy the restored context file to the value specified in $CONTEXT_FILE parameter on Application Tier.

To retrieve the Database tier context file,

Execute the following command on the Database tier:
perl /appsutil/clone/bin/adclonectx.pl retrieve

When prompted for the context file to be retrieved, select the Database tier context file and retrieve it to the default location ($CONTEXT_FILE on DB node).




What is the difference between dbtechstack,dbtier and dbconfig modes in Cloning?

While Cloning Oracle Applications, adcgclone can be executed in 3 Modes on Database node.




1)perl adcfgclone.pl dbTier

 It configures the ORACLE_HOME on the target database node and  recreate the controlfiles.
 This is used in case of standby database/hot backups.   


2)perl adcfgclone.pl dbTechStack 

It configures the ORACLE_HOME on the target database tier node only. Relink the oracle home.

The below steps has to be performed manually
1. Create the Target Database control files.
2. Start the Target System Database in open mode
3. Run the library update script against the Database
cd $RDBMS_ORACLE_HOME/appsutil/install/[CONTEXT NAME]
sqlplus “/ as sysdba” @adupdlib.sql [libext]
 Where [libext] should be set to ‘sl’ for HP-UX, ‘so’ for any other UNIX platform, 
or ‘dll’ for Windows.

3)perl adcfgclone.pl dbconfig

It configures the database with context file. Database must be open while running adcfgclone in dbconfig mode.
e.g 
cd $RDBMS_ORACLE_HOME/appsutil/clone/bin
perl adcfgclone.pl dbconfig <Context_file>


Where Target Context File is:
$RDBMS_ORACLE_HOME/appsutil/<SID_HOSTNAME>.xml



What are the daily activities of Oracle Applications DBA?

  1. Maintaining Oracle Application File System and Database using AD Utilities.
  2. Starting, stopping and troubleshooting issues related to Application server components.
  3. Using adadmin to relink executables, generate forms/reports,generate jar files, compile/validate APPS schema.
  4. Analyzing patch pre-requisites and Applying the Patches using AD Patch Utility on Application file System and Technology Stack.
  5. Applying Mini Packs, Family Packs, Maintenance Pack and Rollup patches.
  6. Applying database patches using opatch utility and troubleshooting issues related to OPatch.
  7. System administration activities like creating users, assigning Responsibilities, defining custom managers.
  8. Changing configuration files as per the requirement.
  9. Changing APPS password and Application database users’ password for security.
  10. Performing Healthchecks.
  11. Splicing off-cycle products using adsplice utility.
  12. Cloning of Oracle Applications 11i from Production to Test Instance.
  13. Taking backups- physical, logical, RMAN and performing Restore, Recovery.
  14. Troubleshooting issues related to concurrent managers.
  15. Managing System Configuration using Autoconfig.
  16. Modifying initialization parameters as per the requirement-PFILE AND SPFILE.
  17. Reorganization of tables that are fragmented.
  18. Creating users and assigning appropriate roles, privileges.
  19. Managing tablespaces and data files.
  20. Monitoring alert log file.
  21. Troubleshooting ORA- errors.
  22. Analyzing AWR reports.

How to enable Trace for Application User in Oracle Applications 11i/R12?



Enabling Tracing for a Application User makes diagnostics easier to analyze.Since only the sql operations performed by a specific User are Traced.





Steps to Enable Trace for Application User:


1.Login to Oracle Applications and select the System Administrator responsibility. 
Navigate to  Profile –>  System 


2.Search for Profile Option ‘Initialization SQL Statement – Custom’ .Also Specify the username whom you wish to enable tracing during Search.


3.
Under username column Update the below line


BEGIN FND_CTL.FND_SESS_CTL(”,”, ”, ‘TRUE’,”,’ALTER SESSION SET TRACEFILE_IDENTIFIER=’||””||’USER_TRACE_IDENTIFER’ ||””||’ EVENTS =’||””||’ 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12 ‘||””); END;


Note : Level cane be 4,8,12 depends on your requirement 




Save the Changes done in Profile Option


4. Be careful while updating the Profile Option, Any incorrect Syntax may Prevent user from Logging in


5. Inform User to Re-login and Perform the Activity which needs to be traced.


6. Trace Files can be found in the directory specified by “user_dump_directory” parameter on the database server.
Use the identifier given in Profile Option to search the trace file in udump directory.


7. After the issue is reproduced and required trace files are collected for analysis, disable Tracing from Front End.
Its recommended to disable the trace immediately after the diagnostics are collected, as it will generate huge logfiles.


8. Navigate to system=> Profile form under System Administrator Responsibility.


Query for the username  and Profile Option name “Initialization SQL Statement – Custom”


Remove the values and make it blank.


Save the changes.



Discoverer Login Fails with ORA-1017

Logging to discoverer url as sysadmin gives the following error.


ORA-1017: Invalid username/password
A connection error.  
– Oracle BI Discoverer is unable to authenticate using the password provided. This can happen due to an invalid password or because the password was lost while using back, forward, or refresh in your browser. Enter the password again to continue.
– Failed to connect to database – Unable to connect to Oracle Applications database (afscpgcs) 


Cause:


APPL_SERVER_ID parameter in .dbc file of Applications MT node(applmgr) and discoverer user is not matched




$diff test1_disco.dbc test1_mt.dbc


4c4
< APPL_SERVER_ID=178***********

> APPL_SERVER_ID=1A***********






Solution:


Copy the <SID>.dbc from $FND_TOP/secure or $FND_SECURE of Applications Middle tier to Disoverer user


Bounce Discoverer Services

How to Unlock Objects Statistics?

While running Concurrent Program, Gather Schema Statitics the request failed with error
20005: object statistics are locked (stattype = ALL)***

Logfile:

start of log messages from FND_FILE


+———————————————————————-


—–+


In GATHER_SCHEMA_STATS , schema_name= APPS percent= 10 degree = 2 


internal_flag= NOBACKUP


Error #1: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.CZ_MESSAGE_QENTRIES***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #2: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.ECX_INQUEUE***ORA-20005: 


object statistics are locked (stattype = ALL)***


Error #3: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.ECX_IN_OAG_Q_TABLE***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #4: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.ECX_OUTQUEUE***ORA-20005: 


object statistics are locked (stattype = ALL)***


Error #5: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_CRMXRWD_REQ_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #6: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_CRMXRWD_RES_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #7: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_CRMXRWL_REQ_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #8: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_CRMXRWL_RES_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #9: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_GTREQ_QTBL***ORA-20005: 


object statistics are locked (stattype = ALL)***


Error #10: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_GTRES_QTBL***ORA-20005: 


object statistics are locked (stattype = ALL)***


Error #11: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_HM000A_REQ_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #12: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_HM000A_RES_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #13: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_JTF_REQ_Q_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #14: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_JTF_RES_Q_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #15: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_RAPID_BP_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #16: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_RAPID_B_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #17: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_RAPID_ER_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #18: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_RAPID_MP_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #19: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_FM_RAPID_M_QTBL***ORA-


20005: object statistics are locked (stattype = ALL)***


Error #20: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_IH_BULK_QTBL***ORA-20005: 


object statistics are locked (stattype = ALL)***


Error #21: ERROR: While GATHER_TABLE_STATS:


                        object_name=APPS.JTF_PF_LOGGING_TABLE***ORA-


20005: object statistics are locked (stattype = ALL)***


+———————————————————————-


—–+


End of log messages from FND_FILE


+———————————————————————-


—–+

Solution:

This error comes when analyzing tables in oracle. Basic issue in this error is  when you
import table without data i.e structure/schema only, oracle will lock table statistics.
You can view all the locked tables in schema by executing following query:


select table_name, stattype_locked 
from dba_tab_statistics 
where owner = ‘APPS’ and stattype_locked is not null;

Then how to unlock them, following query will help us to sort this issue:


select ‘exec DBMS_STATS.UNLOCK_TABLE_STATS (”’|| owner ||”’,”’|| table_name 
||”’);’ from dba_tab_statistics where owner = ‘MBS’ and stattype_locked is not null;

or you can do that for every single table:


exec DBMS_STATS.UNLOCK_TABLE_STATS(‘owner’,’table name’);

How to Purge Workflow Notifications from Mailer Queue, so that Email is not sent to Users?

What to do when Workflow Notification  Mailer was not running properly for a certain period of time and accumulated all the emails in Workflow Queue.
We can Purge the workflow Mails which are not required by updating mail_status=’SENT’ for unwanted notifications in wf_notifications table.

Here are a couple of reasons to Purge Workflow Notifications

a)The end user may not want to receive outdated email.
b)The Workflow Queue has accumulated a lot of emails during the issue period, and processing has become very slow.

Below are the steps to Purge Workflow Notifications which are not required

1.First Take a Backup of wf_notifications table  and stop the Workflow Notification Mailer

2. Verify notifications from WF_NOTIFICATIONS table that has potential for being sent

SQL> select notification_id, recipient_role, message_type, message_name, status, mail_status
     from wf_notifications
     where status in (‘OPEN’, ‘CANCELED’)
     And Mail_Status In (‘MAIL’, ‘INVALID’)
     order by notification_id;
   
3. Narrow down the emails which are not to be sent by the Mailer from a specific date range.


SQL> select notification_id, begin_date, recipient_role, message_type, message_name, status, mail_status
     from wf_notifications
     Where Status In (‘OPEN’, ‘CANCELED’)
     And Mail_Status In (‘MAIL’, ‘INVALID’)
     and begin_date < sysdate-30              — List only emails older than 30 days ago
     order by notification_id;

4. Set Mail_status=’SENT’ in WF_NOTIFICATIONS

SQL>update WF_NOTIFICATIONS set mail_status = ‘SENT’
where mail_status in (‘MAIL’,’INVALID’)
and Status In (‘OPEN’, ‘CANCELED’)
and begin_date < sysdate-30;      


SQL>Commit;

This will update  notifications ,which are older than 30 days and waiting to be sent by the mailer to SENT.
Therefore the notifications will not get emailed when the Mailer is restarted.

5.Run the script $FND_TOP/patch/115/sql/wfntfqup.sql to purge the WF_NOTIFICATION_OUT queue and rebuild it with data currently in the WF_NOTIFICATIONS table. This is what purges all notifications waiting in the queue to be sent.  It will then populate the queue with the current data in the wf_notifications table.
Since you have changed the mail_status = ‘SENT” it will not enqueue these messages again.. Only the ones where mail_status = ‘MAIL’ and status = ‘OPEN’ will be placed in the WF_NOTIFICATION_OUT queue and sent by the mailer. (or CANCELED and INVALID if certain concurrent reports are run)

Example :
$ sqlplus usr/passwd@db @$FND_TOP/patch/115/sql/wfntfqup.sql APPSusr APPSpw FNDusr

Example Syntax:
$ sqlplus apps/***@db @$FND_TOP/patch/115/sql/wfntfqup.sql apps ***** applsys

6.Now start the Workflow Notification Mailer.