The following queries are useful to get the profile option values of a profile option at site, application, responsibility and user level

1) Obtain Profile Option values for Profile Option name like ‘%Ledger%’ and  Responsibility name like ‘%General%Ledger%’
SELECT
substr(pro1.user_profile_option_name,1,35) Profile,
decode(pov.level_id,
10001,’Site’,
10002,’Application’,
10003,’Resp’,
10004,’User’) Option_Level,
decode(pov.level_id,
10001,’Site’,
10002,appl.application_short_name,
10003,resp.responsibility_name,
10004,u.user_name) Level_Value,
nvl(pov.profile_option_value,’Is Null’) Profile_option_Value
FROM 
fnd_profile_option_values pov,
fnd_responsibility_tl resp,
fnd_application appl,
fnd_user u,
fnd_profile_options pro,
fnd_profile_options_tl pro1
WHERE
pro1.user_profile_option_name like (‘%Ledger%’)
and  pro.profile_option_name = pro1.profile_option_name
and  pro.profile_option_id = pov.profile_option_id
and  resp.responsibility_name like ‘%General%Ledger%’ /* comment this line  if you need to check profiles for all responsibilities */
and  pov.level_value = resp.responsibility_id (+)
and  pov.level_value = appl.application_id (+)
and  pov.level_value = u.user_id (+)
order by 1,2;
2) Obtain all Profile Option values setup for a particular responsibility. Replace the responsibility name as per your requirement.
SELECT
substr(pro1.user_profile_option_name,1,35) Profile,
decode(pov.level_id,
10001,’Site’,
10002,’Application’,
10003,’Resp’,
10004,’User’) Option_Level,
decode(pov.level_id,
10001,’Site’,
10002,appl.application_short_name,
10003,resp.responsibility_name,
10004,u.user_name) Level_Value,
nvl(pov.profile_option_value,’Is Null’) Profile_option_Value
FROM 
fnd_profile_option_values pov,
fnd_responsibility_tl resp,
fnd_application appl,
fnd_user u,
fnd_profile_options pro,
fnd_profile_options_tl pro1
WHERE
pro.profile_option_name = pro1.profile_option_name
and  pro.profile_option_id = pov.profile_option_id
and  resp.responsibility_name like ‘%General%Ledger%’
and  pov.level_value = resp.responsibility_id (+)
and  pov.level_value = appl.application_id (+)
and  pov.level_value = u.user_id (+)
order by 1,2;

Similarly, you can tweak the above queries to obtain Profile Option Values set for a particular User or a particular application.

This is one of the good reference documents from metalink.

WHAT TO SET UP BEFORE GENERATING THE TRACE

These steps must be performed by the DBA on the database server.

1. Set TIMED_STATISTICS to TRUE.
   For performance issues, make sure TIMED_STATISTICS is turned on, before attempting to generate the trace.

   Set the following in the init.ora file:
      TIMED_STATISTICS=TRUE
      OR
      in SQL*Plus: ALTER SYSTEM SET TIMED_STATISTICS=TRUE;

2. Set the location of the trace output.
   Set the following in the init.ora file: USER_DUMP_DEST =

3. Create the PLAN_TABLE to hold the output of the explain plan. Run the SQL script called UTLXPLAN.SQL to create this in the apps schema. This script is usually in $ORACLE_HOME/rdbms/admin.

4. If the init.ora file has been updated, you must shut down and restart the database before the changes will take effect.
   TYPES OF TRACE – HOW TO TURN TRACE ON
   Regardless of the type of trace file you create, make sure you note the time that you create it.

1] Form Trace

Toggle trace on/off on the form, to trace specific application functions. Make sure you go in fresh (sign off/on to the application), since somequeries are cached and may not be executed on subsequent visits to theform.

From the menu, select Help–>Diagnostics–>Trace to turn trace on (when checked, it is on).
   Perform the action to be traced.
   From the menu, turn trace off, by selecting Help–>Diagnostics–>Trace (it should now be unchecked).

2] Concurrent Program Trace
   A. This will turn trace on for each execution of this program. In Release 11.0 and lli, check the Enable Trace checkbox for the concurrent program on the Concurrent Programs form. After running the program to be traced, make sure you uncheck the Enable Trace checkbox.
   Select the System Administrator responsibility.
   Navigation = Concurrent -> Programs -> Define. Query the concurrent program you want to trace. Check the Enable Trace checkbox and save.
   OR
   B. How to generate a raw trace file with binds and/or waits for 11.5.10:
1. Log into applications as System Administrator and Navigate to the System Profile Values Form. Select the profile called Concurrent: Allow Debugging and change the value to Yes at the appropriate level.
2. Allow pop-ups on your browser.
3. Navigate to the Submit a New Request form and select a job and enter all parameters for that job
4. Select the Debug Options Button and this will take you to Create Debug Rule in Oracle Application Manager
5. Select the appropriate Debug Option Value for SQL Trace only and then check the box
6. Hit OK twice and then Submit the job
7. Raw trace file with options selected will be located in the appropriate directory.

3] Database Level Trace
   This will turn trace on for all processes that are running in the instance and should only have to be used in Release 10.7, for concurrent programs. (This has to be done by the DBA.)
   Set the following in the init.ora file:SQL_TRACE=TRUE
   Shut down and restart the database.After generating the trace file, shut down and restart the database with the original init.ora.

4] Report Trace
If you are on 10.7 and need to trace an Oracle Report, you can modify the report to turn trace on for that session.
   a. Convert the report from rdf to rex: $ORACLE_HOME/bin/r25convm batch=yes userid=> stype=rdffile source=REPORT_NAME.rdf dtype=rexfile overwrite=yes
   b. Edit the rexfile and search for the beforerep trigger in the report.
      Locate the following code:
         IF (:p_trace_switch = ‘Y’) THEN
            SRW.DO_SQL(‘alter session set sql_trace TRUE’);
         END IF;
      Comment out the IF and END IF lines.
   c. Save the report.
   d. Convert the report from rex to rdf: $ORACLE_HOME/bin/r25convm batch=yes userid= > stype=rexfile source=REPORT_NAME.rex dtype=rdffile overwrite=yes

5] Self Service page (like a Forms trace, but for self service web apps)
   a. Set the FND:Diagnostics profile: Responsibility = System Administrator
      Navigation: Profile > System User: Enter User name
      Query the Profile: ‘FND:Diagnostics’
      Set the ‘FND:Diagnostics’ profile to Yes at User level

   b. Login to Self Service under the same user the profile was set for.
   c. Turn Trace on: Click the Diagnostic link at the top of the page.
      It shows two options: Show Log and Set Trace Level
      Select ‘Set Trace Level’
      Click Go.
      Select one of the following options:
      Disable Trace – used to end the trace
         Trace (Regular) – just like a forms trace
         Trace with Binds – record the bind variables in the trace
         Trace with waits – Good for performance issues
         Trace with binds and waits – combines both of the above
      Click Save.
    
   d. Perform the action to be traced in Self Service.
      Multiple trace files may be generated in the usual trace directory.
   e. Turn trace off: Select the Diagnostic link
      Click on option: Set Trace Level
      Note all of the trace numbers listed
      Click Go
      Select: Disable Trace
      Click Save

WHAT TO DO AFTER GENERATING THE TRACE FILE

These steps should be performed by the DBA, on the database server.

1. Find the trace directory. Get the location of user_dump_dest. Log into SQL*Plus as the apps user.
   select value from V$PARAMETER where name = ‘user_dump_dest’
2. Find the trace file for your process.Go to the directory you found in step 1 (in UNIX, use cd). Look for a file (.trc) that was created at the time you started your process (in UNIX, use ls -ltr).
3. Run tkprof with explain plan. Go to a directory in which you have write privilege (in UNIX, use cd).

Run tkprof:
tkprof explain=

HOW TO GET AN EXPLAIN PLAN FOR A SQL STATEMENT

Sometimes you may have a need to get an explain plan for a specific SQL statement. If you have the sql statement, you can get the explain plan for it.
This should be run on the same instance that the sql statement came from.
In your apps account —
Run the following script:
delete from plan_table
where statement_id = ‘tmp’

explain plan

set statement_id = ‘tmp’
for

/
set pages 100
col operation format a36
col options format a11
col object_name format a30

select lpad(‘ ‘,2*(level-1))operation operation,

options, object_name
from plan_table
where statement_id = ‘tmp’
connect by prior id = parent_id
and statement_id = ‘tmp’
start with id = 1
and statement_id = ‘tmp’
order by id
/
delete from plan_table
where statement_id = ‘tmp’
/
commit;

FNDLOAD is a concurrent program that can move Oracle Applications data between database and text file. FNDLOAD can download data from an application entity into an editable text file, which can be uploaded to another database. Conversion between database format and text file format is specified by a configuration file. But i could not find anything regarding upload/download of an Oracle Alert. So, my conclusion was that i must be possible to use FNDLOAD to transfer Alerts, but that there is no configuration file provided by Oracle. I had to create a configuration file myself.

We use ldt loader data files for loading.
Oracle currently supports the migration of the following types of data using FNDLOAD
Printers / Print queues / Executables Printers / Print queues / Executables. Roles / Responsibilities / Forms Roles / Responsibilities / Forms. Menus / Users / Request Sets Menus / Users / Request Sets. Request Groups / Request Queues Request Groups / Request Queues. Work shifts / Programs / Libraries Work shifts / Programs / Libraries. Attachments / Help Files Attachments / Help Files. Mime Types Mime Types. Security Information.

What is 0 & Y in FNDCPASS, FNDLOAD or WFLOAD?


0 & Y are flags for FND Executable like FNDCPASS & FNDLOAD where
   0 is request id (request ID 0 is assigned to request ID’s which are not submitted via Submit Concurrent Request Form.
   ‘Y’ indicates the method of invocation. i.e. it is directly invoked from the command-line not from the Submit Request Form.
Create Temporary Table in Oracle

To create a table named test with column col1 type varchar2 length 10, col2 type number. col3 type clob we can use CREATE TABLE statement as,
CREATE TABLE TEST(col1 VARCHAR2(10), col2 NUMBER, col3 CLOB);
Now if I insert data into the table the data is visible and accessible to all users. In many cases it is needed the data inside a table will be reside temporarily. In that case we can use temporary tables. Temporary tables are useful in applications where a result set is to be buffered. To create temporary table we have to issue CREATE GLOBAL TEMPORARY clause.
Temporary table can be of two types based on ON COMMIT clause settings.
1)ON COMMIT DELETE ROWS specifies temporary table would be transaction specific. Data persist within table up to transaction ending time. If you end the transaction the database truncates the table (delete all rows). Suppose if you issue commit or run ddl then data inside the temporary table will be lost. It is by default option.
Example:
(i)This statement creates a temporary table that is transaction specific:
CREATE GLOBAL TEMPORARY TABLE test_temp(col1 number, col2 number) ON COMMIT DELETE ROWS;
Table created.
(ii)Insert row in to the temporary table.
insert into test_temp values(3,7);
1 row created.
(iii)Look at the data in the table.
select * from test_temp;
COL1 COL2
———- ———-
3 7
(iv)Issue Commit.
commit;
Commit complete.
(v)Now look at the data in the temporary table. As I created transaction specific temporary table(on commit delete rows) so data is lost after commit.
SQL> select * from test_temp;
no rows selected
2)ON COMMIT PRESERVE ROWS specifies temporary table would be session specific. Data persist within table up to session ending time. If you end the session the database truncates the table (delete all rows). Suppose you type exit in SQL*Plus then data inside the temporary table will be lost.
Example of Session Specific Temporary Tables:
1)Create Session Specific Temporary Table test_temp2.
CREATE GLOBAL TEMPORARY TABLE test_temp2 (col1 number, col2 number)
ON COMMIT PRESERVE ROWS;
(ii)Insert data into it and look at data both before commit and after commit.
insert into test_temp2 values(3,7);
1 row created.
SQL>select * from test_temp2;
COL1 COL2
———- ———-
3 7
(iii) commit;
Commit Complete
(iv)select * from test_temp2;
COL1 COL2
———- ———-
3 7

(iv)End the Session.
exit;


Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, OLAP and Data Mining options
(v)Connect in a new session and look at data again.
$ sqlplus apps/[email protected]
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, OLAP and Data Mining options

SQL> select * from test_temp2;
no rows selected

This is how Global Temporary Tables are used.
Feature of Temporary Table
1.Indexes can be created on temporary tables. They are also temporary and the data in the index has the same session or transaction scope as the data in the underlying table.
2.Unlike permanent tables, temporary tables and their indexes do not automatically allocate a segment when they are created. Instead, segments are allocated when the first INSERT (or CREATE TABLE AS SELECT) is performed. This means that if a SELECT, UPDATE, or DELETE is performed before the first INSERT, the table appears to be empty.
3.DDL operations (except TRUNCATE) are allowed on an existing temporary table only if no session is currently bound to that temporary table.
4.If you rollback a transaction, the data you entered is lost, although the table definition persists.
5.A transaction-specific temporary table allows only one transaction at a time. If there are several autonomous transactions in a single transaction scope, each autonomous transaction can use the table only as soon as the previous one commits.
6.Because the data in a temporary table is, by definition, temporary, backup and recovery of temporary table data is not available in the event of a system failure.
7.It is good to know about that temporary table itself is not temporary, the data within it is temporary.
Restriction of Temporary Table
1.Temporary tables cannot be partitioned, clustered, or index organized.
2.You cannot specify any foreign key constraints on temporary tables.
3.Temporary tables cannot contain columns of nested table.
4.You cannot specify the following clauses of the LOB_storage_clause: TABLESPACE, storage_clause, or logging_clause.
5.Parallel DML and parallel queries are not supported for temporary tables. Parallel hints are ignored. Specification of the parallel_clause returns an error.
6.You cannot specify the segment_attributes_clause, nested_table_col_properties, or parallel_clause.
7.Distributed transactions are not supported for temporary tables.

About Hierarchical Trees
The hierarchical tree displays data in the form of a standard navigator.
We can populate a hierarchical tree with values contained in a Record Group or Query Text.
At runtime, you can programmatically add, remove, modify, or evaluate elements in a hierarchical tree.
The amount of data displayed at any one time depends upon the expansion of individual data nodes.
Triggers
Following Triggers are Provided by Form Builder exclusively for hierarchical tree Items.
1.       When-Tree-Node-Activated
2.       When-Tree-Node-Expanded
3.       When-Tree-Node-Selected
Built-ins
Following built-in subprograms are used to add, remove, modify, or evaluate elements in a hierarchical tree Items.
All built-ins are located in the FTREE built-in package.
1.       Add_Tree_Data
2.       Add_Tree_Node
3.       Delete_Tree_Node
4.       Find_Tree_Node
5.       Get_Tree_Node_Parent
6.       Get_Tree_Selection
7.       Populate_Group_From_Tree
8.       Populate_Tree
9.       Set_Tree_Selection
Now, we will see, how to Develop a form Using Hierarchical Tree Item for Oracle Application.
Objectives :
1.       Create the Hierarchical Tree Item in a Non-Database Block.
2.       Populate the Data to the Hierarchical Tree Item Using Record Group at Runtime.
3.       Create a Database Block to Display the Data(s) based on the Element Navigating on the Hierarchical Tree Item.
Database Objects Required to Develop this Form :
 
Find the Attachment contains the Script to Create Database Objects & Sample Data’s to be Inserted.
In the Canvas Tool Palette we can I find the Hierarchical Tree.
Note : Hierarchical Tree Item Should be in a separate Block as a Individual Item.
There are 2 ways to populate a hierarchical tree :
1.       Record Group
2.       Query Text
The record Group query should be in the specified structure., which requires 5 Columns.
SELECT STATUS, LEVEL, LABEL, ICON, VALUE FROM TABLE;
STATUS à Indicates the initiate status of the Node (Normally Value is 1).
LEVEL  à This is a specific pseudo-column Derived from “CONNECT BY”.
LABEL  à This is the visible label of the Node.
ICON   à That contains the icon name of the Node (can be NULL).
VALUE  à That contains the value of the Node.
Below is the Query used in the Record Group to Populate the Data in the Hierarchical Tree Item.
SELECT 1, LEVEL, ENAME, NULL, TO_CHAR(EMPNO) APPS.EMP CONNECT BY PRIOR EMP.EMPNO = EMP.MGR;
Object Navigator :
 
 
Canvas Design :
 
 
At Run Time :

Kindly have a look on the Below Triggers :

1. WHEN-NEW-FORM-INSTANCE (Form Level)
2. WHEN-TREE-NODE-SELECTED (Item Level)

I hope this will be Useful for custom Developments.