oracle applications utility sql scripts

42
AIM TECHNICAL DESIGN Oracle Applications Utility SQL Scripts Team: Technology Creation Date: 1 July 2009 Created By: Brendan Furey ([email protected]) Last Updated: 2 July 2009 Control: document.doc Version: 1.1 Approvals:

Upload: brendan-furey

Post on 15-Nov-2014

208 views

Category:

Documents


12 download

DESCRIPTION

This document lists the code, with some design details, for various utility SQL report scripts (and one PL/SQL script) that I have written over a number of years mainly around Oracle Applications foundation schema (FND). I find them useful for support and development purposes.

TRANSCRIPT

Page 1: Oracle Applications Utility SQL Scripts

AIMTECHNICAL DESIGN

Oracle Applications Utility SQL Scripts

Team: Technology

Creation Date: 1 July 2009

Created By: Brendan Furey ([email protected])

Last Updated: 2 July 2009

Control: document.doc

Version: 1.1

Approvals:

Page 2: Oracle Applications Utility SQL Scripts

Document Control

Change Record

Date Author Version Change Reference

01-Jul-2009 BP Furey 1.0 Initial02-Jul-2009 BP Furey 1.1 Organisation

iiDocument Control

Page 3: Oracle Applications Utility SQL Scripts

Contents

Document Control..................................................................................................... ii

Change Record.................................................................................................. ii

Introduction..............................................................................................................4

Technical Overview..................................................................................................5

Structure............................................................................................................5SQL Script List...................................................................................................5

Script Header...........................................................................................................7

Time and Instance.............................................................................................7

FND Concurrent Requests.......................................................................................8

Concurrent Requests by Program code..............................................................8Concurrent Requests Hierarchy........................................................................11

FND Setup: Programs and Request Sets...............................................................13

Programs and Parameters...............................................................................13Programs and Request Groups........................................................................13Request Sets...................................................................................................14

FND Setup: Responsibilities and Menus.................................................................16

Responsibilities................................................................................................16Menus.............................................................................................................17

FND Flexfields.......................................................................................................21

Key Flexfields..................................................................................................21Descriptive Flexfields.......................................................................................21Key Flexfield Descriptions................................................................................22

Data Dictionary: Schema Summaries.....................................................................24

Tables.............................................................................................................24Tables and Columns........................................................................................25Indexes............................................................................................................26Tables with No Who Columns or No (or Id Only) Unique Indexes......................27

HR: Organizations..................................................................................................28

Inventory Organizations...................................................................................28Organizations by Class....................................................................................28

References............................................................................................................30

Appendix: Example Outputs...................................................................................31

iiiDocument Control

Page 4: Oracle Applications Utility SQL Scripts

Introduction

This document lists the code, with some design details, for various utility SQL report scripts (and one PL/SQL script) that I have written over a number of years mainly around Oracle Applications foundation schema (FND). I find them useful for support and development purposes. All scripts have been run against Oracle Applications 11.5.10 (see REF-1), and database version 10g 10.2.0.3.0.

4Technical Overview

Page 5: Oracle Applications Utility SQL Scripts

Technical Overview

Structure

The SQL statements described here are normally run from within a script file, but can also be run directly via SQL*Plus or SQL*Developer etc. I have omitted the SQL*Plus formatting and other commands. Typically a file will follow the structure:

Global formatting commands (SET PAGESIZE etc.)

Parameter statements (DEFINE)

SPOOL to file

Write start time, database instance etc. (Script Header below)

Column formatting commands (COLUMN, BREAK etc.)

SQL

Write end time

SQL Script List

Description NotesScript Header

Time and InstanceStart time, database instance etc. It is run at the start of a script to capture timing information, and to avoid doubt at a later date about where the output came from

FND Concurrent RequestsConcurrent Requests by Program code

Concurrent requests with user, responsibility, duration, etc., usually for a specified program. It includes the non-null parameter values

Concurrent Requests HierarchyConcurrent requests with user, responsibility, duration, etc., usually for a specified datetime range. Tree-walk SQL

FND Setup: Programs and Request SetsPrograms and Parameters Concurrent programs definitions with parameters and defaultsPrograms and Request Groups Concurrent programs definitions with request groups and responsibilitiesRequest Sets Request set definitions including defaults, at both program and set levelFND Setup: Responsibilities and Menus

ResponsibilitiesResponsibilities grouped by their associated profile values for set of books and operating unit, and by application

Menus

This script lists the menu structure for responsibilities matching an input prefix. There are several parameters that control the detail of the output and other features. In particular the structure can be shown corresponding to what the user sees (with window scrolling) after expanding all in the navigator screen, or can include subfunctions and technical details.

This was written initially in 1999 when the Oracle SQL tree walk functionality was much more basic than it is now and could not be used for this purpose. The PL/SQL program uses a recursive procedure call, without which the code would be much more complex, and would be limited to fixed depth menus

FND FlexfieldsKey Flexfields Key flexfield definitions with contexts, columns and value sets

5Technical Overview

Page 6: Oracle Applications Utility SQL Scripts

Descriptive Flexfields Descriptive flexfield definitions with contexts, columns and value sets

Key Flexfield Descriptions

Translates a concatenated KFF values string into the descriptions from the value sets. KFF structure is read from tables – not hard-coded. It is harder than it seems to do this in a single SQL – the SQL uses nested inline views, with analytic functions, parses the value-string dynamically, and handles parent-child relationships

Data Dictionary: Schema Summaries

The SQL statements here are normally run together for a schema and the results saved to a text file, which can then be referred to for table/column/index information. It is often quicker than opening the relevant nodes individually in a TOAD-style interface, and the outputs are ordered and organised for maximum convenienceTables Tables in a schema with summary information on columns, indexes etc

Tables and Columns

Tables and columns in a schema, ordered by table and column names (unlike the DESC command). Columns such as DFF attributes can be excluded from the list but counted at table level to minimise clutter. The SQL illustrates a number of useful techniques, including analytic functions, inline views, and row-column pivotting

Indexes Indexes in a schema, ordered by table, index and column sequenceTables with No Who Columns or No (or Id Only) Unique Indexes

Tables in a schema that have one of a number of characteristics that may indicate a design omission or problem, such as absence of Who columns

HR: Organizations

These are useful for quickly understanding the structure of a company running Oracle ApplicationsInventory Organizations Inventory organizations (warehouses)Organizations by Class Organizations by class

6Technical Overview

Page 7: Oracle Applications Utility SQL Scripts

Script Header

Time and Instance

This script writes start time, database instance etc. and is run at the start of a script to capture timing information, and to avoid doubt at a later date about where the output came from.

Output Fields

Name DescriptionDatabase Database instance nameSession Session IDOS User Operating system user nameMachine Machine IDTime Date and timeVersion Oracle version

CodeSELECT /* BP Furey, 1 July 2009 */'Start: '||dbs.name "Database", ses.sid "Session", ses.osuser "OS User", ses.machine "Machine", To_Char (SYSDATE,'DD-MON-YYYY HH24:MI:SS') "Time",

Replace (Substr(ver.banner, 1, Instr(ver.banner, '64')-4), 'Enterprise Edition Release ', '') "Version" FROM v$database dbs, v$version ver, v$session ses WHERE ver.banner LIKE 'Oracle%' AND audsid = USERENV('sessionid');

7Technical Overview

Page 8: Oracle Applications Utility SQL Scripts

FND Concurrent Requests

Concurrent Requests by Program code

This script lists concurrent requests with user, responsibility, duration, etc., usually for a specified program. It includes the non-null parameter values. If the delimiter parameter is set to Chr(10) parameters are listed on a multi-line basis.

Input Parameters

Name Descriptionconc_name Program short nameuser_name User name of request initiatorstart_date Request start dateend_date Request end dateexclude Program short name to excludedelim Parameter delimiter

Output Fields

Name DescriptionId Request id + parent request id if there is oneCP Program long nameUser User name of request initiatorStatus Phase + Status codesRequest Time Request timeStart Time Actual start timeDuration Duration in minutes to 1dpResponsibility Responsibility used to initiate requestParameters Non-null parameters separated by a delimiter

CodeSELECT /* BP Furey, 1 July 2009 */

req.request_id || CASE req.parent_request_id WHEN -1 THEN NULL ELSE '(->' || req.parent_request_id || ')' END "Id",

Substr(prg.user_concurrent_program_name, 1, 50) "CP", usr.user_name "User", req.phase_code || '/' || req.status_code "Status", To_Char(req.request_date, 'dd-mon-yy hh24:mi:ss') "Request Time", To_Char(req.actual_start_date, 'dd-mon-yy hh24:mi:ss') "Start Time", Round(24*60*(Nvl(req.actual_completion_date, SYSDATE)-req.actual_start_date), 2)

"Duration", rsp.responsibility_name "Responsibility",

CASE WHEN req.argument1 != Chr(0) THEN '1 : ' || req.argument1 || &delim END ||CASE WHEN req.argument2 != Chr(0) THEN '2 : ' || req.argument2 || &delim END ||CASE WHEN req.argument3 != Chr(0) THEN '3 : ' || req.argument3 || &delim END ||CASE WHEN req.argument4 != Chr(0) THEN '4 : ' || req.argument4 || &delim END ||CASE WHEN req.argument5 != Chr(0) THEN '5 : ' || req.argument5 || &delim END ||CASE WHEN req.argument6 != Chr(0) THEN '6 : ' || req.argument6 || &delim END ||CASE WHEN req.argument7 != Chr(0) THEN '7 : ' || req.argument7 || &delim END ||CASE WHEN req.argument8 != Chr(0) THEN '8 : ' || req.argument8 || &delim END ||CASE WHEN req.argument9 != Chr(0) THEN '9 : ' || req.argument9 || &delim END ||CASE WHEN req.argument10 != Chr(0) THEN '10: ' || req.argument10 || &delim END ||CASE WHEN req.argument11 != Chr(0) THEN '11: ' || req.argument11 || &delim END ||CASE WHEN req.argument12 != Chr(0) THEN '12: ' || req.argument12 || &delim END ||CASE WHEN req.argument13 != Chr(0) THEN '13: ' || req.argument13 || &delim END ||CASE WHEN req.argument14 != Chr(0) THEN '14: ' || req.argument14 || &delim END ||CASE WHEN req.argument15 != Chr(0) THEN '15: ' || req.argument15 || &delim END ||CASE WHEN req.argument16 != Chr(0) THEN '16: ' || req.argument16 || &delim END ||CASE WHEN req.argument17 != Chr(0) THEN '17: ' || req.argument17 || &delim END ||CASE WHEN req.argument18 != Chr(0) THEN '18: ' || req.argument18 || &delim END ||CASE WHEN req.argument19 != Chr(0) THEN '19: ' || req.argument19 || &delim END ||CASE WHEN req.argument20 != Chr(0) THEN '20: ' || req.argument20 || &delim END ||

8Technical Overview

Page 9: Oracle Applications Utility SQL Scripts

CASE WHEN req.argument21 != Chr(0) THEN '21: ' || req.argument21 || &delim END ||CASE WHEN req.argument22 != Chr(0) THEN '22: ' || req.argument22 || &delim END ||CASE WHEN req.argument23 != Chr(0) THEN '23: ' || req.argument23 || &delim END ||CASE WHEN req.argument24 != Chr(0) THEN '24: ' || req.argument24 || &delim END ||CASE WHEN req.argument25 != Chr(0) THEN '25: ' || req.argument25 || &delim END ||CASE WHEN arg.argument26 != Chr(0) THEN '26: ' || arg.argument26 || &delim END ||CASE WHEN arg.argument27 != Chr(0) THEN '27: ' || arg.argument27 || &delim END ||CASE WHEN arg.argument28 != Chr(0) THEN '28: ' || arg.argument28 || &delim END ||CASE WHEN arg.argument29 != Chr(0) THEN '29: ' || arg.argument29 || &delim END ||CASE WHEN arg.argument30 != Chr(0) THEN '30: ' || arg.argument30 || &delim END ||CASE WHEN arg.argument31 != Chr(0) THEN '31: ' || arg.argument31 || &delim END ||CASE WHEN arg.argument32 != Chr(0) THEN '32: ' || arg.argument32 || &delim END ||CASE WHEN arg.argument33 != Chr(0) THEN '33: ' || arg.argument33 || &delim END ||CASE WHEN arg.argument34 != Chr(0) THEN '34: ' || arg.argument34 || &delim END ||CASE WHEN arg.argument35 != Chr(0) THEN '35: ' || arg.argument35 || &delim END ||CASE WHEN arg.argument36 != Chr(0) THEN '36: ' || arg.argument36 || &delim END ||CASE WHEN arg.argument37 != Chr(0) THEN '37: ' || arg.argument37 || &delim END ||CASE WHEN arg.argument38 != Chr(0) THEN '38: ' || arg.argument38 || &delim END ||CASE WHEN arg.argument39 != Chr(0) THEN '39: ' || arg.argument39 || &delim END ||CASE WHEN arg.argument40 != Chr(0) THEN '40: ' || arg.argument40 || &delim END ||CASE WHEN arg.argument41 != Chr(0) THEN '41: ' || arg.argument41 || &delim END ||CASE WHEN arg.argument42 != Chr(0) THEN '42: ' || arg.argument42 || &delim END ||CASE WHEN arg.argument43 != Chr(0) THEN '43: ' || arg.argument43 || &delim END ||CASE WHEN arg.argument44 != Chr(0) THEN '44: ' || arg.argument44 || &delim END ||CASE WHEN arg.argument45 != Chr(0) THEN '45: ' || arg.argument45 || &delim END ||CASE WHEN arg.argument46 != Chr(0) THEN '46: ' || arg.argument46 || &delim END ||CASE WHEN arg.argument47 != Chr(0) THEN '47: ' || arg.argument47 || &delim END ||CASE WHEN arg.argument48 != Chr(0) THEN '48: ' || arg.argument48 || &delim END ||CASE WHEN arg.argument49 != Chr(0) THEN '49: ' || arg.argument49 || &delim END ||CASE WHEN arg.argument50 != Chr(0) THEN '50: ' || arg.argument50 || &delim END ||CASE WHEN arg.argument51 != Chr(0) THEN '51: ' || arg.argument51 || &delim END ||CASE WHEN arg.argument52 != Chr(0) THEN '52: ' || arg.argument52 || &delim END ||CASE WHEN arg.argument53 != Chr(0) THEN '53: ' || arg.argument53 || &delim END ||CASE WHEN arg.argument54 != Chr(0) THEN '54: ' || arg.argument54 || &delim END ||CASE WHEN arg.argument55 != Chr(0) THEN '55: ' || arg.argument55 || &delim END ||CASE WHEN arg.argument56 != Chr(0) THEN '56: ' || arg.argument56 || &delim END ||CASE WHEN arg.argument57 != Chr(0) THEN '57: ' || arg.argument57 || &delim END ||CASE WHEN arg.argument58 != Chr(0) THEN '58: ' || arg.argument58 || &delim END ||CASE WHEN arg.argument59 != Chr(0) THEN '59: ' || arg.argument59 || &delim END ||CASE WHEN arg.argument60 != Chr(0) THEN '60: ' || arg.argument60 || &delim END ||CASE WHEN arg.argument61 != Chr(0) THEN '61: ' || arg.argument61 || &delim END ||CASE WHEN arg.argument62 != Chr(0) THEN '62: ' || arg.argument62 || &delim END ||CASE WHEN arg.argument63 != Chr(0) THEN '63: ' || arg.argument63 || &delim END ||CASE WHEN arg.argument64 != Chr(0) THEN '64: ' || arg.argument64 || &delim END ||CASE WHEN arg.argument65 != Chr(0) THEN '65: ' || arg.argument65 || &delim END ||CASE WHEN arg.argument66 != Chr(0) THEN '66: ' || arg.argument66 || &delim END ||CASE WHEN arg.argument67 != Chr(0) THEN '67: ' || arg.argument67 || &delim END ||CASE WHEN arg.argument68 != Chr(0) THEN '68: ' || arg.argument68 || &delim END ||CASE WHEN arg.argument69 != Chr(0) THEN '69: ' || arg.argument69 || &delim END ||CASE WHEN arg.argument70 != Chr(0) THEN '70: ' || arg.argument70 || &delim END ||CASE WHEN arg.argument71 != Chr(0) THEN '71: ' || arg.argument71 || &delim END ||CASE WHEN arg.argument72 != Chr(0) THEN '72: ' || arg.argument72 || &delim END ||CASE WHEN arg.argument73 != Chr(0) THEN '73: ' || arg.argument73 || &delim END ||CASE WHEN arg.argument74 != Chr(0) THEN '74: ' || arg.argument74 || &delim END ||CASE WHEN arg.argument75 != Chr(0) THEN '75: ' || arg.argument75 || &delim END ||CASE WHEN arg.argument76 != Chr(0) THEN '76: ' || arg.argument76 || &delim END ||CASE WHEN arg.argument77 != Chr(0) THEN '77: ' || arg.argument77 || &delim END ||CASE WHEN arg.argument78 != Chr(0) THEN '78: ' || arg.argument78 || &delim END ||CASE WHEN arg.argument79 != Chr(0) THEN '79: ' || arg.argument79 || &delim END ||CASE WHEN arg.argument80 != Chr(0) THEN '80: ' || arg.argument80 || &delim END ||CASE WHEN arg.argument81 != Chr(0) THEN '81: ' || arg.argument81 || &delim END ||CASE WHEN arg.argument82 != Chr(0) THEN '82: ' || arg.argument82 || &delim END ||CASE WHEN arg.argument83 != Chr(0) THEN '83: ' || arg.argument83 || &delim END ||CASE WHEN arg.argument84 != Chr(0) THEN '84: ' || arg.argument84 || &delim END ||CASE WHEN arg.argument85 != Chr(0) THEN '85: ' || arg.argument85 || &delim END ||CASE WHEN arg.argument86 != Chr(0) THEN '86: ' || arg.argument86 || &delim END ||CASE WHEN arg.argument87 != Chr(0) THEN '87: ' || arg.argument87 || &delim END ||CASE WHEN arg.argument88 != Chr(0) THEN '88: ' || arg.argument88 || &delim END ||CASE WHEN arg.argument89 != Chr(0) THEN '89: ' || arg.argument89 || &delim END ||CASE WHEN arg.argument90 != Chr(0) THEN '90: ' || arg.argument90 || &delim END ||CASE WHEN arg.argument91 != Chr(0) THEN '91: ' || arg.argument91 || &delim END ||CASE WHEN arg.argument92 != Chr(0) THEN '92: ' || arg.argument92 || &delim END ||CASE WHEN arg.argument93 != Chr(0) THEN '93: ' || arg.argument93 || &delim END ||CASE WHEN arg.argument94 != Chr(0) THEN '94: ' || arg.argument94 || &delim END ||CASE WHEN arg.argument95 != Chr(0) THEN '95: ' || arg.argument95 || &delim END ||CASE WHEN arg.argument96 != Chr(0) THEN '96: ' || arg.argument96 || &delim END ||CASE WHEN arg.argument97 != Chr(0) THEN '97: ' || arg.argument97 || &delim END ||CASE WHEN arg.argument98 != Chr(0) THEN '98: ' || arg.argument98 || &delim END ||

9Technical Overview

Page 10: Oracle Applications Utility SQL Scripts

CASE WHEN arg.argument99 != Chr(0) THEN '99: ' || arg.argument99 END "Parameters" FROM fnd_concurrent_requests req LEFT JOIN fnd_conc_request_arguments arg ON arg.request_id (+) = req.request_id JOIN fnd_concurrent_programs_vl prg ON prg.concurrent_program_id = req.concurrent_program_id AND prg.application_id = req.program_application_id JOIN fnd_user usr ON usr.user_id = req.requested_by JOIN fnd_responsibility_vl rsp ON rsp.application_id = req.responsibility_application_id AND rsp.responsibility_id = req.responsibility_id WHERE prg.concurrent_program_name LIKE Upper(('&conc_name'||'%')) AND prg.concurrent_program_name != '&exclude' AND usr.user_name LIKE Upper(('&user_name'||'%')) AND req.request_date BETWEEN To_Date('&start_date', 'YYYY/MM/DD HH24:MI:SS') AND To_Date('&end_date', 'YYYY/MM/DD HH24:MI:SS') AND usr.user_id = req.requested_byORDER BY 1, 2, 3, 4, 5 DESC;

10Technical Overview

Page 11: Oracle Applications Utility SQL Scripts

Concurrent Requests Hierarchy

This script lists concurrent requests with user, responsibility, duration, etc., usually for a specified datetime range. It uses a tree-walk (i.e. CONNECT BY) to show any request hierarchies, including request set structures. Child requests are indented, but only up to 4 levels (as the level can be arbitrarily high)

Input Parameters

Name Descriptionconc_name Program short nameuser_name User name of request initiatorstart_date Request start dateend_date Request end dateexclude_cp1 Program short name to excludeexclude_ucp1

Program long names to excludeexclude_ucp2exclude_ucp3

Output Fields

Name DescriptionId Request idParent Id Parent request id if there is oneCP Program long nameType Request type = Program/Stage/SetUser User name of request initiatorStatus Phase + Status codesStart Time Actual start timeDuration Duration in minutes to 1dpResponsibility Responsibility used to initiate request

CodeSELECT /* BP Furey, 1 July 2009 */

CASE WHEN LEVEL < 10 THEN LPad(' ', 2*level-1) ELSE '*** ' || LEVEL || ' ***' END || req.request_id

"Id", CASE req.parent_request_id WHEN -1 THEN NULL ELSE req.parent_request_id END"Parent", CASE req.request_type WHEN 'P' THEN Substr(prg.user_concurrent_program_name, 1, 50)

ELSE Nvl(req.description, Substr(prg.user_concurrent_program_name, 1, 50)) END "CP",CASE req.request_type WHEN 'P' THEN 'Program'

WHEN 'S' THEN 'Stage' WHEN 'M' THEN 'Set'ELSE req.request_type END

"Type",usr.user_name "User",req.phase_code || '/' || req.status_code

"Status",To_Char(req.actual_start_date, 'dd-mon-yy hh24:mi:ss')"Start Time", Round(24*60*(Nvl(req.actual_completion_date, SYSDATE)-req.actual_start_date), 2)

"Duration", rsp.responsibility_name

"Responsibility" FROM fnd_concurrent_requests req JOIN fnd_concurrent_programs_vl prg ON prg.concurrent_program_id = req.concurrent_program_id AND prg.application_id = req.program_application_id JOIN fnd_user usr ON usr.user_id = req.requested_by JOIN fnd_responsibility_vl rsp ON rsp.application_id = req.responsibility_application_id

11Technical Overview

Page 12: Oracle Applications Utility SQL Scripts

AND rsp.responsibility_id = req.responsibility_id WHERE req.request_date BETWEEN To_Date('&start_date', 'YYYY/MM/DD HH24:MI:SS') AND To_Date('&end_date', 'YYYY/MM/DD HH24:MI:SS') AND prg.concurrent_program_name LIKE Upper(('&conc_name'||'%')) AND prg.concurrent_program_name NOT IN ('&exclude_cp1') AND CASE req.request_type WHEN 'P' THEN Substr(prg.user_concurrent_program_name, 1, 50) ELSE Nvl(req.description, Substr(prg.user_concurrent_program_name, 1, 50)) END

NOT IN ('&exclude_ucp1', '&exclude_ucp2', '&exclude_ucp3') AND usr.user_name LIKE Upper(('&user_name'||'%'))CONNECT BY PRIOR req.request_id = req.parent_request_id AND LEVEL < 4 START WITH req.parent_request_id = - 1ORDER SIBLINGS BY req.request_id;

12Technical Overview

Page 13: Oracle Applications Utility SQL Scripts

FND Setup: Programs and Request Sets

Programs and Parameters

This script lists concurrent programs with their parameters.

Input Parameters

Name Descriptioncp Concurrent program code

Output Fields

Name DescriptionApp Application short nameProgram Concurrent program codeExecutable Executable nameSeq Parameter sequenceParameter Parameter nameDefault Parameter defaultValue Set Parameter value set name

CodeSELECT /* BP Furey, 1 July 2009 */ app.application_short_name "App", prg.concurrent_program_name "Program", fex.execution_file_name "Executable", fcu.column_seq_num "Seq", fcu.end_user_column_name "Parameter", fcu.default_value "Default", fvs.flex_value_set_name "Value Set" FROM fnd_concurrent_programs_vl prg JOIN fnd_application app ON app.application_id = prg.application_id LEFT JOIN fnd_executables fex ON fex.executable_id = prg.executable_id AND fex.application_id = prg.executable_application_id LEFT JOIN fnd_descr_flex_column_usages fcu ON fcu.descriptive_flexfield_name = '$SRS$.'||prg.concurrent_program_name AND fcu.descriptive_flex_context_code = 'Global Data Elements' LEFT JOIN fnd_flex_value_sets fvs ON fvs.flex_value_set_id = fcu.flex_value_set_id WHERE prg.concurrent_program_name LIKE Upper('&cp'||'%') ORDER BY 1, 2, 3, 4, 5

Programs and Request Groups

This script lists concurrent programs with the request groups to which they have been assigned, and associated responsibilities. It can be useful for finding which responsibility to run a report from.

Input Parameters

Name Descriptioncp Concurrent program code

Output Fields

Name DescriptionApp Application short nameProgram Concurrent program code

13Technical Overview

Page 14: Oracle Applications Utility SQL Scripts

User Program Concurrent program name#Pars Number of parametersRequest Group Request group nameResponsibility Responsibility name

CodeSELECT /* BP Furey, 1 July 2009 */ app.application_short_name "App", prg.concurrent_program_name "Program", prg.user_concurrent_program_name "User Program", Nvl(par.n_pars, 0) "#Pars", rgs.request_group_name "Request Group", rsp.responsibility_name "Responsibility" FROM fnd_concurrent_programs_vl prg JOIN fnd_application app ON app.application_id = prg.application_id LEFT JOIN (SELECT fcu.descriptive_flexfield_name, Count(fcu.descriptive_flexfield_name) n_pars

FROM fnd_descr_flex_column_usages fcuWHERE fcu.descriptive_flex_context_code = 'Global Data Elements'GROUP BY fcu.descriptive_flexfield_name)par

ON par.descriptive_flexfield_name = '$SRS$.' || prg.concurrent_program_name LEFT JOIN (SELECT rgp.request_group_id,

rgp.request_group_name,rgu.unit_application_id application_id,rgu.request_unit_id concurrent_program_id

FROM fnd_request_groups rgp JOIN fnd_request_group_units rgu ON rgu.application_id = rgp.application_id AND rgu.request_group_id = rgp.request_group_id)

rgs ON rgs.application_id = prg.application_id AND rgs.concurrent_program_id = prg.concurrent_program_id LEFT JOIN fnd_responsibility_vl rsp ON rsp.request_group_id = rgs.request_group_id WHERE prg.concurrent_program_name LIKE Upper('&cp'||'%') ORDER BY 1, 2, 3, 4

Request Sets

This script lists request sets with their stages, programs and parameters with both program and set level defaults.

Input Parameters

Name DescriptionRequest Set Request set name

Output Fields

Name DescriptionSeq S Stage sequenceStage Stage nameSeq P Program sequenceProgram Program nameSeq A Parameter sequenceParameter Parameter nameDefault Program default Value Set Value set nameRS Default Request set default

CodeSELECT /* BP Furey, 1 July 2009 */

stg.display_sequence "Seq S",stg.user_stage_name "Stage",rsp.sequence "Seq P",

14Technical Overview

Page 15: Oracle Applications Utility SQL Scripts

fcp.user_concurrent_program_name || ': ' || fcp.concurrent_program_name "Program",fcu.column_seq_num "Seq A",

fcu.end_user_column_name "Parameter", fcu.default_value "Default", fvs.flex_value_set_name "Value Set",rsa.default_value "RS Default"

FROM fnd_request_sets_vl rst LEFT JOIN fnd_req_set_stages_form_v stg ON stg.set_application_id = rst.application_id AND stg.request_set_id = rst.request_set_id LEFT JOIN fnd_request_set_programs rsp ON rsp.set_application_id = stg.set_application_id AND rsp.request_set_id = stg.request_set_id AND rsp.request_set_stage_id = stg.request_set_stage_id LEFT JOIN fnd_concurrent_programs_vl fcp ON fcp.concurrent_program_id = rsp.concurrent_program_id AND fcp.application_id = rsp.program_application_id LEFT JOIN fnd_descr_flex_column_usages fcu ON fcu.descriptive_flexfield_name = '$SRS$.'||fcp.concurrent_program_name AND fcu.descriptive_flex_context_code = 'Global Data Elements' LEFT JOIN fnd_flex_value_sets fvs ON fvs.flex_value_set_id = fcu.flex_value_set_id LEFT JOIN fnd_request_set_program_args rsa ON rsa.application_id = rsp.set_application_id AND rsa.request_set_id = rsp.request_set_id AND rsa.request_set_program_id = rsp.request_set_program_id AND rsa.application_column_name = fcu.application_column_name WHERE rst.user_request_set_name LIKE '&rset_name%' ORDER BY 1, 3, 5;

15Technical Overview

Page 16: Oracle Applications Utility SQL Scripts

FND Setup: Responsibilities and Menus

Responsibilities

This script lists responsibilities grouped by their associated profile values for set of books and operating unit, and by application. Seeded responsibilities are excluded and it’s parametrised in the version below to run for one or all applications.

Input Parameters

Name Descriptionapp Application short name

Output Fields

Name DescriptionSOB Set of books profile valueOU Operating unit profile valueApp Application short nameHUT HR user type profile valueName Responsibility nameKey Responsibility keyUpdated Last update dateBy Last update user

CodeSELECT /* BP Furey, 1 July 2009 */

Nvl (pov_sob.profile_option_value, 'Xilinx, Def') "SOB", Nvl (hoi_r.attribute1, 'DEF') "OU",app.application_short_name "App", Nvl (pov_hut.profile_option_value, 'DEF') "HUT",rsp.responsibility_name "Name", rsp.responsibility_key "Key", To_Char (rsp.last_update_date, 'dd-Mon-yy hh24:mi:ss') "Updated", usr.user_name || ' (' || usr.description || ')' "By"

FROM fnd_responsibility_vl rsp JOIN fnd_application app ON app.application_id = rsp.application_id JOIN fnd_user usr ON usr.user_id = rsp.last_updated_by LEFT JOIN fnd_profile_options_vl pop_sob

ON pop_sob.profile_option_name = 'GL_SET_OF_BKS_NAME' LEFT JOIN fnd_profile_option_values pov_sob ON pov_sob.level_value = rsp.responsibility_id AND pov_sob.level_value_application_id = rsp.application_id AND pov_sob.level_id = 10003

AND pov_sob.profile_option_id = pop_sob.profile_option_id LEFT JOIN fnd_profile_options_vl pop

ON pop.profile_option_name = 'ORG_ID' LEFT JOIN fnd_profile_option_values pov ON pov.level_value = rsp.responsibility_id AND pov.level_value_application_id = rsp.application_id AND pov.level_id = 10003

AND pov.profile_option_id = pop.profile_option_id LEFT JOIN hr_organization_information hoi_r

ON hoi_r.org_information_context = 'Operating Unit Information' AND hoi_r.organization_ID = To_Number(pov.profile_option_value) LEFT JOIN fnd_profile_options_vl pop_hut

ON pop_hut.profile_option_name = 'HR_USER_TYPE' LEFT JOIN fnd_profile_option_values pov_hut ON pov_hut.level_value = rsp.responsibility_id AND pov_hut.level_value_application_id = rsp.application_id AND pov_hut.level_id = 10003

AND pov_hut.profile_option_id = pop_hut.profile_option_id WHERE app.application_short_name LIKE '&app' || '%' AND usr.user_name NOT IN ('AUTOINSTALL', 'INITIAL SETUP')

16Technical Overview

Page 17: Oracle Applications Utility SQL Scripts

ORDER BY 1, 2, 3

Menus

This script lists the menu structure for responsibilities matching an input prefix. There are several parameters that control the detail of the output and other features. In particular the structure can be shown corresponding to what the user sees (in segments) after expanding all in the navigator screen, or can include subfunctions and technical details.

This was written initially in 1999 when the Oracle SQL tree walk functionality was much more basic than it is now and could not be used for this purpose. This PL/SQL program uses a recursive procedure call, without which the code would be much more complex, and would be limited to fixed depth menus.

Input Parameters

Name Descriptionresp_prefix Responsibility name prefixdetails Write the menu items Y/N flagtech_flag Write the technical details such as form file names Y/N flaginclude_subfunctions Include the subfunctions that are not visible to users Y/N flag

utl_flagWrite the output to a named file rather than to standard output using UTL_File Y/N flag

Output Fields

Name DescriptionSOB Set of books profile valueOU Operating unit profile valueApp Application short nameResp Responsibility nameMenu Menu nameHR: User Type HR user type profile valueMenu Item Menu item promptTechnical Details Item type: Function/Menu name/Form nameSummary Number of items and customised forms (beginning XX)

CodeDECLARE /* BP Furey, 1 July 2009 */ c_utl_file_loc CONSTANT VARCHAR2(200) := '/usr/tmp'; c_utl_file_name CONSTANT VARCHAR2(200) := 'menus.txt'; c_prof_sob CONSTANT VARCHAR2(200) := 'GL_SET_OF_BKS_NAME'; c_prof_ou CONSTANT VARCHAR2(200) := 'ORG_ID'; c_prof_hut CONSTANT VARCHAR2(200) := 'HR_USER_TYPE';

CURSOR c_rsp IS SELECT Nvl (Nvl (pov_sob.profile_option_value, pov_sob_s.profile_option_value), '(default)') sob,

Nvl (hoi_r.attribute1, '(default)') ou,app.application_short_name app, Nvl(pov_hut.profile_option_value, '(null)') hut,rsp.menu_id, rst.responsibility_name, rsp.responsibility_id, rsp.responsibility_key, rsp.application_id, mnu.menu_name

FROM fnd_responsibility_tl rst JOIN fnd_responsibility rsp ON rsp.responsibility_id = rst.responsibility_id AND rsp.application_id = rst.application_id JOIN fnd_application app ON app.application_id = rsp.application_id JOIN fnd_menus mnu ON mnu.menu_id = rsp.menu_id LEFT JOIN fnd_profile_options_vl pop_sob

17Technical Overview

Page 18: Oracle Applications Utility SQL Scripts

ON pop_sob.profile_option_name = c_prof_sob LEFT JOIN fnd_profile_option_values pov_sob ON pov_sob.level_value = rsp.responsibility_id AND pov_sob.level_value_application_id = rsp.application_id AND pov_sob.level_id = 10003

AND pov_sob.profile_option_id = pop_sob.profile_option_id LEFT JOIN fnd_profile_option_values pov_sob_s ON pov_sob_s.level_id = 10001

AND pov_sob_s.profile_option_id = pop_sob.profile_option_id LEFT JOIN fnd_profile_options_vl pop

ON pop.profile_option_name = c_prof_ou LEFT JOIN fnd_profile_option_values pov ON pov.level_value = rsp.responsibility_id AND pov.level_value_application_id = rsp.application_id AND pov.level_id = 10003

AND pov.profile_option_id = pop.profile_option_id LEFT JOIN fnd_profile_option_values pov_s ON pov_s.level_id = 10001

AND pov_s.profile_option_id = pop.profile_option_id LEFT JOIN hr_organization_information hoi_r

ON hoi_r.org_information_context = 'Operating Unit Information' AND hoi_r.organization_id = To_Number (Nvl(pov.profile_option_value, pov_s.profile_option_value)) LEFT JOIN fnd_profile_options_vl pop_hut

ON pop_hut.profile_option_name = c_prof_hut LEFT JOIN fnd_profile_option_values pov_hut ON pov_hut.level_value = rsp.responsibility_id AND pov_hut.level_value_application_id = rsp.application_id AND pov_hut.level_id = 10003

AND pov_hut.profile_option_id = pop_hut.profile_option_id WHERE rst.responsibility_name LIKE '&resp_prefix'||'%' ORDER BY 1, 2, 3, 6;

g_file_ptr UTL_File.file_type; g_sob VARCHAR2(100) := 'NONE'; g_ou VARCHAR2(100) := 'NONE'; g_app VARCHAR2(100) := 'NONE';

g_include_subfunctions BOOLEAN := '&include_subfunctions' = 'Y'; g_level INTEGER := 0; l_menu INTEGER; n_menus INTEGER; n_menus_vi INTEGER; t_n_menus INTEGER := 0; t_n_menus_vi INTEGER := 0; n_resp INTEGER := 0; do_detail BOOLEAN := Upper('&details') = 'Y'; do_tech BOOLEAN := Upper('&tech_flag') = 'Y'; is_utl BOOLEAN := Upper('&utl_flag') = 'Y';

PROCEDURE Write_Out (p_line VARCHAR2) ISBEGIN

IF is_utl THEN UTL_File.Put_Line (g_file_ptr, p_line); ELSE DBMS_Output.Put_Line (p_line); END IF;

END Write_Out;

PROCEDURE Write_One_Level (p_menu_id NUMBER, p_responsibility_id NUMBER, p_application_id NUMBER) IS

CURSOR c_menu IS SELECT Nvl(met.prompt, '('||fun.user_function_name||')') mname, mne.entry_sequence mno, mne.sub_menu_id, app.application_short_name,

Nvl(fun.function_name, mnu.menu_name) function, frm.form_name form, mne.function_id, mne.entry_sequence, Decode( mne.sub_menu_id, NULL, Nvl(fun.type, 'NULL'), 'Menu') type FROM fnd_menu_entries mne, fnd_menu_entries_tl met,

fnd_form_functions_vl fun, fnd_application app, fnd_form frm, fnd_menus mnu WHERE mne.menu_id = p_menu_id AND met.entry_sequence = mne.entry_sequence AND mne.grant_flag = 'Y' AND met.menu_id = mne.menu_id AND fun.function_id (+) = mne.function_id AND ((Nvl(fun.type,'x') != 'SUBFUNCTION' -- SUBFUNCTION entries don't appear on menu AND met.prompt IS NOT NULL -- null prompt entries

18Technical Overview

Page 19: Oracle Applications Utility SQL Scripts

don't appear on menu ) OR '&include_subfunctions' = 'Y') AND frm.form_id (+) = fun.form_id AND app.application_id (+)= Nvl(fun.application_id,0) AND frm.application_id (+)= Nvl(fun.application_id,0) AND mnu.menu_id (+) = mne.sub_menu_id AND NOT EXISTS (

SELECT 'Exclusion' FROM fnd_resp_functions frf WHERE frf.application_id = p_application_id AND frf.responsibility_id = p_responsibility_id AND (frf.action_id = mne.sub_menu_id OR frf.action_id

= mne.function_id) ) AND (mne.function_id IS NOT NULL OR

EXISTS (SELECT 'Submenu has an item' FROM fnd_menu_entries fmes, fnd_menu_entries_tl mets, fnd_form_functions

funs WHERE fmes.menu_id = mne.sub_menu_id AND fmes.grant_flag = 'Y' AND mets.entry_sequence = fmes.entry_sequence AND mets.menu_id = fmes.menu_id AND funs.function_id (+) = fmes.function_id AND ( (Nvl(funs.type,'x') != 'SUBFUNCTION' AND mets.prompt IS NOT

NULL ) OR '&include_subfunctions' = 'Y') AND NOT EXISTS (SELECT 'Exclusion' FROM fnd_resp_functions frfs WHERE frfs.application_id = p_application_id

AND frfs.responsibility_id = p_responsibility_id AND (frfs.action_id =

fmes.sub_menu_id OR frfs.action_id = fmes.function_id) )

) ) ORDER BY 2; l_tech_bit VARCHAR2(255);

FUNCTION Is_Customized (p_application_short_name VARCHAR2) RETURN BOOLEAN IS BEGIN

RETURN p_application_short_name LIKE 'XX%';

END Is_Customized;

BEGIN

g_level := g_level + 1;

FOR r_menu IN c_menu LOOP

IF do_detail OR Is_Customized (r_menu.application_short_name) THEN

IF do_tech THEN l_tech_bit := r_menu.type||':'||r_menu.function||'/'||r_menu.form;END IF;

Write_Out (RPad(RPad(RPad ('.', 2*g_level, ' ')||r_menu.mname,60)||l_tech_bit, 115));

END IF;

n_menus := n_menus + 1; IF Is_Customized (r_menu.application_short_name) THEN

n_menus_vi := n_menus_vi + 1;

END IF;

IF r_menu.sub_menu_id IS NOT NULL THEN

Write_One_Level (r_menu.sub_menu_id, p_responsibility_id, p_application_id);

END IF;

END LOOP; g_level := g_level - 1;

END Write_One_Level;

PROCEDURE Print_Group_Header (p_label VARCHAR2, p_level PLS_INTEGER, p_text VARCHAR2, p_text_old IN OUT

19Technical Overview

Page 20: Oracle Applications Utility SQL Scripts

VARCHAR2) ISBEGIN

IF p_text != p_text_old THEN

p_text_old := p_text; Write_Out ('****'); Write_Out (RPad ('*', p_level, ' ') || p_label ||': ' || p_text);

END IF;

END Print_Group_Header;

BEGIN

IF is_utl THEN g_file_ptr := UTL_File.FOpen (c_utl_file_loc, c_utl_file_name, 'w', 6000); END IF;

FOR r_rsp IN c_rsp LOOP

Print_Group_Header ('SOB', 3, r_rsp.sob, g_sob); Print_Group_Header ('OU', 6, r_rsp.ou, g_ou); Print_Group_Header ('App', 9, r_rsp.app, g_app);

n_resp := n_resp + 1; Write_Out ('****'); Write_Out ('Resp: ' || r_rsp.responsibility_name || '/' ||r_rsp.responsibility_key || ', Menu: ' || r_rsp.menu_name || ', OU: ' || r_rsp.ou || ', HR: User Type: ' || r_rsp.hut); Write_Out ('****'); n_menus := 0; n_menus_vi := 0; Write_One_Level (r_rsp.menu_id, r_rsp.responsibility_id, r_rsp.application_id); Write_Out ('----'); Write_Out ('Menu: '||r_rsp.responsibility_name||' has '||To_Char(n_menus)||' items including '||To_Char(n_menus_vi)||' customized forms'); Write_Out ('----'); t_n_menus := t_n_menus + n_menus; t_n_menus_vi := t_n_menus_vi + n_menus_vi;

END LOOP;

Write_Out ('Total for '||To_Char(n_resp)||' responsibilities: '||To_Char(t_n_menus)||' items including '||To_Char(t_n_menus_vi)||' customized forms'); IF is_utl THEN UTL_File.FClose (g_file_ptr); END IF;

END;

20Technical Overview

Page 21: Oracle Applications Utility SQL Scripts

FND Flexfields

Key Flexfields

This script lists key flexfield definitions with contexts, columns and value sets.

Input Parameters

Name DescriptionTITLE Key flexfield title

Output Fields

Name Descriptioncontext Key flexfield contexttitle Key flexfield titleusercol User column namecolname Column namevalue_set Value set name

CodeSELECT /* BP Furey, 1 July 2009 */

str.id_flex_structure_code context,str.description title,seg.segment_name usercol,seg.application_column_name colname,fvs.flex_value_set_name value_set

FROM fnd_id_flexs flx JOIN fnd_id_flex_structures_vl str ON str.application_id = flx.application_id AND str.id_flex_code = flx.id_flex_code JOIN fnd_id_flex_segments_vl seg ON seg.application_id = str.application_id AND seg.id_flex_num = str.id_flex_num AND seg.id_flex_code = str.id_flex_code JOIN fnd_flex_value_sets fvs ON fvs.flex_value_set_id = seg.flex_value_set_id WHERE flx.description LIKE '&TITLE' || '%' ORDER BY str.id_flex_num, seg.segment_num;

Descriptive Flexfields

This script lists descriptive flexfield definitions with contexts, columns and value sets.

Input Parameters

Name DescriptionTITLE Descriptive flexfield title

Output Fields

Name Descriptioncontext Descriptive flexfield contextcolname Column nameusercol User column nameform_left_prompt Form prompt

CodeSELECT /* BP Furey, 1 July 2009 */

dfc.descriptive_flex_context_code context,

21Technical Overview

Page 22: Oracle Applications Utility SQL Scripts

fcu.application_column_name colname,fcu.end_user_column_name usercol,fcu.form_left_prompt

FROM fnd_descriptive_flexs_vl flx JOIN fnd_descr_flex_contexts_vl dfc ON dfc.application_id = flx.application_id AND dfc.descriptive_flexfield_name = flx.descriptive_flexfield_name JOIN fnd_descr_flex_col_usage_vl fcu ON fcu.application_id = dfc.application_id AND fcu.descriptive_flexfield_name = dfc.descriptive_flexfield_name AND fcu.descriptive_flex_context_code = dfc.descriptive_flex_context_code WHERE flx.title LIKE '&TITLE' || '%' ORDER BY dfc.descriptive_flex_context_code, fcu.column_seq_num;

Key Flexfield Descriptions

This script translates a concatenated KFF values string into the descriptions from the value sets. KFF structure is read from tables – not hard-coded. This is harder than it seems to do in a single SQL – the SQL uses nested inline views, with analytic functions, parses the value-string dynamically, and handles parent-child relationships.

Input Parameters

Name Descriptionaccount KFF value stringTITLE Descriptive flexfield title

Output Fields

Name Description# Segment numberSegment Segment nameValue Segment valueDescription Segment description

CodeSELECT /* BP Furey, 1 July 2009 */

ilv1.ind "#",ilv1.segment_name "Segment",ilv1.seg_value "Value",fvl.description "Description"

FROM (SELECT ilv0.ind,

ilv0.segment_name,Substr ('&account', CASE ilv0.ind

WHEN 1 THEN 1 ELSE Instr ('&account', '-', 1, ilv0.ind-1) + 1

END,CASE Instr ('&account', '-', 1, ilv0.ind)

WHEN 0 THEN Length ('&account') ELSE Instr ('&account', '-', 1, ilv0.ind) - 1

END-CASE ilv0.ind

WHEN 1 THEN 0ELSE Instr ('&account', '-', 1, ilv0.ind-1)

END) seg_value,

Min ( CASE WHEN ilv0.parent_flex_value_set_id IS NULL THENSubstr ('&account', CASE ilv0.ind

WHEN 1 THEN 1 ELSE Instr ('&account', '-', 1, ilv0.ind-1) +

1 END, CASE Instr ('&account', '-', 1, ilv0.ind)

WHEN 0 THEN Length ('&account') ELSE Instr ('&account', '-', 1, ilv0.ind) - 1

END-

22Technical Overview

Page 23: Oracle Applications Utility SQL Scripts

CASE ilv0.indWHEN 1 THEN 0ELSE Instr ('&account', '-', 1, ilv0.ind-1)

END)

END) OVER (PARTITION BY Nvl (ilv0.parent_flex_value_set_id, ilv0.flex_value_set_id))seg_value_p,

ilv0.flex_value_set_id,ilv0.parent_flex_value_set_id

FROM (SELECT seg.segment_name,

seg.flex_value_set_id,fvs.parent_flex_value_set_id,Row_Number() OVER (ORDER BY seg.segment_num) ind

FROM fnd_id_flexs flx JOIN fnd_id_flex_structures_vl str ON str.application_id = flx.application_id AND str.id_flex_code = flx.id_flex_code JOIN fnd_id_flex_segments_vl seg ON seg.application_id = str.application_id AND seg.id_flex_num = str.id_flex_num AND seg.id_flex_code = str.id_flex_code JOIN fnd_flex_value_sets fvs

ON fvs.flex_value_set_id = seg.flex_value_set_id WHERE flx.description = '&TITLE') ilv0) ilv1 JOIN fnd_flex_values_vl fvl ON fvl.flex_value_set_id = ilv1.flex_value_set_id AND fvl.flex_value = ilv1.seg_value AND (fvl.parent_flex_value_low = ilv1.seg_value_p OR

ilv1.parent_flex_value_set_id IS NULL) ORDER BY ilv1.ind;

23Technical Overview

Page 24: Oracle Applications Utility SQL Scripts

Data Dictionary: Schema Summaries

The SQL statements here are normally run together for a schema and the results saved to a text file, which can then be referred to for table/column/index information. It is often quicker than opening the relevant nodes individually in a TOAD-style interface, and the outputs are ordered and organised for maximum convenience.

Tables

This script lists tables in a schema with summary information on columns, indexes etc.

Input Parameters

Name Descriptiontab Table prefixnottab1 Table string to exclude, 1nottab2 Table string to exclude, 2owner Table owner

Output Fields

Name DescriptionTABLE_NAME Table nameWho? Yes if Who columns includedAttrs Number of excluded columnsIndexes Number of indexesCols Number of non-excluded columns

CodeSELECT /* BP Furey, 1 July 2009 */ atc.table_name, Nvl2 (atc_w.column_name, 'Yes', NULL) "Who?", CASE att.n_att WHEN 0 THEN To_Number(NULL) ELSE att.n_att END "Attrs", ind_tot.n_ind "Indexes", Count(atc.column_name) "Cols" FROM all_tab_columns atc JOIN all_tables atb ON atb.table_name = atc.table_name AND atb.owner = atc.owner -- Join index count LEFT JOIN (SELECT i.table_owner, i.table_name, Count (i.index_name) n_ind

FROM all_indexes i GROUP BY i.table_owner, i.table_name) ind_tot

ON ind_tot.table_name = atb.table_name AND ind_tot.table_owner = atb.owner -- Join attribute count LEFT JOIN (SELECT atc_att.table_name, atc_att.owner, Count(atc_att.column_name) n_att

FROM all_tab_columns atc_att WHERE atc_att.column_name LIKE '%&notcol%' GROUP BY atc_att.table_name, atc_att.owner) att

ON att.table_name = atb.table_name AND att.owner = atb.owner LEFT JOIN all_tab_columns atc_w -- Join the Who column if it exists ON atc_w.table_name = atb.table_name AND atc_w.owner = atb.owner AND atc_w.column_name = 'CREATED_BY' -- Join index with its sequence for table WHERE atc.table_name LIKE Upper('&tab'||'%') AND atc.table_name NOT LIKE '%$%' AND atb.table_name NOT LIKE '%&nottab1%' AND atb.table_name NOT LIKE '%&nottab2%' AND atb.owner LIKE Upper('&owner') GROUP BY atc.table_name, Nvl2 (atc_w.column_name, 'Yes', NULL),

CASE att.n_att WHEN 0 THEN To_Number(NULL) ELSE att.n_att END, ind_tot.n_ind ORDER BY 1;

24Technical Overview

Page 25: Oracle Applications Utility SQL Scripts

Tables and Columns

This script lists tables and columns in a schema, ordered by table and column names (unlike the DESC command). Columns such as DFF attributes can be excluded from the list but counted at table level to minimise clutter. The SQL illustrates a number of useful techniques, including analytic functions, inline views, and row-column pivotting.

Input Parameters

Name Descriptiontab Table prefixnottab1 Table string to exclude, 1nottab2 Table string to exclude, 2owner Table ownernotcol Column string to exclude (e.g ATTRIBUTE to exclude DFFs)

Output Fields

Name DescriptionTABLE_NAME Table nameWho? Yes if Who columns includedAttrs Number of excluded columnsIndexes Number of indexesCOLUMN_NAME Column nameDATA_TYPE Column data typeLength Column length

Index PosSequence of column in index i where i denotes the character position within the output field

CodeSELECT /* BP Furey, 1 July 2009 */ atc.table_name, Nvl2 (atc_w.column_name, 'Yes', NULL) "Who?", CASE att.n_att WHEN 0 THEN To_Number(NULL) ELSE att.n_att END "Attrs", ind_tot.n_ind

"Indexes", Lower (atc.column_name)|| CASE atc.nullable WHEN 'N' THEN '*' END column_name,

atc.data_type, atc.data_length"Length",

Max(CASE ind.rn WHEN 1THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 2THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 3THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 4THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 5THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 6THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 7THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 8THEN To_Char(aic.column_position) ELSE ' ' END) || Max(CASE ind.rn WHEN 9THEN To_Char(aic.column_position) ELSE ' ' END) "Index Pos" FROM all_tab_columns atc JOIN all_tables atb ON atb.table_name = atc.table_name AND atb.owner = atc.owner -- Join index count LEFT JOIN (SELECT i.table_owner, i.table_name, Count (i.index_name) n_ind FROM all_indexes i

GROUP BY i.table_owner, i.table_name) ind_tot ON ind_tot.table_name = atb.table_name AND ind_tot.table_owner = atb.owner -- Join attribute count LEFT JOIN (SELECT atc_att.table_name, atc_att.owner, Count(atc_att.column_name) n_att

FROM all_tab_columns atc_att WHERE atc_att.column_name LIKE '%&notcol%' GROUP BY atc_att.table_name, atc_att.owner) att

ON att.table_name = atb.table_name AND att.owner = atb.owner LEFT JOIN all_tab_columns atc_w -- Join the Who column if it exists ON atc_w.table_name = atb.table_name

25Technical Overview

Page 26: Oracle Applications Utility SQL Scripts

AND atc_w.owner = atb.owner AND atc_w.column_name = 'CREATED_BY' -- Join index with its sequence for table LEFT JOIN (SELECT Row_Number () OVER (PARTITION BY i.table_name, i.table_owner

ORDER BY i.table_name, i.table_owner, i.index_name) rn, i.table_name, i.table_owner, i.owner, i.index_name

FROM all_indexes i) ind ON ind.table_name = atb.table_name AND ind.table_owner = atb.owner LEFT JOIN all_ind_columns aic -- Join columns for the index ON aic.index_owner = ind.owner AND aic.index_name = ind.index_name AND aic.column_name = atc.column_name WHERE atc.column_name NOT LIKE '%&notcol%' AND atc.table_name LIKE Upper('&tab'||'%') AND atc.table_name NOT LIKE '%$%' AND atb.table_name NOT LIKE '%&nottab1%' AND atb.table_name NOT LIKE '%&nottab2%' AND atb.owner LIKE Upper('&owner') AND atc.column_name NOT IN ('CREATED_BY', 'CREATION_DATE', 'LAST_UPDATED_BY', 'LAST_UPDATE_DATE') GROUP BY atc.table_name, Nvl2 (atc_w.column_name, 'Yes', NULL), Lower (atc.column_name)||CASE atc.nullable WHEN 'N' THEN '*' END, CASE att.n_att WHEN 0 THEN To_Number(NULL) ELSE att.n_att END, ind_tot.n_ind, atc.data_type, atc.data_length ORDER BY 1, 2;

Indexes

This script lists indexes in a schema, ordered by table, index and column sequence.

Input Parameters

Name Descriptiontab Table prefixnottab1 Table string to exclude, 1nottab2 Table string to exclude, 2owner Table owner

Output Fields

Name DescriptionTABLE_NAME Table nameINDEX_NAME Index nameSeq Sequence of column in indexCOLUMN_NAME Column name

CodeSELECT /* BP Furey, 1 July 2009 */

atb.table_name, ind.index_name||CASE ind.uniqueness WHEN 'UNIQUE' THEN '*' END index_name, aic.column_position "Seq", Lower(aic.column_name) column_name

FROM all_tables atb LEFT JOIN all_indexes ind ON ind.table_name = atb.table_name AND ind.table_owner = atb.owner LEFT JOIN all_ind_columns aic ON aic.index_name = ind.index_name AND aic.index_owner = ind.owner WHERE atb.table_name LIKE Upper('&tab'||'%') AND atb.table_name NOT LIKE '%$%' AND atb.table_name NOT LIKE '%&nottab1%' AND atb.table_name NOT LIKE '%&nottab2%' AND atb.owner LIKE Upper('&owner') ORDER BY 1, 2, 3;

26Technical Overview

Page 27: Oracle Applications Utility SQL Scripts

Tables with No Who Columns or No (or Id Only) Unique Indexes

This script lists tables in a schema that have one of a number of characteristics that may indicate a design omission or problem, such as absence of Who columns..

Input Parameters

Name Descriptiontab Table prefixnottab1 Table string to exclude, 1nottab2 Table string to exclude, 2owner Table owner

Output Fields

Name DescriptionTABLE_NAME Table nameWho? X if Who columns includedNo UID? X if no unique indexId UID? X if only unique index on id columns

CodeSELECT /* BP Furey, 1 July 2009 */

atb.table_name, CASE WHEN atc_w.column_name IS NULL THEN 'X' END "Who?",

CASE WHEN uni.maxind IS NULL THEN 'X' END "No UID?", CASE WHEN uni.maxind = 1 THEN 'X' END "Id UID?" FROM all_tables atb LEFT JOIN all_tab_columns atc_w ON atc_w.table_name = atb.table_name AND atc_w.owner = atb.owner AND atc_w.column_name = 'CREATED_BY' LEFT JOIN (SELECT ind.table_name, ind.table_owner, Max(CASE WHEN Substr(aic.column_name, Length(aic.column_name)-2) IS NULL THEN 0

WHEN Substr(aic.column_name, Length(aic.column_name)-2) = '_ID' THEN 1

ELSE 2 END) maxind FROM all_indexes ind LEFT JOIN all_ind_columns aic ON aic.index_name = ind.index_name AND aic.index_owner = ind.owner AND aic.column_position = 1 WHERE ind.uniqueness = 'UNIQUE' GROUP BY ind.table_name, ind.table_owner) uni ON uni.table_name = atb.table_name AND uni.table_owner = atb.owner WHERE atb.table_name LIKE Upper('&tab'||'%') AND atb.table_name NOT LIKE '%$%' AND atb.table_name NOT LIKE '%&nottab1%' AND atb.table_name NOT LIKE '%&nottab2%' AND atb.owner LIKE Upper('&owner') AND (atc_w.column_name IS NULL OR uni.maxind IN (0, 1)) ORDER BY 1;

27Technical Overview

Page 28: Oracle Applications Utility SQL Scripts

HR: Organizations

The SQL statements here are normally run together for a schema and the results saved to a text file, which can then be referred to for table/column/index information. It is often quicker than opening the relevant nodes individually in a TOAD-style interface, and the outputs are ordered and organised for maximum convenience.

Inventory Organizations

This script lists inventory organizations.

Output Fields

Name DescriptionInv Org Organization name, with id and warehouse code appendedOwner Organization name of owning operating unit with id appended

MasterOrganization name of master inventory organization with id appended

CodeSELECT u.name || ': '|| u.organization_id || ' (' || p.organization_code || ')' "Inv Org", uh.name || ': '|| h.org_information3 "Owner",

um.name || ': '|| um.organization_id "Master" FROM hr_all_organization_units u JOIN mtl_parameters p ON p.organization_id = u.organization_id JOIN hr_all_organization_units um

ON um.organization_id = p.master_organization_id JOIN hr_organization_information h ON h.organization_id = u.organization_id AND h.org_information_context = 'Accounting Information' JOIN hr_all_organization_units uh

ON uh.organization_id = h.org_information3ORDER BY 1;

Organizations by Class

This script lists organizations by class.

Output Fields

Name DescriptionClass Organization classOrg Organization nameId Organization idCode Organization codeLE Organization name of owning legal entityAddress Organization address

CodeSELECT h.org_information1 "Class", u.name "Org", u.organization_id "Id", h_ou.attribute1 "Code", u_le.name "LE",

CASE WHEN loc.address_line_1 IS NULL THEN NULL ELSEloc.address_line_1 ||',' ||loc.address_line_2 ||',' ||loc.address_line_3 ||',' ||loc.town_or_city ||',' ||loc.postal_code ||',' ||loc.country ||' TEL: ' || loc.telephone_number_1 ||' FAX: ' ||loc.telephone_number_2 END "Address"

28Technical Overview

Page 29: Oracle Applications Utility SQL Scripts

FROM hr_all_organization_units u LEFT JOIN hr_organization_information h ON h.organization_id = u.organization_id AND h.org_information_context = 'CLASS' LEFT JOIN hr_organization_information h_ou ON h_ou.organization_id = u.organization_id AND h_ou.org_information_context = 'Operating Unit Information' LEFT JOIN hr_all_organization_units u_le

ON u_le.organization_id = To_Number(h_ou.org_information2) LEFT JOIN hr_locations_all loc ON loc.location_id = u.location_idORDER BY 1, 2;

29Technical Overview

Page 30: Oracle Applications Utility SQL Scripts

ReferencesREF Document Location

REF-1 Oracle, eTRM, R11.5.10https://etrm.oracle.com/pls/trm11510/etrm_search.search

30Technical Overview

Page 31: Oracle Applications Utility SQL Scripts

Appendix: Example OutputsTime and InstanceDatabase Session OS User Machine Time Version -------------------- -------- ---------- -------------------- -------------------- ------------------------------ Start: MINDD2 1868 bfurey XXXX\XIR-ITCON-D7 30-JUN-2009 09:03:38 Oracle Database 10g 10.2.0.3.0

Concurrent Requests by Program CodeId CP User Sta Request Time Start Time Duration Responsibility Parameters--------- ------------- --------------- --- ------------------ ------------------ -------- ---------------- -----------------------40778068 Invoice Print AUSER C/C 22-jun-09 12:37:24 22-jun-09 12:37:25 0.2 Receivables User 1 : BATCH 2 : 2008/08/02 00:00:00 5 : 376487...

Concurrent Requests HierarchyId Parent CP Type User Sta Start Time Duration Responsibility------------------------- --------- ------------------------------- ------- --------------- --- ------------------ -------- ----------------- 40886460 EDI Invoice Process Set Set AUSER C/C 26-jun-09 10:26:57 1.3 Payables User 40886462 40886460 Process Subscription Message Stage AUSER C/C 26-jun-09 10:26:58 1.2 Payables User 40886463 40886462 EDI Invoice Process Program AUSER C/C 26-jun-09 10:27:37 0.1 Payables User 40886475 40886460 Generate Error Reports Stage AUSER C/C 26-jun-09 10:28:08 0.1 Payables User 40886476 40886475 EDI Invoice Error Reports Program AUSER C/C 26-jun-09 10:28:09 0.1 Payables User...

Programs and ParametersApp Program Executable Seq Parameter Default Value Set ------ ------------------------------ ------------ ---- ------------------------- -------------------- -------------------------XXAR XXARINVPRI XXARINVPRI 1 Print Options BATCH XXAR_PRINT_CHOICE 10 Cutoff Date 2008/08/02 00:00:00 AR_SRS_DATE_LOW_STANDARD 70 Invoice Number Low XXAR_TRX_NO 75 Invoice Number High XXAR_TRX_NO 100 Batch Name XXAR_RAXINV_BATCH 110 Customer Trx Id XXAR_TRX_ID 120 Date Low AR_SRS_DATE_LOW_STANDARD 130 Date High AR_SRS_DATE_HIGH_STANDARD 140 Customer Name AR_CUSTOMER_NAME_ID 150 Debug Flag 50 chars

Programs and Request GroupsApp Program User Program #Pars Request Group Responsibility------ -------------------- ----------------------- ----- ---------------- --------------------XXAR XXARINVPRI Xilinx Invoice Print 10 Receivables All Receivables Manager Receivables User...

Request SetsSeq S Stage Seq P Program Seq A Parameter Default Value Set RS Def----- ------------------------------ ----- ----------------------------------- ----- ------------------------- -------- ------------------------------ ------ 10 XXONT Pick Release (10) 10 XXONT Pick Release: XXONTPR 10 WareHouse X01 INV_SRS_INCIPS_ORG X30 20 No of Days(CFD) 1 10/Number 30 Order Reference XXONT_PICK_RELEASE_LINEID 40 Item INV_SRS_ITEM 50 Customer name AR_CUSTOMER_NAME_ID 60 Ship Via OM: Shipping Method 70 Ship Priority (Rev / Drop XXONT Shipment Priority Code Ship)

31Technical Overview

Page 32: Oracle Applications Utility SQL Scripts

80 No of Days(ESD) 2 10/Number 20 XXWMS TASK PRIORITY PKG (20) 10 XXWMS TASK PRIORITY PKG: XXWMSTPP 10 ORGANIZATION_ID XXONTTPP_ORG_VSET 2745

ResponsibilitiesSOB OU App HUT Name Key Updated By ------------ --- ------ -------- --------------------------------- -------------------------- ------------------ --------------------------------ASOB, Def DEF ONT DEF XSJ Customer Service Discoverer XLX_CUST_SERV_DISCO 23-May-09 05:13:08 AUSER (A User) DEF XSJ OM Discoverer XLX_OM_DISCO 23-May-09 05:27:01 AUSER (A User) XAP ONT DEF XAP Order Entry Standard User XXOM_XAP_OE_STD_USER 23-May-09 00:00:00 SYSADMIN (System Administrator) DEF XAP OE Inquiry/Reports User XXOM_XAP_OE_INQ_RPTS_USER 23-May-09 00:00:00 SYSADMIN (System Administrator) DEF XAP Marketing User XXOM_XAP_MARKETING_USER 23-May-09 00:00:00 SYSADMIN (System Administrator) DEF XAP OM IT Support XXOM_XAP_IT_SUPPORT 23-May-09 00:00:00 SYSADMIN (System Administrator)...

MenusStart: MINDD2 1868 bfurey XXXX\XIR-ITCON-D7 30-JUN-2009 09:18:45 Oracle Database 10g 10.2.0.3.0 **** * SOB: A SOB **** * OU: XIR **** * App: AR **** Resp: XIR Receivables User/XXAR_XIR_RECEIVABLES_USER, Menu: XXAR_RECEIVABLES_USER, OU: XIR, HR: User Type: (null) **** . Transactions Menu:AR_TRANSACTIONS_GUI/ . Batches Menu:AR_ARXTWMAI_BATCH/ARXTWMAI . Batches Summary Menu:AR_ARXTWMAI_BATCH_SUMMARY/ARXTWMAI . Transactions Menu:AR_ARXTWMAI_HEADER/ARXTWMAI . Transactions Summary Menu:AR_ARXTWMAI_SUMMARY/ARXTWMAI . Credit Transactions Menu:AR_ARXTWMAI_CREDIT_MEMO/ARXTWMAI . Copy Transactions Menu:AR_ARXTWMAI_COPY_FORM/ARXTWMAI . Document Transfer Summary JSP:AR_DOC_TRS_SUMMARY_PG/ . Receipts Menu:AR_RECEIPTS_GUI/ . Batches Menu:AR_ARXRWMAI_BATCH/ARXRWMAI . Batches Summary Menu:AR_ARXRWMAI_BATCH_SUMMARY/ARXRWMAI . Receipts Menu:AR_ARXRWMAI_HEADER/ARXRWMAI . Receipts Summary Menu:AR_ARXRWMAI_SUMMARY/ARXRWMAI . Remittances Menu:AR_ARXRWMAI_REMITTANCES/ARXRWMAI . Remittances Summary Menu:AR_ARXRWMAI_REMIT_SUMMARY/ARXRWMAI . Clear/Risk Eliminate FORM:AR_FNDRSRUN_AUTO_CLEAR/FNDRSRUN . Lockbox Menu:AR_RECEIPTS_LBOX_GUI/ . Transmission History FORM:AR_ARXLBHIS/ARXLBHIS . Maintain Transmission Data FORM:AR_ARXLPIM/ARXLPIM . Alternate Name Matches FORM:AR_ARXCUANM/ARXCUANM . Schedule Automatic Receipts and Remittances FORM:AR_RCPT_PROC/FNDRSRUN . Alternate Name Matches FORM:AR_ARXCUANM/ARXCUANM . Collections Menu:AR_COLLECTIONS_GUI/ . Customer Calls Menu:AR_ARXCWMAI_ECC/ARXCWMAI . Customer Accounts Menu:AR_ARXCWMAI_MAI/ARXCWMAI . Account Overview Menu:AR_ARXCWMAI_SUM/ARXCWMAI . Aging Menu:AR_ARXCWMAI_AGE/ARXCWMAI . Correspondence Menu:AR_ARXCWMAI_COR/ARXCWMAI . Account Details Menu:AR_ARXCWMAI_QIT/ARXCWMAI . Transaction Overview Menu:AR_ARXCWMAI_QIL/ARXCWMAI . Scheduler Menu:AR_ARXCWMAI_SCH/ARXCWMAI . iReceivables JSP:ARI_INTERNAL_PAGE/ . Customers Menu:AR_CUSTOMERS_VIEW/ . Standard Menu:AR_ARXCUDCI_STD_VIEW/ARXCUDCI

32Technical Overview

Page 33: Oracle Applications Utility SQL Scripts

. Quick Menu:AR_ARXCUDCI_QUICK_VIEW/ARXCUDCI

. Summary Menu:AR_ARXCUDCI_GATEWAY_VIEW/ARXCUDCI

. Profile Classes FORM:AR_ARXMACPC_VIEW/ARXMACPC

. Reports Menu:AR_REPORTS_GUI/

. Accounting FORM:AR_FNDRSRUN_ACC_RPTS/FNDRSRUN

. Collections FORM:AR_FNDRSRUN_COLLECTION_RPTS/FNDRSRUN

. Listing FORM:AR_FNDRSRUN_LISTING_RPTS/FNDRSRUN

. Tax FORM:AR_FNDRSRUN_TAX_RPTS/FNDRSRUN

. Other FORM:AR_FNDRSRUN_OTHER_RPTS/FNDRSRUN

. Print Documents Menu:AR_PRINT_GUI/

. Invoices FORM:AR_FNDRSRUN_INVOICES_PRINT/FNDRSRUN

. Dunning Letters FORM:AR_FNDRSRUN_DUNNING_PRINT/FNDRSRUN

. Statements FORM:AR_ARXSUPST/ARXSUPST

. Consolidated Billing Invoices FORM:AR_FNDSRUN_CONSINV/FNDRSRUN

. Document Transfer Summary JSP:AR_DOC_TRS_SUMMARY_PG/

. Interfaces Menu:AR_INTERFACE_GUI/

. AutoInvoice FORM:AR_FNDRSRUN_AUTOINVOICE/FNDRSRUN

. Customer FORM:AR_FNDRSRUN_CUST_INTERFACE/FNDRSRUN

. Tax Rate FORM:AR_FNDRSRUN_TAX_INTERFACE/FNDRSRUN

. Lockbox FORM:AR_ARXLBSUB/ARXLBSUB

. General Ledger FORM:AR_FNDRSRUN_ARGLTP/FNDRSRUN

. Control Menu:AR_CONTROL_GUI/

. Requests Menu:FND_REPORT4.0/

. Run FORM:FND_FNDRSRUN/FNDRSRUN

. Set FORM:FND_FNDRSSET_USER/FNDRSSET

. Profile Options FORM:FND_FNDPOMSV/FNDPOMSV

. Concurrent FORM:FND_FNDCPQCR_USER/FNDRSRUN

. Accounting Menu:AR_CONTROL_ACC_GUI/

. Revenue Recognition FORM:AR_FNDRSRUN_REVREC/FNDRSRUN

. Open/Close Periods FORM:AR_ARXSUMPS/ARXSUMPS

. Revenue Accounting FORM:AR_ARXRAATR/ARXRAATR

. Correct Invalid GL Accounts FORM:AR_ARXGLCOR_CORRECT/ARXGLCOR

. Adjustments Menu:AR_CONTROL_ADJ_GUI/

. Create AutoAdjustments FORM:AR_ARXSUBAA/ARXSUBAA

. AutoInvoice Menu:AR_AUTOINVOICE_ERRORS_GUI/

. Interface Lines FORM:AR_ARXAIEXP_LINES/ARXAIEXP

. Interface Exceptions FORM:AR_ARXAIEXP_ERRORS/ARXAIEXP

. Receipts Menu:AR_CONTROL_RCPT_GUI/

. Automatic Receipts FORM:AR_RCPT_PROC/FNDRSRUN ---- Menu: XIR Receivables User has 73 items including 0 customized forms ---- Total for 1 responsibilities: 73 items including 0 customized forms End: MINDD2 30-JUN-2009 09:18:53

Key FlexfieldsCONTEXT TITLE USERCOL COLNAME VALUE_SET ------------------------------ ------------------------------ ------------------------------ --------------- ------------------------------ ACCOUNTING_FLEXFIELD Accounting Flexfield Company SEGMENT1 XXGL_Company Product Line SEGMENT2 XXGL_Product_Line Department SEGMENT3 XXGL_Department Account SEGMENT4 XXGL_Account Subaccount SEGMENT5 XXGL_Subaccount Project SEGMENT6 XXGL_Project

Descriptive FlexfieldsCONTEXT COLNAME USERCOL FORM_LEFT_PROMPT ------------------------------ ------------------------------ ------------------------------ ---------------------------------------- CLAIM INTERFACE_LINE_ATTRIBUTE1 Claim Number Claim Number

33Technical Overview

Page 34: Oracle Applications Utility SQL Scripts

INTERFACE_LINE_ATTRIBUTE2 Claim Id Claim Id INTERFACE_LINE_ATTRIBUTE3 Claim Line Id Claim Line Id INTERFACE_LINE_ATTRIBUTE4 Earnings Attached Flag Earnings Attached Flag INTERFACE_LINE_ATTRIBUTE5 Customer Reference Customer Reference INTERFACE_LINE_ATTRIBUTE6 Customer Reason Customer Reason INTERFACE_LINE_ATTRIBUTE7 Claim Reason Claim Reason CONTRACTS INTERFACE_LINE_ATTRIBUTE1 Contract Id Contract Id INTERFACE_LINE_ATTRIBUTE2 Service Id Service Id INTERFACE_LINE_ATTRIBUTE3 Contract Number Contract Number INTERFACE_LINE_ATTRIBUTE4 Billing Id Billing Id INTERFACE_LINE_ATTRIBUTE5 Contract Type Id Contract Type Id INTERFACE_LINE_ATTRIBUTE6 Contract Group Id Contract Group Id INTERFACE_LINE_ATTRIBUTE7 Transaction Start Date Transaction Start Date INTERFACE_LINE_ATTRIBUTE8 Transaction End Date Transaction End Date INTERFACE_LINE_ATTRIBUTE9 Transaction Amount Transaction Amount INTERFACE_LINE_ATTRIBUTE10 Service Transaction ID Service Transaction ID ...

Key Flexfield DescriptionsGeneral Ledger Accounting Flexfield Values

# Segment Value Description --- --------------- ---------- ------------------------------ 1 Company 01 Xilinx, USA 2 Product Line 00 None 3 Department 2100 Marcom Mgmt 4 Account 6930 Internal Consumption 5 Subaccount 00 Channel Marketing 6 Project 0000 None

TablesDatabase Session OS User Machine Time Version -------------------- -------- ---------- -------------------- -------------------- ------------------------------ Start: ERPCOP 2047 bfurey XXXX\XIR-ITCON-D7 01-JUL-2009 04:01:46 Oracle Database 10g 10.2.0.3.0

AR "Schema", RA "Prefix"

Tables Summary (excluding like 'RISKXX', 'INCIDXXX', '$' ) TABLE_NAME Who? Attrs Indexes Cols ------------------------------ ----- ----- ------- ---- RA_ACCOUNT_COMBINATIONS Yes 16 2 25 RA_ACCOUNT_DEFAULTS_ALL Yes 16 1 24 RA_ACCOUNT_DEFAULT_SEGMENTS Yes 16 2 27 RA_ADDRESSES_ALL Yes 37 9 97 RA_BATCHES_ALL Yes 16 5 47 RA_BATCH_SOURCES_ALL Yes 37 2 94 RA_CM_REQUESTS_ALL Yes 1 24 RA_CM_REQUEST_LINES_ALL Yes 1 11 RA_CONTACTS Yes 26 9 69 RA_CONTACT_PHONES_INT_ALL Yes 42 4 71 RA_CONTACT_ROLES Yes 16 2 30 RA_CUSTOMERS Yes 37 7 117 RA_CUSTOMERS_INTERFACE_ALL Yes 129 6 203 RA_CUSTOMER_BANKS_INT_ALL Yes 67 6 107 RA_CUSTOMER_MERGES Yes 16 6 59 RA_CUSTOMER_MERGE_HEADERS Yes 16 2 45 RA_CUSTOMER_PROFILES_INT_ALL Yes 73 2 129 RA_CUSTOMER_RELATIONSHIPS_ALL Yes 16 3 32

34Technical Overview

Page 35: Oracle Applications Utility SQL Scripts

RA_CUSTOMER_TRX_ALL Yes 62 21 173 RA_CUSTOMER_TRX_LINES_ALL Yes 52 16 133 RA_CUST_PAY_METHOD_INT_ALL Yes 16 2 31 RA_CUST_RECEIPT_METHODS Yes 16 2 32 RA_CUST_TRX_LINE_GL_DIST_ALL Yes 16 8 59 RA_CUST_TRX_LINE_SALESREPS_ALL Yes 16 6 40 RA_CUST_TRX_TYPES_ALL Yes 37 1 79 RA_GROUPING_RULES Yes 16 2 27 RA_GROUPING_TRX_TYPES Yes 16 1 24 RA_GROUP_BYS Yes 16 1 23 RA_GROUP_BY_COLUMNS Yes 1 10 RA_INTERFACE_DISTRIBUTIONS_ALL Yes 31 4 109 RA_INTERFACE_ERRORS_ALL 2 8 RA_INTERFACE_LINES_ALL Yes 127 9 305 RA_INTERFACE_SALESCREDITS_ALL Yes 31 2 49 RA_ITEM_EXCEPTION_RATES Yes 16 2 48 RA_LINE_ORDERING_RULES Yes 16 2 26 RA_LINE_ORDER_BYS Yes 16 1 25 RA_LINE_ORDER_BY_COLUMNS Yes 1 8 RA_MC_BATCHES 1 5 RA_MC_CUSTOMER_TRX 1 5 RA_MC_CUSTOMER_TRX_LINES Yes 1 8 RA_MC_TRX_LINE_GL_DIST 3 10 RA_PHONES Yes 16 6 36 RA_RECUR_INTERIM Yes 14 RA_REMIT_TOS_ALL Yes 16 1 28 RA_RULES Yes 16 1 29 RA_RULE_SCHEDULES Yes 16 1 25 RA_SALESREPS_ALL_OLD Yes 16 5 46 RA_SALESREP_TERRITORIES Yes 16 1 30 RA_SITE_USES_ALL Yes 47 3 114 RA_TAX_EXEMPTIONS_ALL Yes 16 5 60 RA_TERMS_B Yes 16 1 33 RA_TERMS_LINES Yes 16 1 28 RA_TERMS_LINES_DISCOUNTS Yes 16 1 29 RA_TERMS_TL Yes 2 10 RA_TERRITORIES Yes 16 1 49

55 rows selected.

Tables and ColumnsTables and Columns (omitting Who and %ATTRIBUTE%)

TABLE_NAME Who? Attrs Indexes COLUMN_NAME DATA_TYPE Length Index Pos ------------------------------ ----- ----- ------- ------------------------------ --------- ------ ---------- RA_ACCOUNT_COMBINATIONS Yes 16 2 account_combination_id* NUMBER 22 1 code_combination_id* NUMBER 22 last_update_login NUMBER 22 value1 VARCHAR2 30 1 value2 VARCHAR2 30 2 RA_ACCOUNT_DEFAULTS_ALL Yes 16 1 gl_default_id* NUMBER 22 1 last_update_login NUMBER 22 org_id NUMBER 22 type* VARCHAR2 20 ...

IndexesIndexes

35Technical Overview

Page 36: Oracle Applications Utility SQL Scripts

TABLE_NAME INDEX_NAME Seq COLUMN_NAME ------------------------------ ------------------------------- ---- ------------------------------ RA_ACCOUNT_COMBINATIONS RA_ACCOUNT_COMBINATIONS_U1* 1 account_combination_id RA_ACCOUNT_COMBINATIONS_U2* 1 value1 2 value2 RA_ACCOUNT_DEFAULTS_ALL RA_ACCOUNT_DEFAULTS_U1* 1 gl_default_id RA_ACCOUNT_DEFAULT_SEGMENTS RA_ACCOUNT_DEFAULT_SEGMENTS_N1 1 gl_default_id RA_ACCOUNT_DEFAULT_SEGMENTS_U1* 1 gl_default_segment_id ...

Tables with No Who Columns or No (or Id Only) Unique IndexesTables with no Who columns / No unique indexes/ Id only unique indexes

TABLE_NAME Who? No UID? Id UID? ------------------------------ ----- ------- ------- RA_ACCOUNT_DEFAULTS_ALL X RA_ACCOUNT_DEFAULT_SEGMENTS X RA_BATCHES_ALL X RA_CM_REQUESTS_ALL X RA_CM_REQUEST_LINES_ALL X RA_CONTACT_ROLES X RA_CUSTOMER_MERGES X RA_CUSTOMER_MERGE_HEADERS X RA_CUSTOMER_TRX_ALL X RA_CUSTOMER_TRX_LINES_ALL X RA_CUST_RECEIPT_METHODS X RA_CUST_TRX_LINE_GL_DIST_ALL X RA_CUST_TRX_LINE_SALESREPS_ALL X RA_CUST_TRX_TYPES_ALL X RA_GROUPING_TRX_TYPES X RA_GROUP_BYS X RA_GROUP_BY_COLUMNS X RA_INTERFACE_DISTRIBUTIONS_ALL X RA_INTERFACE_ERRORS_ALL X X RA_INTERFACE_LINES_ALL X RA_INTERFACE_SALESCREDITS_ALL X RA_ITEM_EXCEPTION_RATES X RA_LINE_ORDER_BYS X RA_LINE_ORDER_BY_COLUMNS X RA_MC_BATCHES X X RA_MC_CUSTOMER_TRX X X RA_MC_CUSTOMER_TRX_LINES X RA_MC_TRX_LINE_GL_DIST X X RA_RULES X RA_RULE_SCHEDULES X RA_SALESREPS_ALL_OLD X RA_SALESREP_TERRITORIES X RA_SITE_USES_ALL X RA_TAX_EXEMPTIONS_ALL X RA_TERMS_B X RA_TERMS_LINES X RA_TERMS_LINES_DISCOUNTS X RA_TERMS_TL X RA_TERRITORIES X

39 rows selected.

Inventory OrganizationsInv Org Owner Master

36Technical Overview

Page 37: Oracle Applications Utility SQL Scripts

(Headins only for privacy)------------------------------------------------------- --------------------------------------------- ---------------------------------------------

Organizations by ClassClass Org Id Code LE Address ------------------------------ -------------------------------------------------- ----- ---- -------------------- ------------------------------------BOM_ECOD (Fields removed for privacy)FA_ORG ...HR_LEGAL ...HR_ORG ...INV ...MRP ...OPERATING_UNIT ...OTA_TC ...WIP ...

37Technical Overview