Saturday, 4 June 2016

How To Bounce Apache Server in Oracle E-Business R12

Generally in day to days usage of Oracle Apps R12 we came up many issue which is resolved by bouncing Apache Server like :-
 - JSP page not loading
 - Changes in are not appearing after done with personalization
 - Some weird java error.
Its really easy to get this done and not a big mans job any more.

#1 Login to Unix prompt with right privilege that can let you stop and start the services. Source and the environment variable.
login as: invincibleapps
Using keyboard-interactive authentication.
Enter your PASSWORD:
Last login: Sun Sep  8 17:36:19 2013
You are now pointed to invincibleapps Apps environment
[invincibleapps@dev ~]$ . /d01/appldev/invincibleapps/apps/apps_st/appl/APPSinvincibleapps_dev.env
[invincibleapps@dev ~]$
#2 Move to directory $INST_TOP and go inside admin/scripts
[invincibleapps@dev ~]$ cd $INST_TOP
[invincibleapps@dev ~]$ cd admin/scripts
[invincibleapps@dev scripts]$

#3 Execute the command
[invincibleapps@dev scripts]$ sh adapcctl.sh stop
[invincibleapps@dev scripts]$ sh adapcctl.sh start

You are running adapcctl.sh version 120.7.12010000.2

Starting OPMN managed Oracle HTTP Server (OHS) instance ...
opmnctl: starting opmn managed processes...

adapcctl.sh: exiting with status 0

Register Custom Tables in Oracle Apps

All you technical people out there very well know the purpose of creating custom table. Its basically when we need to store data before pulling into standard table (In case of inbound interface) or putting extract of data to share with external entity (In case of outbound interface). All these activities can be accomplished without registering custom table in oracle apps.

If you have a need to use these custom tables in standard functionality in frond end like using in Alerts / Audits, you must register them. Otherwise your custom table will not be visible in front end.
Lets start this by creating a sample custom table.
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 
Connected as c_apps
 
SQL> 
SQL> CREATE TABLE C_FND_INTERFACES
  2  ( INTERFACE_ID            NUMBER               NOT NULL PRIMARY KEY,
  3    SERVICE_CHANNEL         VARCHAR2(64 BYTE)    NOT NULL,
  4    SOURCE                  VARCHAR2(64 BYTE) NOT NULL,
  5    ATTRIBUTE1              VARCHAR2(2000 BYTE),
  6    ATTRIBUTE2              VARCHAR2(2000 BYTE),  7    ATTRIBUTE3              VARCHAR2(2000 BYTE),
  8    ATTRIBUTE4              VARCHAR2(2000 BYTE),
  9    ATTRIBUTE5              VARCHAR2(2000 BYTE),
 10    ATTRIBUTE6              VARCHAR2(2000 BYTE),
 11    ATTRIBUTE7              VARCHAR2(2000 BYTE),
 12    ATTRIBUTE8              VARCHAR2(2000 BYTE),
 13    ATTRIBUTE9              VARCHAR2(2000 BYTE),
 14    ATTRIBUTE10             VARCHAR2(2000 BYTE),
 15    STATUS                  VARCHAR2(50 BYTE)    NOT NULL,
 16    ERROR_MESSAGE           VARCHAR2(2000 BYTE),
 17    CREATED_BY              NUMBER               NOT NULL,
 18    CREATION_DATE           DATE                 NOT NULL,
 19    LAST_UPDATED_BY         NUMBER               NOT NULL,
 20    LAST_UPDATE_DATE        DATE                 NOT NULL,
 21    REQUEST_ID              NUMBER,
 22    BATCH_ID                NUMBER
 23  )
 24  TABLESPACE C_APPS
 25  PCTUSED    0
 26  PCTFREE    10
 27  INITRANS   1
 28  MAXTRANS   255
 29  STORAGE    (
 30              INITIAL          64K
 31              NEXT             1M
 32              MINEXTENTS       1
 33              MAXEXTENTS       UNLIMITED
 34              PCTINCREASE      0
 35              BUFFER_POOL      DEFAULT
 36             )
 37  LOGGING
 38  NOCACHE
 39  NOPARALLEL
 40  /
 
Table created
 
SQL> 

You would have noticed that table is created under custom schema. Make sure you create synonym under APPS schema.

There are 4 steps involved in registering table in Oracle Applications

#1 - Register Table
ad_dd.register_table 
(p_appl_short_name IN VARCHAR2, -- Application Short Name
 p_table_name      IN VARCHAR2, -- Table Name
 p_table_type      IN VARCHAR2, -- Table Type. Use 'T' if transaction table. 'S' for seed data table.
 p_next_extent     IN NUMBER DEFAULT 512,
 p_pct_free        IN NUMBER DEFAULT 10, -- % of space in each of the table block reserved for future updates(1-99)
 p_pct_used        IN NUMBER DEFAULT 70) -- MINimum percentage of used space IN each data block of the table (1-99)
                                       ; -- The sum of p_pct_free and p_pct_used must be less than 100
Sample Script
EXECUTE ad_dd.register_table 
(p_appl_short_name =>  'C_APPS',
 p_table_name      =>  'C_FND_INTERFACES',
 p_table_type      =>  'T',
 p_next_extent     =>  512,
 p_pct_free        =>  10,
 p_pct_used        =>  70);
                             
#2 - Register Column
ad_dd.register_column
(p_appl_short_name IN VARCHAR2, -- Application Short Name
 p_table_name      IN VARCHAR2, -- Table Name
 p_column_name     IN VARCHAR2, -- Column Name
 p_column_seq      IN NUMBER,   -- Sequence NUMBER of Column in table
 p_column_type     IN VARCHAR2, -- Column Type ('NUMBER', 'VARCHAR2', 'DATE', etc.).
 p_column_width    IN NUMBER,   -- Colum Size,Can use 9 for DATE columns, 38 for NUMBER columns
 p_nullable        IN VARCHAR2, -- Use 'N' if mandatory or 'Y' if it allows null values
 p_translate       IN VARCHAR2, -- 'N' if the values are not translated
 p_precision       IN NUMBER DEFAULT NULL, -- NUMBER of digits in a NUMBER    
 p_scale           IN NUMBER DEFAULT NULL);-- NUMBER of digits to the right of the decimal point
Sample Script
EXECUTE ad_dd.register_column
(p_appl_short_name =>   'C_APPS'
 p_table_name      =>   'C_FND_INTERFACES'
 p_column_name     =>   'interface_id'
 p_column_seq      =>   'c_fnd_interfaces_seq'
 p_column_type     =>   NUMBER
 p_column_width    =>   10
 p_nullable        =>   'N'
 p_translate       =>   'N'
 p_precision       =>   NULL
 p_scale           =>   NULL);
#3 - Register Primary Key
ad_dd.register_primary_key
(p_appl_short_name IN VARCHAR2,  -- Application Short Name
 p_key_name        IN VARCHAR2,  -- Primary Key Name
 p_table_name      IN VARCHAR2,  -- Table Name
 p_description     IN VARCHAR2,  -- Primary key Description
 p_key_type        IN VARCHAR2,  -- (D/S)Developer/Surrogate,DEFAULTs to null
 p_audit_flag      IN VARCHAR2,  -- (Y/N)DEFAULTs to null
 p_enabled_flag    IN VARCHAR2); -- (Y/N)DEFAULTs to null
Sample Script
EXECUTE ad_dd.register_primary_key
(p_appl_short_name =>   'C_APPS',
 p_key_name        =>   'INTERFACE_ID_PK',
 p_table_name      =>   'C_FND_INTERFACES',
 p_description     =>   'Interface ID Primary Key',
 p_key_type        =>   'S',
 p_audit_flag      =>   'Y',
 p_enabled_flag    =>   'Y');
#4 - Register Primary Key Column
ad_dd.register_primary_key_column
(p_appl_short_name IN VARCHAR2,
 p_key_name        IN VARCHAR2,
 p_tab_name        IN VARCHAR2,
 p_col_name        IN VARCHAR2,
 p_col_sequence    IN NUMBER);
Sample Script
EXECUTE ad_dd.register_primary_key_column
(p_appl_short_name =>  'C_APPS',
 p_key_name        =>  'INTERFACE_ID_PK',
 p_tab_name        =>  'C_FND_INTERFACES',
 p_col_name        =>  'INTERFACE_ID',
 p_col_sequence    =>  '1');
Let’s go and validate in application.
Navigate to Application Developer –> Application –> Database –> Table
F11 –> Enter your table_name ‘C_FND_INTERFACES’ –> Ctrl + F11.
 

Sunday, 8 November 2015

How to Turn On "About This Page" In Oracle R12

Set Following Profile Options as Required at User or Site

Personalize Self-Service Defn = YES
FND: Personalization Region Link Enabled = YES
Disable Self-Service Personal = NO (Only at Site)
FND: Diagnostics = Yes

Now bounce the Apache Server. Login to application, you can see the About This Page Link on all web pages.

Oracle Cursor and Trigger

Cursor: cursor is a private sql work area. Every sql statement executed by oracle server has an individual cursor associated with it.
Cursor are two types
1.Implicit cursor
2.Explicit cursor
Implicit cursor: Implicit cursors are declared by pl/sql implicitly at the time of DML statement and select statement in pl/sql including queries that returns single row.
Cursor have four attributes
1. SQL%ROWCOUNT
2. SQL%ISOPEN
3. SQL%NOTFOUND
4. SQL%FOUND

SQL%ROWCOUNT-Basically it returns  number. means number of rows affected by present sql statement.
SQL%ISOPEN-Always evalutes false because implicit cursor automatically closed after execution of sql statement.
SQL%FOUND-Always evalutes true because one or more rows are affected by recent sql statement
SQL%NOTFOUND-Always evalutes true when no rows are affected by present sql statement.

Example of explicit cursor
DECLARE
v_empno employees.employee_id%TYPE;
v_name employees.last_name%TYPE;
CURSOR emp_cur IS
SELECT employee_id,last_name FROM employees
BEGIN
OPEN emp_cur;
LOOP
FETCH emp_cur INTO v_empno,v_name ;
EXIT WHEN emp_cur%ROWCOUNT>10 OR
emp_cur%NOTFOUND;

DBMS_OUTPUT.PUT_LINE('employee_id:'||TO_CHAR(v_empno) || 'employee_name:'||'v_name');

END LOOP;
CLOSE emp_cur;
END;

Trigger Trigger is pl/sql block or procedure that is associated with table,view,schema and database. Execute immediately when particular event take place.
There are two types of trigger
1.Application trigger: Fires automatically when event occurs with particular application.
2.Database trigger: Fires when data such as DML oparation occured at that time.
DML triggers are two types
   1.Statementlevel trigger
   2.Rowlevel trigger

Statement level trigger -Statement level trigger means trigger body execute once for the triggering event.this is default.A statement level trigger fire once even no rows are affected at all.
Row level- Trigger body execute once for each row affected by triggering event.if no rows are affected in that case trigger body not executed.

Trigger example:
CREATE OR REPLACE TRIGGER secure_emp
BEFORE INSERT ON employees
BEGIN
TO_CHAR(SYSDATE,'DY')IN('SUN','SAT') OR TO_CHAR((SYSDATE,'HH24:MI')NOT BETWEEN '08:00' AND '18:00')THEN
RAISE_APPLICATION_ERROR(-20253,'u may insert employee information at business hrs');
END;

How to Load Oracle Workflow definition

The Workflow Definitions Loader is called WFLOAD and can be found in: $FND_TOP/bin

By default it can be used the following ways.
To upload:      WFLOAD apps/pwd 0 Y UPLOAD file.wft
To force:         WFLOAD apps/pwd 0 Y FORCE file.wft
To download: WFLOAD apps/pwd 0 Y DOWNLOAD file.wft ITEMTYPE1 [ITEMTYPE2...ITEMTYPEn]
To upgrade:    WFLOAD apps/pwd 0 Y UPGRADE file.wft

You can use a concurrent program to load process definitions. Run Workflow Definitions Loader concurrent program

What is NOCOPY hint?

Prior to Oracle 8i there were three types of parameter-passing options to procedures and functions:
    * IN: parameters are passed by reference
    * OUT: parameters are implemented as copy-out
    * IN OUT: parameters are implemented as copy-in/copy-out

The technique of OUT and IN OUT parameters was designed to protect original values of them in case exceptions were raised so that changes could be rolled back. Because a copy of the parameter set was made rollback could be done. However this method imposed significant CPU and memory overhead when the parameters were large data collections for example PL/SQL Table or VARRAY types.

With the new NOCOPY option OUT and IN OUT parameters are passed by reference which avoids copy overhead. However parameter set copy is not created and in case of an exception rollback cannot be performed and the original values of parameters cannot be restored.

Here is an example of using the NOCOPY parameter option:

TYPE Note IS RECORD( Title VARCHAR2(15), Created_By VARCHAR2(20), Created_When DATE, Memo VARCHAR2(2000));
TYPE Notebook IS VARRAY(2000) OF Note;
CREATE OR REPLACE PROCEDURE Update_Notes(Customer_Notes IN OUT NOCOPY Notebook) IS BEGIN ...END;

ORACLE APPS FAQ -1

1. How to register a report?
a) Register concurrent à Program à executable
b) Register concurrent à program à Define
c) Attach it to appropriate request group security à responsibility à Request
d) FTP RDF in respective top/report/US

2. How to CREATE a VALUE SET? What are the different types of value sets?
Enter Application à Validation à Set
Types of value set
a) Independent
b) Dependent
c) Table
d) Pair
e) SPECIAL DELIVERY translate dependent
f) Translatable independent

3. Name few types of execution method in concurrent program executable
a) Oracle reports
b) Sql * Plus
c) Host
d) Java stored procedure
e) Pl/sql stored procedure
f) SQL * Loader
g) Spawned
h) Java CCP
i) Multilanguage function
j) Immediate
k) Request set stage function

4. How to register a form?
a) Define Application à form
b) Define Application à function à give link to form defined in step I
c) Go to Application à menu à Attach function to menu
d) FTP from to AU_TOP, generate it and copy to respective TOP

5. What are the steps to develp a form>
a) Copy appstand.fmh, Template.FMB, required pll in local directory
b) Change the registry for pll path. Save template.fmb as the new form name from name and start developing the form
c) FTP form in AU_TOP and generate fmb using f60gen and copy.fmx in respective top/forms/us directory

6. what is the use of custom.pll?
Custom.pll is used for customizations such as form, enforcing business riles and disabling fields that are not required for site without modifying standard apps forms.

7. How to PROGRAMATICALLY submit the request?
a) with the help of standard API Find_Request. Submit_request

8. What is request set?
With the help of request set we can submit several requests together using multiple execution paths. Its collection of concurrent programs like reports procedures grouped together.

9. What are user exists in reports? What are user exist available in apps?
a) A user exit is a program written and then linked in to the report builder executable user exist are written when content need to be passed from report builder to that pgm, which performs some function and then returns control to report builder.

1. FND SRWINIT, FND SRWEXIT, FND FORMAT_CURRENCY, FND FLEXIDVAL, FND FLEXSQL.

10. What is the API used for file I/o operation ? or which API is used to write to request log and request output?
a) fnd_file.put_line (Fnd_file.log, ‘message’);
b) fnd_file.put_line (fnd_file.out. ‘message’);

11. how do I programmatically capture application user_id?
Fnd_profile.value (‘user_id’) or fnd_global.user_id.

12. what are flexfields?
A flexfield is a field made up of segments . each segment has a name and a set of valid values. There are two types of ff’s: key ff, DFF

13. Which are the 2 parameters required to be defined when a program is registered as pl/sql stored procedure
ERRBUF, RETCODE

14. can we register executable/concurrent program programmatically then how?
Yes we can. It can be done with standard package fnd_program, fnd_program.executable, fnd_program.register.

15. what changes need to be made if a setup is changed from a single org to multi org?
Org_id should be added as a parameter in a report and report should be run for specific org_id only

16. What are sub functions? How is it different from from?
A sub function is a securable subset of a forms functionally
a) forms appear in a navigator window and can be navigated to sub functions do not appear in the navigator window and cant be navigated to
b) forms can exist on this own sub functions can only be called by ____ embodied within a form, they cant exist on their own

17. what is message dictionary?
Message dictionary allows defining messages which can be used in application without hard coding them into forms or programs.

18. What is the token in concurrent à program à parameters window?
For a parameter in an oracle report program, they keyword is parameter specified here. The value is case sensitive for example P_CUSTOMER_NO

19. What are different validation defaults types and default value in current à program à parameter window?
a) constant
b) profile
c) SQL statement
d) Segment

20. I have a concurrent program that involves lot of inserts and updates on a huge basis where do I specify rollback segment etc
concurrent ->program->session control

21. How do I change the priority of my concurrent program?
Log on as system admin concurrent à program à program à priority, enter numerical value in this field so it will take the request which has higher priority.

22. What is incompatibility?
When a program or list of programs is defined as incompatible means that defined program is not compatible with incompatible program list and cant run simultaneously in same conflict domain.

23. What is data group?
A data group defines the mapping b/w oracle applications and oracle ID’s. A data group determines oracle database accounts a responsibilities forms, concurrent programs, and reports connect to

Oracle Apps SET - 2

1. What are alert in D2k forms?
An alert is a model window that displays a message notifying of some application condition. For example, do you want to save changes? Are you sure u want to exit? Or customer name can’t be bland ….

2. What is property class?
A property class is an object that contains a list of properties and their settings. Other objects can be based on property class. An object based on a property class can inherit the setting of any property in the class that makes sense for that object.

3. What is the difference b/w property class and visual attribute?
Visual attributes only for the visual properties of the item like font, color, whereas property class is for all the possible properties of objects.

4. What is an LOV?
LOV is a scrollable popup window that provides the use with selection list.

5. What are record groups and what are its types?
a) A record group is an internal form builder data structure that has a column/row framework similar to a database table.
b) Query record group – associated select statement
c) Non query Record group – doesn’t have query but can be changed programmatically.
d) Static record group – cant be changed programmatically.

6. What is restricted built_ins?
Any built_ins subprogram that initiates navigation is restricted. This includes subprograms that move the input focus from one item to another and those that involve database transactions. Restricted build_ins are not allowed in trigger that fire in response to internal navigation.

7. What are categories of trigger?
a) block – processing triggers. Related to record mgmt in a block eg: when clear block.
b) Interface event triggers : interface event triggers fire in response to events that occur in the form interface eg: when button pressed. When checkbox changed.
c) Master_detail triggers : from builder generates master/detail triggers automatically when a master/detail relation is defined b/w blocks. This is to enforce co-ordination b/w 2 blocks. For example, on clear details.
d) Message handling triggers : message handling triggers fire in response to default messaging events. To trap or recover an error. Eg on_error, on_message
e) Navigational triggers : navigational triggers fire in response to navigational events. For instance clicking on a text item from another block eg: pre block, post text item, when new item instance.
f) Query_item trigger : Eg; pre query and post query
g) Transactional triggers : Fire in response to events that occur as a form interacts with the database. Eg: on_delete, pre_commit
h) Validation trigger : when form validated data in item or record e: when validate item.

8. What is the sequence of events fired while cursor moves from an item from i1st block to an item in 2nd block?
When validate item of that item A
Post_text_item of A
When validate record
Post record
Post block
Pre block
Pre record
Pre text item
When_new_block_instance
When_new_Record_Instance
When_new_item_instance

9. what are types of canvas?
a) Content : The default specifies that the canvas should occupy the entire content area of the window to which it is assigned.
b) Stacked : Specifies that the canvas should be displayed in its window at the same time as the window’s content canvas. They are usually displayed programmatically and overlay some portion of the content view displayed in the same window
c) Vertical toolbar canvas : specifies that the canvas should be displayed as a vertical toolbar under the menu bar of the window.
d) Horizontal toolbar canvas : specifies that the canvas should be displayed as a horizontal toolbar at the left side of the window to which it is assigned.

10. How do I attach menu to a form?
Form à properties à functional à menu source à File
Forms à Properties à functional à menu module à name of menu (main menu

11. What are 2 types of data blocks object?
a) Data blocks : data blocks are associated with data within a database. Data blocks can be based on database table, views, procedure or transactional triggers.
b) Control blocks : in contrast a control block is not associated with the database and the item in or control block do not relate to table columns within a database.

12. How do I dynamically change the title of window?
a) set_window_property built-in

13. Name few system variables in forms?
A system variable is a form builder variable that keeps track of an internal form builder state. For example, system.Block_status, system, mode, system.from_status.

14. How to attach reports in oracle application?
The steps are as follows:
a) Design you report
b) Generate the executable file of the report.
c) Move the executable as well as source file to the appropriate products folder.
d) Register the report as concurrent executable
e) Define the concurrent program for the executable registered
f) Add the concurrent program to the request group of the responsibility

15. What are different report triggers and what is their firing sequence?
There are fiver report trigger:
a) Before report
b) After report
c) Before parameter form
d) After parameter form
e) Between pages
The firing sequence for report trigger is
Before parameter form – After parameter form – before report – between pages – after report.

16. What is the use of cursors in PL/SQL? What is REF Cursor?
The cursor is used to handle multiple row query in PL/SQL. Oracle uses implicit cursors to handle its queries. Oracle uses unnamed memory spaces to store data used in implicit cursors, with REF cursors you can define a cursor variable, which will point to that memory space and can be used like pointers in our 3GL’s

17. What is record group?
Record group are used with LOV’s to hold SQL query for your list of values. The record group can contain static data as well it can access dates from database tables through sql queries

18. What is flexfield? What are DFF& KFF?
In oracle application field made up of segments each segment has Assigned name and a set of valid values. oracle application uses flexfield to capture into about your organization

19. What are Autonomous Transaction? Give Scenario where you have used Autonomous transaction In your report ?
An Autonomous transaction is an independent transaction started by another transaction , the main transaction ,Autonomous transaction lets you suspend the main transaction do SQL operations ,commit or rollback those operation then resume the main transaction Once started an autonomous transaction fully independent .It shares no locks ,resources .or commit dependencies with the main transaction so ,you can log events increment retry counters ,and soon even if the main transaction rolls back More important, Autonomous transaction help you build modules reusable software component . for example Stored procedures can start and finish autonomous transaction there own .A calling application need not know about a procedures autonomous operations, and the procedures need not know about the application transaction content.

Scenario: you can use autonomous transaction in your report for writing error message in your database table.

20. What is the use of trigger in the form?
Triggers are used in forms for event handling u can write PL/SQL code in trigger to respond to a particular event occurred in your forms like when user presses a button or when he commits the form

The different types to triggers available I forms are
a)Key Trigger
b)Navigational Trigger
c)Transaction triggers
d)Message Triggers
e)Error triggers
f)Query triggers

21. What is the use of temp table and interface table ?
Temporary table are used in I/F programs to hold the intermediate data. The data is loaded into temporary first and then after validation through the PL/SQL program, the data is loaded into the interface table

22. What are the steps to register concurrent program in APPS?
The steps to register the concurrent prom in APPS are follows
a)Register the prom as concurrent prom for the executable
b)Define the concurrent prom for the executable registered
c)Add the concurrent program to the request group of the responsibilities

23. How to pass parameters to a report ? Do you have to register them with AOL?
U can define parameters in the define concurrent prom form there is no need to register the parameters with AOL .But you may have to register the value sets for those parameters

24. Do you have to register feeder program of interface to AOL?
Yes, U have to register the feeder program as concurrent prom to APPS

25. What are the forms customization steps
Steps are as follows
a)Copy the “Template fmb”1 and “Appstand.fmb” from AU_top/Forms/us. Put it in custom directory .
the Libraries(FNDSQF,APPCORE,APPDAYPK,GLOBE,CUSTOM,JE,JA,VERT)are automatically attached
b)Create/open new forms .then customise
c)save this form in corresponding module.

26. How to use flexfield In report?
There are two ways to use flexfield in reports one is to use the views(table name+`_kfv`or `_dfv`) created by apps, and use the concatenated segment column that holds the concatenated segments of the key or descriptive flexfield
(or)
To use the FND user exits provided by apps

27. what is KFF, DFF?
KFF : # unique identifiers, storing key into # used for entering and displaying key into
For example oracle general uses a KFF called Accounting flex field to uniquely identify a general account.