You are on page 1of 14

Script To List The Values Of A Profile Option At All Levels

  Doc ID:803587.1 Type:SCRIPT


  Modified Date:23-APR-2009 Status:PUBLISHED

In this Document
  Purpose
  Software Requirements/Prerequisites
  Configuring the Script
  Running the Script
  Caution
  Script
  Script Output

Applies to:
Oracle Purchasing - Version: 11.5.1 to 12.1
Information in this document applies to any platform.

Purpose
This script can be used to list any assigned values of a profile option at any level (ie, to list all the
existing assigned values for profile option MO: Operating Unit).

Software Requirements/Prerequisites
The script can be run in sqlplus in an Oracle Applications R11i or R12 environment.

Configuring the Script


Profile option short name or profile option user name or both must be specified.

Running the Script


See below.

Caution
This script is provided for educational purposes only and not supported by Oracle Support
Services. It has been tested internally, however, and works as documented. We do not guarantee
that it will work for you, so be sure to test it in your environment before relying on it.
Proofread this script before using it! Due to the differences in the way text editors, e-mail
packages and operating systems handle text formatting (spaces, tabs and carriage returns), this
script may not be in an executable state when you first receive it. Check over the script to ensure
that errors of this type are corrected.

Script
SELECT fpo.profile_option_id, fpot.profile_option_name profile_short_name
, substr(fpot.user_profile_option_name,1,60) profile_name
, DECODE(fpov.level_id,10001,'site',10002,'Appl',10003,'Resp',10004,'User') profile_level
, substr(DECODE(fpov.level_id,10001,null, 10002,fa.application_short_name
,10003,fr.responsibility_name, 10004,fu.user_name),1,30) level_value
, fpov.profile_option_value profile_value
FROM fnd_profile_option_values fpov
, fnd_profile_options fpo
, fnd_profile_options_tl fpot
, fnd_application fa
, fnd_responsibility_tl fr
, fnd_user fu
WHERE (fpo.profile_option_name like nvl('X',fpo.profile_option_name) -- Replace X with the
profile short name, ie 'ORG_ID'
or fpot.user_profile_option_name like nvl('Y',fpot.user_profile_option_name)) -- Replace Y with
profile user name, ie 'MO: Op%'
and fpo.profile_option_name=fpot.profile_option_name
and fpo.profile_option_id = fpov.profile_option_id
and fa.application_id(+)=fpov.level_value
and fr.responsibility_id(+)=fpov.level_value
and fu.user_id(+)=fpov.level_value;

Script Output
Example:

SELECT fpo.profile_option_id, fpot.profile_option_name profile_short_name


, substr(fpot.user_profile_option_name,1,60) profile_name
, DECODE(fpov.level_id,10001,'site',10002,'Appl',10003,'Resp',10004,'User') profile_level
, substr(DECODE(fpov.level_id,10001,null, 10002,fa.application_short_name
,10003,fr.responsibility_name, 10004,fu.user_name),1,30) level_value
, fpov.profile_option_value profile_value
FROM fnd_profile_option_values fpov
, fnd_profile_options fpo
, fnd_profile_options_tl fpot
, fnd_application fa
, fnd_responsibility_tl fr
, fnd_user fu
WHERE (fpo.profile_option_name like nvl('X',fpo.profile_option_name) -- Not mandatory.
Replace X with profile short name, ie 'ORG_ID'
or fpot.user_profile_option_name like nvl('MO: Op%',fpot.user_profile_option_name)) -- Not
mandatory. Replace Y with profile user name, ie 'MO: Op%'
and fpo.profile_option_name=fpot.profile_option_name
and fpo.profile_option_id = fpov.profile_option_id
and fa.application_id(+)=fpov.level_value
and fr.responsibility_id(+)=fpov.level_value
and fu.user_id(+)=fpov.level_value;

PROFILE   PROFILE   PROFILE                   PROFILE       LEVEL                     PROFILE


OPTION   SHORT       NAME                       LEVEL           VALUE                    VALUE
ID              NAME
----------   ----------    ---------------------   -----------     ----------------------  ------------
1991          ORG_ID     MO: Operating Unit    Resp              Payables Manager       204
1991          ORG_ID     MO: Operating Unit    Resp              Oracle Inventory         204
1991          ORG_ID     MO: Operating Unit    Resp              Receivables Manager  204

Keywords
FND_PROFILE_OPTION_VALUES ; 

Help us improve our service. Please email us your comments for this document. .
Subject:What profile options are relevant when setting up OA
Framework Personalizations?
  Doc ID:787400.1 Type:HOWTO
  Modified Date:06-APR-2009 Status:PUBLISHED

In this Document
  Goal
  Solution

Applies to:
Oracle Field Service - Version: 12.0.4
Information in this document applies to any platform.

Goal
What profile options are relevant when setting up personalization in OA Framework?

Solution
1. Set FND: Personalization Region Link Enabled
(FND_PERSONALIZATION_REGION_LINK_ENABLED) to Yes

Now Personalize Region links should appear above each region in a page. Each link takes the
user first to the Choose Personalization Context page, then to the Page Hierarchy Personalization
page with focus on the region from which you selected the Personalize Region link.

2. Personalize Self-service Defn (FND_CUSTOM_OA_DEFINTION)

You should set this profile option to Yes at the user level for an administrator. If you set this
profile option to Yes, then when you log on as the Administrator, a global Personalize Page
button appears on each OA Framework-based application page. When you select the global
Personalize Page button on any page, the personalization user interface prompts you for the
scope and administrative level at which you wish to create your personalizations before
displaying the OA Personalization Framework UI.

3. Disable Self-service Personal (FND_DISABLE_OA_CUSTOMIZATIONS)


This is a system profile option specifically created for use by Oracle Support. You can set this
profile option to Yes at the site or application level. If this system profile option is set to Yes,
any personalizations you make, regardless of the level at which you make the personalizations,
will not be applied. Only the original base definition of each OA Framework-based application
page is ever displayed. Use this profile option to help Oracle support staff determine whether a
problem arises from applied personalizations or from the base application. The default is No.

Keywords
FND_PERSONALIZATION_REGION_LINK_ENABLED ; FND_CUSTOM_OA_DEFINTIO
N ; OA~FRAMEWORK ; PERSONALIZE~REGION ; FND_DISABLE_OA_CUSTOMIZATI
ONS ; SYSTEM~PROFILE~OPTIONS ; 

Help us improve our service. Please email us your comments for this document. .
Subject:How to Change Profile Option Value Without Forms?
  Doc ID:943710.1 Type:HOWTO
  Modified Date:24-SEP-2009 Status:MODERATED

In this Document
  Goal
  Solution

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not
been subject to an independent technical review.

Applies to:
Oracle Application Object Library - Version: 11.5.10
Information in this document applies to any platform.

Goal
How to update a Profile Option using SQL (if Forms login is not possible)?

Solution
Please use the API:  FND_PROFILE
The package FND_PROFILE  can be found in file AFPFPROS.pls

FND_PROFILE.SAVE - sets the value of a profile option permanently to the database,


at any level. This routine can be used at runtime or during patching.
This routine will not actually commit the changes; the caller must commit.
('SITE', 'APPL', 'RESP', or 'USER').
Examples of use:
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'SITE');
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'APPL', 321532);
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'RESP', 321532, 345234);
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'USER', 123321);

returns: TRUE if successful, FALSE if failure.

To update a Profile Option value at Site level, you need to run the SQL Script below:
Declare
value Boolean;
Begin
value := fnd_profile.save('APPS_DATABASE_ID','<new_value>','SITE');
End;

Keywords
CONFIGURATION ; AFPFPROS.PLS ; SITE~LEVEL ; API ; RUNTIME ; PROFILE~OPTIO
N~VALUE ; FND_PROFILE ; 

Help us improve our service. Please email us your comments for this document. .
Subject:How to Search all of the Profile Options for a Specific Value
  Doc ID:282382.1 Type:HOWTO
  Modified Date:20-MAR-2009 Status:PUBLISHED

In this Document
  Goal
  Solution

Applies to:
Oracle Application Object Library - Version: 11.5.0 to 11.5.10.2
Oracle Application Object Library - Version: 12.0 to 12.06
Information in this document applies to any platform.

Goal
Sometimes it is easier to search for profile options by the value they are set to, rather then the
actual profile name or shortname (helps find misconfigurations). You can use the following sql
script logged in as the apps user to query the profile option values

Solution
select p.profile_option_name SHORT_NAME, n.user_profile_option_name NAME,
decode(v.level_id, 10001, 'Site', 10002, 'Application', 10003,
'Responsibility', 10004, 'User', 10005, 'Server', 'UnDef') LEVEL_SET,
decode(to_char(v.level_id), '10001', '', '10002', app.application_short_name,
'10003', rsp.responsibility_key, '10005', svr.node_name, '10006', org.name,
'10004', usr.user_name, 'UnDef') "CONTEXT", v.profile_option_value VALUE
from fnd_profile_options p, fnd_profile_option_values v,
fnd_profile_options_tl n, fnd_user usr, fnd_application app,
fnd_responsibility rsp, fnd_nodes svr, hr_operating_units org where
p.profile_option_id = v.profile_option_id (+) and p.profile_option_name =
n.profile_option_name and usr.user_id (+) = v.level_value and
rsp.application_id (+) = v.level_value_application_id and
rsp.responsibility_id (+) = v.level_value and app.application_id (+) =
v.level_value and svr.node_id (+) = v.level_value and org.organization_id (+)
= v.level_value and v.PROFILE_OPTION_VALUE like '%[INSERT YOUR PROFILE VALUE
HERE]%'
order by short_name, level_set;

Keywords
PROFILE~VALUES ; PROFILE~OPTION~VALUE ; FND_APPLICATION ; FND_USER ; F
ND_PROFILE_OPTIONS ; FND_PROFILE_OPTION_VALUES ; FND_PROFILE_OPTIONS
_TL ; FND_RESPONSIBILITY ; FND_USER ; 

Help us improve our service. Please email us your comments for this document. .
Subject:Using profile option 'Initialization SQL Statement - Custom'
  Doc ID:135389.1 Type:BULLETIN
  Modified Date:15-SEP-2009 Status:PUBLISHED
Checked for relevance on 15-APR-2009

PURPOSE
-------

To document how the 'Initialization SQL Statement - Custom' profile option


can be used.

SCOPE & APPLICATION


-------------------

Technical persons who are trying to solve an issue where manipulating


some database session level parameter can help to gather more information.

'Initialization SQL Statement - Custom' (FND_INIT_SQL) profile option


---------------------------------------------------------------------

Using the profile option 'Initialization SQL Statement - Custom',


you can add site-specific initialization code, such as optimizer settings.
This profile value must be a valid SQL statement, or a PL/SQL block
for more than one statement, that is to be executed once at the startup
of every database session.

The code is executed by FND_GLOBAL.INITIALIZE and APPS_INITIALIZE immediately


after initializing global variables, profiles, and the contents of client_info
on session startup.

The order of execution is:

FND_GLOBAL values initialized


Profiles initialized
CLIENT_INFO contents initialized
FND_APPS_INIT_SQL initialization code called (if a value is defined)
FND_INIT_SQL initialization code called (if a value is defined)

This means that in most cases (eg. tracing a form) the profile option setting
will be effective after signing-on again.

You can set this profile option at different levels like user/responsibility/
/application or site.

You can specify any valid SQL statement or a PL/SQL block for this profile
value, but the best way is using the fnd_sess_ctl procedure of fnd_ctl package.

The value of this profile option can be set using fnd_sess_ctl as follows:
BEGIN
FND_CTL.FND_SESS_CTL(<param1>,<param2>,<param3>,<param4>,<param5>,<param6>);
END;

The different parameters are (all within single quotes) :


<param1> -> This sets the Optimizer_mode for online users. The valid values
are RULE/CHOOSE/FIRST_ROWS/ALL_ROWS.
It is recommended for CBO you set it to FIRST_ROWS.
<param2> -> This sets the Optimizer_mode for conc. jobs. The valid values
are RULE/CHOOSE/FIRST_ROWS/ALL_ROWS .
It is recommeneded for CBO you set it to ALL_ROWS.
<param3> -> This sets the trace option to true or false. Valid values
are TRUE/FALSE. If set to true then you will be able to
generate the trace files for the session.
<param4> -> This sets the times_statistics for tracing to true or false.
Valid values are TRUE/FALSE.
<param5> -> Reserved for logging. Logs session information in FND_TRACE_LOG.
Recommended value is '', other possible value is LOG.
<param6> -> This can be set for different events. An example could be to set
an event point in order to get the values of the bind values in
the trace file. In that case the example setting is as follows.
'ALTER SESSION SET EVENTS =
'||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 4 '||'''' .

Please make sure you have all the quotes correct.

Examples:
---------

1) To enable SQL trace for the session, you should set the profile option
as follows:

BEGIN FND_CTL.FND_SESS_CTL('','','TRUE','TRUE','',''); END;

Result of the above setting will be the execution of the following two
alter session commands at database session startup:

ALTER SESSION SET SQL_TRACE = 'TRUE'


ALTER SESSION SET TIMED_STATISTICS = 'TRUE'

2) To put an event statement for getting bind variables in the trace file
set the profile option as follows

BEGIN FND_CTL.FND_SESS_CTL('','','','','','ALTER SESSION SET EVENTS


='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12 '||''''); END;

3) To set the logging on,


set the profile options (Initialization SQL statement - custom) as follows:

BEGIN FND_CTL.FND_SESS_CTL('','','','','LOG',''); END;


For this option the log table is FND_TRACE_LOG, This table should be purged
periodically.

If this LOG mode is set then then following information will be inserted in
FND_TRACE_LOG table (every time when fnd_global.initialize procedure is called):

user_name,
sysdate,
conc_request_id,
oltp_opt_mode, (optimizer mode for online transactions)
conc_opt_mode, (optimizer mode for concurrent programs)
conc_program_name,
user_conc_program_name,
resp_name,
application_short_name

WARNINGS
--------

1) Do not ever set profile option 'Initialization SQL Statement - Oracle'


instead of 'Initialization SQL Statement - Custom'.

'Initialization SQL Statement - Oracle' (FND_APPS_INIT_SQL) profile option is


used by Oracle Applications to add application-specific initialization code.
This profile option is set at the application level only, and will only be
executed for responsibilities owned by that application. This profile option
and its value settings are delivered as seed data, and must not be modified.

2) Setting of profile option 'Initialization SQL Statement - Custom' can effect


on the operation of the whole Applications. As far as possible set this profile
option only on USER level.

Syntax error can cause that users can not login to the Applications or cannot
run any concurrent programs. Please make sure syntax is correct.

If you set this profile option on site level and a syntax error is in the
profile value then it would cause that nobody can login to the Applications.

In this situation the error message is something similar:

ORA-20001: Oracle error -20001: ORA-20001: -: While executing SQL


in profile FND_INIT_SQL:BEGIN FND_CTL.FND_SESS_CTL('RUL','','','','LOG','')
has been detected in FND_GLOBAL.INITIALIZE.

If you cannot login to Applications with any apps user then you can correct
this in SQL*Plus by selecting and updating the profile_option_value:

SELECT val.level_id, val.level_value, val.profile_option_id,


val.profile_option_value
FROM fnd_profile_options opt, fnd_profile_option_values val
WHERE opt.profile_option_name = 'FND_INIT_SQL' AND
opt.profile_option_id = val.profile_option_id;

You can correct the syntax error or can set profile_option_value


to NULL and then define it in the Applications again (preferred way):

UPDATE fnd_profile_option_values
SET profile_option_value = NULL
WHERE profile_option_id = <profile_option_id> AND
level_id = <level_id> AND
level_value = <level_value>;

RELATED DOCUMENTS
-----------------

Oracle Applications System Administrator's Guide Rel 11i (Appendix A-27)

You might also like