Oct 20, 2012

Debugging made easy with Autonomous Transaction



Autonomous transaction is a very useful feature of PL/SQL, specially when debugging apps issues. 
At times, traditional apps logging like GMFZT log, FND log etc.. may not be of much help.
Not many debugging statements in your flow is one such example.
You can use the autonomous transaction with the code sample as given below.

Pros:
  • Won't disrupt the flow.
  • No change to transactional data that is waiting for commits in the flow.
  • Logs are inserted into table, so simple to see the log
  • Best method to know variable values at a specific point in code
Cons:
  • Has to modify the Package/procedure/function and recompile, which sometimes invalidate the dependent packages.

Code:
Run the following code only once to create the required table/sequence/procedure
CREATE TABLE oradebug_tbl 
(id NUMBER, 
message VARCHAR2(1000), 
edate DATE); CREATE SEQUENCE oradebug_seq 
START WITH 1 INCREMENT BY 1; CREATE OR REPLACE PROCEDURE insert_into_oradebug
(message IN VARCHAR2) AS pragma autonomous_transaction; BEGIN INSERT INTO oradebug_tbl VALUES (oradebug_seq.NEXTVAL, message,SYSDATE); COMMIT; END;

Sample Usage:
            DECLARE 
             l_temp date; 
     BEGIN 
             l_temp := TRUNC(SYSDATE); 
             insert_into_oradebug('Value of l_temp='||l_temp); 
     END;
     / 
Check the log:
SELECT * 
     FROM oradebug_tbl
ORDER BY id DESC


RetroPay Series - Basics & Evaluation



In a nutshell, RetroPay manages back-dated or late notifications of changes to payroll processing.

Technically, Retropay will bring forward the late adjusted entries of payroll runs.
It make
- Accurate re-calculations
- Bring forward the delta payments or deductions in the current pay period

Examples of RetroPay Scenarios
1) Monthly Bonus declared in middle of the year, for the entire year.
2) RetroActive Promotion, salary increase or absence details

Evaluation of RetroPay Process
  • RetroPay (by Aggregate)
    • Standard UK process until 11i, now Obsolete
  • RetroPay by Run
    • Japanese Market Only, now Obsolete
  • RetroPay by Element
    • Current supporting version by Oracle in R11i, R12.0, R12.1, Obsolete in R12.2.
    • Optional RetroNotification Report to view the assignments to be processed.
    • Enhanced Features compared to earlier versions (correction/back dated awards)
    • Can process one assignment or a group, using an Assignment Set.
    • New from HR_PF.H
    • "Start date" from which assignments needs to be back-payed should be provided by user and it is based on assignment set. In case of uneven back dates awards, or in case of larger assignment sets, this leads to performance issues.
  •  RetroPay (Enhanced)
    • A step forward to automatic RetroPay
    • Current Supporting versions R11i, R12
    • Addresses the main performance problem which exists with RetroPay by Element
    • Mandatory to run RetroNotification Report, which picks up the assignments to be processed and also calculate the date from which each assignment to be back-payed.
  •  QuickRetroPay 
    • Retropay for single assignment, currently supported as concurrent program.
    • Inspired by QuickPay
    • Available from R12.1 RUP5 and R12.2.
    • RetrNotification is automatically run by this process, so no need to run it explicitly.
What is Retro Notification?
  1. It is the process which checks, if historical entries have been changed.
  2. It will decide, the list of assignments for whom RetroPay should be run
  3. Retro Notification works on Event Model in Oracle apps. 
  4. List of events to be tracked should be included in event group and attach it to element.
  5. For RetroPay by Element, Retro Notification is optional and it works just as reporting tool. But for RetroPay (enhanced), it is mandatory to run Retro Notification.
Following example explains the way RetroPay works.
It shows a sample calculation of, how it internally calculates and populates the results.




Oct 10, 2012

Enable FND Logging

Follow the steps to enable FND Logging.


 A. Set the system profiles 
          FND: Debug Log Enabled -> Yes 
     FND: Debug Log Level   -> Statement 
     FND: Debug Log Module  -> % 

  B. Submit Create Accounting, or any process which has FND log statements.

  C. Run the following SQL after completion of CP using the CP request id 

       SELECT log_sequence, module,message_text 
       FROM fnd_log_messages 
       WHERE transaction_context_id in 
            (select transaction_context_id 
             from fnd_log_transaction_context 
             where transaction_id = <CP request id>) 
       ORDER BY log_sequence; 

Useful Tips for Technical Consultants


This is a placeholder for miscellaneous tips that are specially useful for apps technical consultants.

1) Useful queries to better know specific file and patch versions on an instance
select * from ad_bugs where bug_number=5356467;

select * from ad_files where filename='pyautfn.pkb';

select * from ad_file_versions where file_id=78626;
2) Query to know the list of routes that are using a specific balance dimension
      SELECT *
     FROM ff_routes
WHERE route_id IN (
 SELECT pdr.route_id
FROM pay_balance_dimensions pbd, 
               pay_dimension_routes pdr
       WHERE pbd.dimension_name =
'Assignment within Government Reporting Entity Inception To Date'
       AND pbd.legislation_code = 'US'
      AND pdr.balance_dimension_id = pbd.balance_dimension_id);

3) How to kill existing idle database sessions

  ALTER SYSTEM DISABLE RESTRICTED SESSION;
  /
  BEGIN   
FOR x IN (  
 select Sid, Serial#, machine, program  
 from v$session  
 where  
  STATUS <> 'ACTIVE'  
) LOOP  
execute immediate 'Alter System Kill Session '''|| x.Sid  
|| ',' || x.Serial# || ''' IMMEDIATE';  
END LOOP;  
  END; 
  /
  COMMIT;

4) How to gather Table statistics for a specific table.
begin 
dbms_stats.gather_table_stats('HR','PER_ALL_ASSIGNMENTS_F');
end;

To verify whether a Table is Analyzed or not
SELECT last_analyzed analyzed, sample_size, 
              monitoring, table_name
FROM dba_tables
WHERE table_name='PER_ALL_ASSIGNMENTS_F';

For a specific high percentage gather stats
exec fnd_stats.gather_table_stats('HR','PER_ALL_ASSIGNMENTS_F',40);

5) How to find out internal query that is being executed for a Database Item in payroll (DBIs)
SELECT 'SELECT ' || definition_text || ' FROM ' AS select_clause_text,
  text AS from_clause_text
 FROM ff_database_items fdi, ff_user_entities fue, ff_routes fr
WHERE fdi.user_name = 'NSW_STATE_TAX_RATE'
  AND fue.user_entity_id = fdi.user_entity_id
  AND fr.route_id = fue.route_id;

6) How to see for existing DB pipes
SELECT * FROM v$db_pipes;

To remove a specific DB pipe
DECLARE
        v_pipe_rm NUMBER;
BEGIN
         DBMS_PIPE.PURGE('PID95');
   v_pipe_rm := DBMS_PIPE.REMOVE_PIPE('PID95');
         DBMS_PIPE.RESET_BUFFER;
END;

7) How to know the list of indexes and index columns on a specific table.
              SELECT * FROM all_indexes
      WHERE table_name='PER_ALL_ASSIGNMENTS_F'

      SELECT * FROM all_ind_columns
  WHERE table_name='PER_ALL_ASSIGNMENTS_F'

8) Scripts to 
Bounce all the services of a running instance
R11i
To Stop ->  $COMMON_TOP/admin/scripts/adstpall.sh apps/<apps_passwd>
To Start -> $COMMON_TOP/admin/scripts/adstrtal.sh apps/<apps_passwd>
R12
To Stop ->  $INST_TOP/admin/scripts/adstpall.sh apps/<apps_passwd>
To Start -> $INST_TOP/admin/scripts/adstrtal.sh apps/<apps_passwd>

Bounce only Middle tier Services
R11i
To Stop ->  $COMMON_TOP/admin/scripts/adopmnctl.sh stopall
To Start -> $COMMON_TOP/admin/scripts/adopmnctl.sh startall
R12 
To Stop ->  $INST_TOP/admin/scripts/adopmnctl.sh stopall
To Start -> $INST_TOP/admin/scripts/adopmnctl.sh startall

9) Debug statement in fast formula, this debug statment is then visible in GMFZT log of payroll run.
x=IN_DEBUG('prorate_start',TO_CHAR(prorate_start))

10) How to generate formatted tkprof from a raw trace file.
tkprof <filename.trc> <output_filename> sys=no explain=apps/<password>@instance sort='(prsela,exeela,fchela)'

11) How to upload a payroll formula from Unix
     $FF_TOP/bin/FFXMLC apps/pwd@dbname 0 Y LOCAL pyffupload.hct
  Compile the uploaded formula
     $FF_TOP/bin/FFXBCP apps/pwd@dbname 0 Y %% <Formula Name>
12) Query to check if Concurrent manager is running or down.
        SELECT    'The ICM is Running on '
                  || node_name || '   -  since '
                  || TO_CHAR (last_update_date, 'MON/DD/YY HH:MI:SS AM') "CM Details"
        FROM fnd_concurrent_processes, fnd_v$process
        WHERE (os_process_id = spid 
        AND oracle_process_id = pid)
        AND (concurrent_queue_id = 1 
        AND queue_application_id = 0)

Backtrack FF Route name from route text



Sometimes, there can be a need to find out the FF route name given the route query.
This is the usual case while debugging Oracle Payroll performance issues.
If the expensive query that is found from the raw/tkprof formatted trace files is 
route query, it needs to be backtracked to find the FF route name.

FF Route text is stored in "text" column of ff_routes_f table.
But it's a long column, so it can't be matched with LIKE keyword.

Using the following code snippet a long column can be searched with LIKE keyword.

create global temporary table pv_test_temp(route_id number, text clob);

insert into pv_test_temp
select route_id,TO_LOB(text) text from ff_routes;

select * from ff_routes where route_id in 
(select route_id from pv_test_temp where text LIKE '%PBF%')

Useful queries in debugging Payroll issues


Few queries that are useful in debugging Payroll or Retropay issues in HRMS.

1) To get all the actions for an assignment
     SELECT   paa.assignment_id, ppa.payroll_id, ppa.business_group_id,
         hrl.meaning, ppa.action_status, ppa.effective_date, ppa.date_earned,
         ppa.payroll_action_id, paa.assignment_action_id, paa.action_status,
         paa.action_sequence, paa.source_action_id, paa.run_type_id
    FROM pay_assignment_actions paa, pay_payroll_actions ppa, hr_lookups hrl
   WHERE paa.payroll_action_id = ppa.payroll_action_id
     AND ppa.action_type = hrl.lookup_code
     AND hrl.lookup_type = 'ACTION_TYPE'
     AND paa.assignment_id = <<assignment_id>>
ORDER BY paa.action_sequence DESC;


2) To get all the Element Entries for an Assignment
    SELECT DISTINCT pet.element_name, pet.element_type_id, piv.NAME input_value,
                piv.input_value_id, pee.element_entry_id, pee.creator_type,
                pee.entry_type, pev.element_entry_value_id,
                pev.screen_entry_value, pev.effective_start_date,
                pev.effective_end_date, pee.creator_id, pee.source_id,
                pee.source_asg_action_id, pee.source_start_date,
                pee.source_end_date
           FROM pay_element_types_f pet,
                pay_input_values_f piv,
                pay_element_entries_f pee,
                pay_element_entry_values_f pev
          WHERE pee.assignment_id = <<assignment_id>>
            AND piv.element_type_id = pet.element_type_id
            AND pee.element_type_id = pet.element_type_id
            AND pee.element_entry_id = pev.element_entry_id
            AND pev.input_value_id = piv.input_value_id
       ORDER BY 1, 6, 5;


3) To get Run Results for an Assignment
     SELECT DISTINCT pet.element_name, piv.NAME, ppa.action_type,
                ppa.effective_date payroll_run_date, 
                paa.assignment_action_id,
                ppa.payroll_action_id, 
                prr.run_result_id, prv.result_value,
                prr.entry_type, prr.source_id, prr.source_type,
                prr.start_date, prr.end_date, prr.element_entry_id,
                prv.formula_result_flag
           FROM pay_element_types_f pet,
                pay_input_values_f piv,
                pay_run_results prr,
                pay_run_result_values prv,
                pay_assignment_actions paa,
                pay_payroll_actions ppa
          WHERE paa.assignment_id = <<assignment_id>>
            AND paa.payroll_action_id = ppa.payroll_action_id
            AND paa.assignment_action_id = prr.assignment_action_id
            AND prr.run_result_id = prv.run_result_id
            AND prv.input_value_id = piv.input_value_id
            AND pet.element_type_id = prr.element_type_id
            AND piv.element_type_id = pet.element_type_id
            AND ppa.action_type IN ('Q', 'R', 'V', 'B')
       ORDER BY 1, 2, 3, 4, 9, 10;




May 1, 2012

How to locate correct DBC file



DBC file is needed while working with JDeveloper. Sometimes it is most frustating to get correct dbc file because usually many dbc files are present on linux box (specially on dev instances) and ambiguous about which one to pick up.

Here are 3 ways to locate correct DBC file.

1)  Navigate to System Administrator -> Concurrent -> Requests, Click on "Submit a New Request" and submit 
   "Generate concurrent processing environment information" CP and let it complete. 
   Click on "View Output" button and locate "FND_SECURE" environment variable to find dbc file.
   DBC file can be found in $FND_SECURE directory or $FND_SECURE/<SID> directory with name <SID>.dbc

2) If you don't have access to System Administrator responsibility, try this way.
   Open any OA page, click on "about this page" link ("FND: Diagnostics" profile option should be set to YES), 
   click on "Page Context" tab and note down DBC file name and path.
   Alternatively, you can also click on "Java System Properties" tab and locate "DBCFILE" property to get the full path of DBC file.

3) If you don't have Linux box access, try this way.

    Open Oracle Applications homepage and append this to the URL:
     /OA_HTML/jsp/fnd/aoljtest.jsp

Enter DB details and click "Test" screen.



"AOL/J Diagnostic Tests" screen is displayed, come down and click on "Enter AOL/J Setup Test" link.

Click on "Locate DBC File" link as shown in the screenshot below. Copy and save the DBC file contents and use it.



 

Apr 27, 2012

Oracle EBS Alert - Basics


Idea of this post is to create a simple alert and test if it is working or not.
Just for example, assume a requirement to send Happy birthday mail to employees in an organization.

As you might already know by now, there are 2 kinds of alerts in oracle apps.
Periodic Alerts and Event based Alerts.
You are correct, we have to choose Periodic alert for our requirement.

Employee Birthday can be any calendar day of the year. So we will tell oracle apps 
to check daily once every calender day and see if today is employee's birthday and send email if true.

You need Alert Manager Responsibility to define a new Alert.
Navigate through Alert Manager -> Alert -> Define
Fill the options as given in the screenshot below.

Note that we need to write SQL which satisfies our condition and also to fetch required details. Here is the SQL

select global_name, date_of_birth, email_address
into &emp_name, &dob, &emp_email
from per_all_people_f
where trunc(sysdate) between effective_start_date and effective_end_date
AND to_char(to_date(date_of_birth),'dd') = to_char(to_date(sysdate),'dd')
AND to_char(to_date(date_of_birth),'mm') = to_char(to_date(sysdate),'mm');




You can check the SQL for syntax using "verify" button.

One point here, if any row that matches condition, it is called exception in Alert.
So when you click "run" button, it will display the number of exceptions occured (number of rows that satisfied the condition).

Next step is to define action if condition matches. Don't forget to select action level of type "Detail". This is because action should be performed once for every Alert Exception.



Then click on "Action Details" button and define the email message as shown below.
Note the fields highlighted in orange are the alias names that are defined in query (INTO clause). Oracle Alert will dynamically replace these aliases with the actual values at run time. The one highlighted in green is the hard coded constant "Reply to" email address.




That's not enough, we also need "Action Sets" and attach the action which we just created. Just follow the screenshots to do that.





Now comes the question, how do we test this Alert?

Go to Alert Manager -> Request -> Check, and schedule the Alert to run it sometime after current time.
It will submit a concurrent program. [In this example CP Name is "Birthday Wishes E-mail Alert (Check Periodic Alert)"]



Once concurrent program is successfully ran, the number of exceptions can be verified from Alert Manager -> History and query for alert. Here exceptions mean, the number of records that matched the SQL query and to be processed by Alert Engine.




Which means our Alert is working.
Note that you can do many more than just sending mails. Alert can execute SQL code/function/procedures and it can also run concurrent programs.
So why wait, go ahead and explore more. :-)

Apr 19, 2012

Good Trick to speed up Oracle HRMS API debugging


One good trick to ease development and debugging of Oracle Hrms API's.
The code behind any HRMS API has lots of trace statements.
Usual way of getting these debug statements is by enabling PYUPIP trace.
Alternatively if you know all the API parameters, you can turn on the trace by calling it in the following way.

BEGIN 
  hr_utility.set_trace_options('TRACE_DEST:DBMS_OUTPUT'); 
  hr_utility.trace_on; 
  <API call>
  hr_utility.trace_off; 
END;


Trace messages can be redirected to DB pipe using the following code snippet. It assumes DB pipe is already open and running.

BEGIN
  HR_UTILITY.TRACE_ON(NULL,'CRE_BATCH');
   <API CALL;>
  HR_UTILITY.TRACE_OFF;
END;

Mar 22, 2012

RetroPay Series - Different Dates in Enhanced RetroPay


As you may already know, RetroPay (Enhanced) process is the current advanced version of RetroPay and is a step forward to automatic back-pay processing.
Running Retro-Notifications Report (Enhanced) is a mandatory step before running in enhanced RetroPay.

How Retro Pay Works?
RetroPay process assignment by assignment. Oracle Payroll, internally, in a separate session, rollback and rerun all the payrolls of an assignment from a specified date. The system then compares the old balance values with the new ones and entry values are created for the RetroPay elements based on the difference of values.  These entries are processed for the assignments in the subsequent payroll run for your current period.
It is important to note that, no actual changes are made to audited payroll data, which means RetroPay process won't touch the existing data of previous payrolls.

There are different types of dates in the context of RetroPay with the descriptions as given below.

Date Earned
It is the date on which payroll action is created.
In fact, this is one of the columns in PAY_PAYROLL_ACTIONS table.
This date will be one for all assignments in a payroll.

Effective Date
It's one of the mandatory parameters of "Retropay (Enhanced)" Concurrent Program (CP) and RetroPay payroll action will be created with this date. Enhanced RetroPay internally checks if there are any payroll actions exists after this date and it will create derived retro element entries (if any) only when there are no future payroll actions after this date.
This date will be one for all assignments in a payroll.

Entry Creation Date
Optional parameter to RetroPay (Enhanced) CP, visible only to specific legislations like SA.
This is the date on which calculated retro element entries (EEs) are created.
This date can be greater than or equal to "Effective Date". This parameter is used to pay the back dated payroll changes in the future payroll periods, instead of current payroll periods.
It will be one for all assignments in a payroll.

Recorded Date
This date is used internally by Retro Notifications Report Enhanced (RNR) to list out all the assignments that have unaccounted back-dated changes in the given payroll. It can be defined as the date on which last RNR was run. For the first run of RNR on a fresh assignment, it will be "Date Earned" of latest payroll action.
This date will be one for one assignment. 

Reprocess Date
This date is calculated by RNR for an assignment based on the events that are logged.
It is the earliest date of all the back-dated changes on the given assignment. If there are no overlaps, RetroPay will rollback/rerun the payrolls in memory starting from this date. 
It is one of the columns in PAY_RETRO_ASSIGNMENTS table.
This date will be one for one assignment. 

Overlap Start Date
This date is internally calculated by enhanced EntroPay process depending on the overlappings with previous retropay runs.
It is the date from which actual rollback/re-run of payrolls happens in memory.
RetroPay recursive go back to all the overlaps (if exist) and calculates the earliest date from when payrolls need to re-run so that it derives correct results. 
This date will be one for one assignment.


Mar 9, 2012

Oracle Apps 11i and R12 Context/Environment Files/Variables





INST_TOP is newly introduced in R12. Following figures show the snapshot of file structures both in R11i and R12.


Important File Locations


File Oracle Apps 11i Oracle Apps R12
Environment Source file APPSORA.env APPS<SID>_<hostname>.env
Context File (Middle tier) $APPL_TOP/admin/$TWO_TASK.xml $INST_TOP/appl/admin/$TWO_TASK_<hostname>.xml
tnsnames.ora (OH) $ORACLE_HOME/network/admin/<CONTEXT> $INST_TOP/ora/10.1.2/network/admin
listener.ora $ORACLE_HOME/network/admin/<CONTEXT>$INST_TOP/ora/10.1.2/network/admin
appsweb.cfg $OA_HTML/bin $INST_TOP/ora/10.1.2/forms/server
tnsnames.ora (Apache) $IAS_ORACLE_HOME/network/admin/<CONTEXT> $INST_TOP/ora/10.1.3/network/admin
jsev.properties $IAS_ORACLE_HOME/Apache/Jserv/etc $INST_TOP/ora/10.1.3/opmn/conf/opmn.xml
httpd.conf $IAS_ORACLE_HOME/Apache/Apache/conf$ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf
apps.conf $IAS_ORACLE_HOME/Apache/Apache/conf $ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf
formservlet.ini $IAS_ORACLE_HOME/Apache/Jserv/etc $ORACLE_HOME/forms/server/default.env
topfile.txt $APPL_TOP/admin $APPL_CONFIG_HOME/admin
adovars.env $APPL_TOP/admin $APPL_CONFIG_HOME/admin
adjborg2.txt$APPL_TOP/admin$APPL_CONFIG_HOME/admin
SSL Certificates$COMMON_TOP/admin/certs$INST_TOP/certs
AD scripts logs$COMMON_TOP/admin/log/<SID_hostname> $LOG_HOME/appl/admin/log
Concurrent Request logs$APPLCSF $APPLCSF
Apache logs$IAS_ORACLE_HOME/Apache/Apache/logs$LOG_HOME/ora/10.1.3/Apache
Jserv logs$IAS_ORACLE_HOME/Apache/Jserv/logs $LOG_HOME/ora/10.1.3/j2ee
javacache.log$COMMON_TOP/rgf/<SID_hostname> $LOG_HOME/appl/rgf


Environmental variables
Variable Oracle Apps 11i Oracle Apps R12
APPL_TOP$HOME/<SID>appl $HOME/apps/apps_st/appl
COMMON_TOP $HOME/<SID>comn $HOME/apps/apps_st/comn
ORACLE_HOME (applmgr) $HOME/<SID>ora/8.0.6 $HOME/apps/tech_st/10.1.2
IAS_ORACLE_HOME $HOME/<SID>ora/iAS $HOME/apps/tech_st/10.1.3
ORACLE_HOME (oracle) $HOME/<SID>db/10.2.0 $HOME/db/tech_st/10.2.0
ORADATA $HOME/<SID>data $HOME/db/apps_st/data
JAVA_TOP, OA_JAVA $COMMON_TOP/java $COMMON_TOP/java/classes
OA_HTML $COMMON_TOP/html $COMMON_TOP/webapps/oacore/html
FND_SECURE $FND_TOP/secure/<SID> $INST_TOP/appl/fnd/12.0.0/secure
ADMIN_SCRIPTS_HOME $COMMON_TOP/admin/scripts/<SID> $INST_TOP/admin/scripts
LOG_HOME - $INST_TOP/logs
FORMS_WEB_CONFIG_FILE- $INST_TOP/ora/10.1.2/forms/server/appsweb.cfg
AF_JLIB - $COMMON_TOP/java/lib
JAVA_BASE - $COMMON_TOP/java
INST_TOP - $HOME/inst/apps/<CONTEXT>
ORA_CONFIG_HOME - $INST_TOP/ora
APPLCSF $COMMON_TOP/admin $LOG_HOME/appl/conc

Visit this link for more info about file systems in Oracle Apps.

Feb 22, 2012

Open Oracle R11i Forms on a Windows 7/8/8.1 Machines



Oracle Apps R11i Forms based on JInitiator cann't be opened directly in windows-7
with all the latest browser's installed.

All most all the browser's now stopped supporting JInitiator in latest versions.
Oracle R12 Forms no more uses JInitiator, it uses Java Plug-ins so that users
only needs to install browser plug-ins but not client software (JInitiator) like in R11i.

If you want to work with any R11i instance on windows-7 machine, you will have to perform 4 steps.
Mozilla Firefox is the right candidate because add-on's can be installed easily.

4 Steps
Step1) Downgrade mozilla Firefox to v3.5.16 and disable auto updates.
Step2) Make sure you install the same version of JInitiator that R11i instance supports.
   JInitiator version will be displayed on the pop-up when you open forms for the first time.
 
Step3) Also make sure you install the version of JRE corresponds to JInitiator version.
   For example, if instance supports JInitiator1.3.1.28, you should install JRE1.6.0_07
                        if instance supports JInitiator1.3.1.18, you should install JRE1.6.0_03
 
   Google should tell you for other JInitiator versions.
 
Step4) As a final step, you will have to replace few dll's here and there.

  (a) COPY %JRE_HOME%\bin\client\jvm.dll to %JINITIATOR_HOME%\bin\hotspot\
  (b) COPY %JINITIATOR_HOME%\bin\NP*.dll to %MOZILLA_HOME%\plugins\

Note:
  %JINITIATOR_HOME% means C:\Program Files (x86)\Oracle\JInitiator 1.3.1.28
  %JRE_HOME%        means C:\Program Files (x86)\Java\jre1.6.0_07
  %MOZILLA_HOME%    means C:\Program Files (x86)\Mozilla Firefox

* Replace the paths accordingly.

Step1 will enable JInitiator to use particular JRE so that JInitiator won't crash.
Step2 will install Mozilla plugin for the required JRE. You can check it from
Mozilla -> Tools -> Add-ons -> Plug-ins, and see for the version of JRE.

Now restart firefox (mandatory) and try opening forms.

In some cases, firefox may crash at this point. Don't lose hope, just try this extra step.

  (c) COPY %JRE_HOME%\bin\NP*.dll to %MOZILLA_HOME%\plugins\

Restart firefox (mandatory) again and try opening forms.