Thursday, November 28, 2019

Oracle invalid Objects

                                       

It is quite normal for Oracle database objects to become INVALID, especially when a dependency chain is broken.This article takes a closer look at:

We need to know about Typical reasons.....

Why Oracle objects become INVALID?
How to identify INVALID objects in Oracle?
How to convert INVALID objects to VALID?

Why do Oracle objects become INVALID ?

Oracle objects often become invalid during patching or upgrades because objects they depend on get dropped or altered in some way.

Let’s see this in action with a table having a dependent view and procedure.

I am going to create new table here ..

-- Table on which other objects depend --

SQL>  create table temp_table
  2   ( id number);

Table created.

--The dependent view and procedure:--

SQL>  create view temp_view
  2   as select * from temp_table;

View created.

  -- Dependent procedure--

SQL>  create procedure temp_proc
  2   as
  3     l_id   number;
  4   begin
  5     select id into l_id
  6     from temp_table;
  7   end;
  8   /

Procedure created.

All the three objects – the table, the view and procedure – are valid at this time:

-- Check object validity---

SQL> select object_name
  2       , object_type
  3       , status
  4  from all_objects
  5  where object_name like 'TEMP%';



Now, we drop the table…

-- Drop the table; break the
- dependency chain----


SQL> drop table temp_table;

Table dropped.

…and check the status of the view and the procedure ---



Outcome: no more table – and both of the dependent objects have become invalid.


Another way objects become invalid is when errors occur at the time of creation or change. For example, a stored procedure gets created/replaced as valid if it compiles successfully, else it is invalid.

We can test this out with a procedure containing a coding error (a missing quote in dbms_output.put_line):


 -- Procedure with compilation error
 -- Will get created as INVALID; will not autocompile---


SQL> create or replace procedure temp_proc_with_bug
  2  as
  3  begin
  4    dbms_output.put_line('Missing closing quote!);
  5  end;
  6  /

Warning: Procedure created with compilation errors.


When we check ALL_OBJECTS, we find that this procedure got created despite the error, but with status INVALID.

 -- Check object validity--

SQL> select object_name
  2       , object_type
  3       , status
  4  from all_objects
  5  where object_name = 'TEMP_PROC_WITH_BUG';



How to identify INVALID objects in Oracle ?

The first step is to get the list of objects and their relevant details (type, last DDL time, etc.), with a filter for status INVALID. To get this information, query [DBA/ALL/USER]_OBJECTS depending on your privileges:

DBA_OBJECTS : All objects in the database
ALL_OBJECTS : All objects accessible to the user
USER_OBJECTS : All objects owned by the user

 -- Check for invalid objects---

SQL> select object_name
  2       , object_type
  3       , status
  4  from all_objects
  5  where status = 'INVALID';


The next step is to find out *why* the object is invalid. To get this information, query [DBA/ALL/USER]_ERRORS depending on your privileges.


DBA_ERRORS : Current errors on all objects in the database
ALL_ERRORS : Current errors on all objects accessible to the user
USER_ERRORS : Current errors on all objects owned by the user

 -- Check the error details---

SQL> select name
  2       , type
  3       , line
  4       , position
  5       , text
  6  from all_errors
  7  where name like 'TEMP%';




Note that not all invalid objects will have errors listed for them in *_ERRORS;
some will get an entry when we make an attempt to access them.
You can see this in the results of the last two SQLs:
though TEMP_VIEW and TEMP_PROC are listed as invalid in ALL_OBJECTS, they are absent from ALL_ERRORS as they have not been accessed yet.

Let’s try to access the invalid objects and check ALL_ERRORS again.

-- Query the INVALID view--

SQL> select * from temp_view;
select * from temp_view
              *
ERROR at line 1:
ORA-04063: view "HR.TEMP_VIEW" has errors

 -- Execute the INVALID package

SQL> exec temp_proc;
BEGIN temp_proc; END;
      *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object HR.TEMP_PROC is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

 -- Check the error details--

SQL> select name
  2       , type
  3       , line
  4       , position
  5       , text
  6  from all_errors
  7  where name like 'TEMP%';




The errors are now listed in ALL_ERRORS, since an attempt was made to query or access the invalid objects.


How to convert INVALID objects to VALID ?

Most of the time, you do not need to explicitly recompile objects. When there are no compilation failures, the object will turn from invalid to valid as soon as it is executed or accessed again.


To see how this works, let’s reinstate the missing object (table TEMP_TABLE) which had caused dependent objects (view TEMP_VIEW and procedure TEMP_PROC) to become invalid, and then check the status of dependent objects.

-- Reinstate the dropped table--

SQL>  create table temp_table
  2   ( id number);

Table created.

 -- BEFORE querying dependent view---
 -- Check object validity--

SQL> select object_name
  2       , object_type
  3       , status
  4  from all_objects
  5  where object_name like 'TEMP_VIEW';


OBJECT_NAME        OBJECT_TYPE    STATUS
------------------ -------------- -------
TEMP_VIEW          VIEW           INVALID

-- Query the dependent view--

SQL> select * from temp_view;

no rows selected

-- Query the dependent view--

SQL> select * from temp_view;

no rows selected

-- AFTER querying dependent view---
 -- Check object validity--

SQL> select object_name
  2       , object_type
  3       , status
  4  from all_objects
  5  where object_name like 'TEMP_VIEW';

OBJECT_NAME        OBJECT_TYPE    STATUS
------------------ -------------- -------
TEMP_VIEW          VIEW           VALID

…which goes to show that the invalid object fixed itself on its own.

If you want to compile invalid objects in advance –
perhaps to distinguish between those that would auto-fix themselves and those that wouldn’t – you can follow one of the these approaches.

1. ALTER…COMPILE per object
Compile objects selectively, one at a time, using the syntax:

ALTER [object_type] [object_name] COMPILE;

SQL> ALTER PROCEDURE temp_proc COMPILE;
Procedure altered.
If the compilation fails, use “sho err” on SQL*Plus to display errors.


SQL> ALTER PROCEDURE temp_proc_with_bug COMPILE;
Warning: Procedure altered with compilation errors.

SQL> sho err


2. DBMS_UTILITY.COMPILE_SCHEMA

Use DBMS_UTILITY.COMPILE_SCHEMA to compile all object types in the specified schema. This takes as input a “compile_all” option: 

if TRUE (the default), all objects in the schema are compiled, if FALSE only invalid objects are compiled.

exec dbms_utility.compile_schema(
    schema => '<schema_name>'
  , compile_all => FALSE -- Compile only INVALID objects
     );
Let’s see this action:


SQL> exec dbms_utility.compile_schema(schema => USER, compile_all => FALSE);

PL/SQL procedure successfully completed.

 -- AFTER compile_schema---
 -- Check object validity---

SQL> select object_name
  2       , object_type
  3       , status
  4  from all_objects
  5  where object_name like 'TEMP%';
OBJECT_NAME        OBJECT_TYPE    STATUS
------------------ -------------- -------
TEMP_PROC          PROCEDURE      VALID
TEMP_PROC_WITH_BUG PROCEDURE      INVALID
TEMP_TABLE         TABLE          VALID
TEMP_VIEW          VIEW           VALID

The objects that remain invalid after running DBMS_UTILITY.COMPILE_SCHEMA are those that need a review and fix of errors in *_ERRORS.

-----------------------S U M M A R Y 


Oracle objects typically become invalid when a dependency chain is broken, or when they have errors at the time of compilation.

Invalid objects can be identified by querying *_OBJECTS with a filter on status = INVALID. Error details can be queried from *_ERRORS.

Invalid objects get automatically recompiled when they are accessed or executed. 
To compile them in advance, you can use ALTER…COMPILE per object, or DBMS_UTILITY.COMPILE_SCHEMA for all objects in the schema.
                -----------------------------------------------

S C R I P T  F O R  Y O U ............

set heading off;
set feedback off;
set echo off;
Set lines 999;

Spool run_invalid.sql

select
'ALTER ' || OBJECT_TYPE || ' ' ||
OWNER || '.' || OBJECT_NAME || ' COMPILE;'
from
dba_objects
where
status = 'INVALID'
and
object_type in ('PACKAGE','FUNCTION','PROCEDURE')
;
spool off;
set heading on;
set feedback on;
set echo on;



Saturday, October 19, 2019

ORA-28007: the password cannot be reused

 When you Trying to reset to the existing password to the oracle user ,You may encounter below error .

SQL> alter user nadhan IDENTIFIED BY  'xxxxxx';
alter user nadhan IDENTIFIED BY 'xxxxxxx'
*
ERROR at line 1:
ORA-28007: the password cannot be reused


Solution:

Reason could be that the user's  profile options .

​Check the user profile set for the user. Check for the existence of a password verify function in the profile.
Set the password_verify_function to NULL

Another reason could be that the PASSWORD_REUSE_MAX limit has reached. If so set to a higher value or to UNLIMITED and reset the password as shown below.

Check user profile:

select * from dba_profiles where profile='USER_PROFILE';
select USERNAME, PROFILE, ACCOUNT_STATUS from dba_users where username = 'nadhan';
select * from dba_profiles where profile='USERNAME' and RESOURCE_NAME in
('PASSWORD_REUSE_TIME');


Change below profile values .

SQL>alter profile USER_PROFILE limit password_verify_function NULL;

SQL> alter profile USER_PROFILE limit PASSWORD_REUSE_MAX unlimited;


Now you can set user passwords same as earlier .

Once the password is changed make it to default...
SQL>alter profile USER_PROFILE limit password_verify_function DEFAULT;

SQL>alter profile USER_PROFILE limit PASSWORD_REUSE_MAX DEFAULT;

If you don't know the existing user password and still you want to set it as earlier one .
Below are the steps ...

1. Note down the password value by using below script .


SQL> select password from user$ where name='NADHAN' ;

PASSWORD    --nadhans                    
------------------------------
5J53351LKJIH9AEE7


2. Check User status .

SQL>  select USERNAME,PASSWORD,ACCOUNT_STATUS,EXPIRY_DATE from dba_users where USERNAME like '%NADHAN%';

USERNAME    PASSWORD     ACCOUNT_STATUS    EXPIRY_DATE
---------    ------------------------------------------- ------------------------------------
NADHAN                                         EXPIRED                 24-AUG-21


3. Set temporary passwords to make it as active .

SQL> alter user NADHAN identified by Test123#BB ;

4. Check status now ,It should be OPEN.

SQL> select account_status from dba_users where username='NADHAN' ;

ACCOUNT_STATUS
--------------------
OPEN



5. Now alter the password by using VALUES .

SQL> alter user ITCNIMBUS identified by VALUES '5J53351LKJIH9AEE7' ;

User altered.


6.Check User status now .

SQL>  select USERNAME,PASSWORD,ACCOUNT_STATUS,EXPIRY_DATE from dba_users where USERNAME like '%NADHAN%';

USERNAME    PASSWORD     ACCOUNT_STATUS             EXPIRY_DATE
---------    ------------------------------------------- --------------------------------------------------
NADHAN                                        OPEN                                  24-AUG-21

                      
Now users can connect or use old password .

 

Saturday, August 17, 2019

ADPATCH



Oracle EBS is set of many application. The technology stack consists of Application filesystem, database  and IAs server.
We often need to patch it either to fix a bug or upgrade it. This article we are presenting the basics of  patch and how patching is done in Oracle EBS environment.

What is patch ?

When a customer reports a problem or TAR (Technical Assistance Request) a support analyst investigates the problem. If a patch doesn’t exist to fix the problem, the problem is logged as a bug. Development researches the bug and creates a patch.

Types of application patches ?

• Stand-alone (one-off) Patch:  Addresses a single fix or enhancement. Stand-alone patches are released only when there is an immediate need for a fix or enhancement that cannot wait until an aggregate bundling is available. Although stand-alone patches are intended to be as small as possible, they usually include any dependent files that have changed since the base release in order to form a complete patch that can be applied by any customer.
The actual number of files changed will depend on the current code level on the system to which the patch is being applied.

• Rollup Patch (RUP): An aggregation of patches that may be at the functional level, or at a specific product/family release level. For example, a Flexfields rollup patch contains all the latest patches related to Flexfields at the time the patch was created. A Marketing Family 11.5.9 rollup patch contains all the latest Marketing patches released since, and applicable to, 11.5.9.

Simply we can say A rollup patch is one which will deliver bug fixes identified after the release of any major application versions like 12.1.3

• Mini-pack: An aggregation of patches at the product level. For example, Inventory Mini-pack G (11i.INV.G) contains all the latest patches for the Inventory product at the time the mini-pack was created.Mini-packs are cumulative.

In other words , A mini pack is one which will upgrade any product patchset level to next level like AD.H to AD.I

• Family Pack: An aggregation of patches at the product family level. For example, HR Family Pack C (11i.HR_PF.C) contains all the latest patches for products in the HR family at the time the family pack was created. Family packs are cumulative.
Simply we can say,A Family pack is one which will upgade the patchset level of all the products in that family to perticular patchsetlevel.

• Maintenance Pack: An aggregation of patches for all products in the E-Business Suite. For example, Release 11.5.10 Maintenance Pack contains all the latest code level for all products at the time 11.5.10 was created. Maintenance packs are numbered sequentially such as 11.5.8, 11.5.9, 11.5.10, and are cumulative
Simply We can say A maintanance pack will upgrade applications from one version to another like 12.1.2 to 12.1.3

• consolidated patch:Consolidated patches will come into pictures after upgrades from one version of applications to anoter, all post upgrade patches will a consolidated and given as consolidated patch.

Patches can also be organized by purpose.

• Diagnostic Patch: Used to gather additional information when a product failure cannot be reproduced by Oracle. The additional information will assist Oracle Support Services and Oracle Development in resolving the failure.• Interoperability Patch: Allows Oracle Applications to function properly with a newer version of the technology stack. Interoperability patches are typically required with new version of the database or Applications technology stack.

• Translated Patch: A non-English version of a patch. Release 11i supports 30 non-English languages. Customers who are using languages other than English, need to apply the corresponding translated patch(es) for the languages they are using in addition to any base US patch(es).

• Merged Translation Patch: Provided in real time (without requiring a translator) in the event a translated patch is not available when a customer needs it. A merged translation patch is applied just like a fully translated patch. The fully translated patch is escalated and is usually available within 24 hours. It can be applied safely on top of a merged translation patch.

• Translation Fix:
Provided in the event a translation word choice is inappropriate. A translation fix is applied just like a translated patch, except there is no corresponding base US patch.

• New Feature Patch:
Introduces new functionality and/or products. It is applied using standard patching utilities.

About Patch Structure:-

Patch Structure is formed by a top-level directory with several files nested under it. Top-Level directory is the Patch Number and various files in a Patch are:-

Ø  Readme Files

Readme.txt and Readme.html files describes:-

·         Software Requirements like patches to be applied before applying this patch or what Application Release we should have.

·         Disk Space Requirements

·         Manual Steps to Run.

·         Problems Fixed in this Patch

·         Post Patching Steps.



Ø  Patch Driver Files

Patch Driver files consist of various files:-

·         Copy Driver Files(Which Copies the product files)

·         Database Driver Files(Which changes the database objects)

·         Generate Driver Files(Which generates forms, graphics, messages and new objects)

Nowadays most Patches contains one unified driver (where all driver files are placed in a single unit)

More info about C,D,G and U drivers,

• Copy driver (c driver): Named c.drv, and contains commands to change Oracle Applications files. The commands include directives to copy/update files, libraries, and/or Java, and commands for generating JAR files and relink C executables. In a multi-node system, run it on all application tier APPL_TOPs. It does not make use of FND_INSTALL_PROCESSSES

• Database driver (d driver):
Named d.drv, and contains commands to change Oracle Applications database objects, such as PL/SQL and table definitions, or to update or migrate data. In a multi-node system, run it only on the application tier APPL_TOP that implements the admin server. It does make use of FND_INSTALL_PROCESSSES

• Generate driver (g driver): Named g.drv, and contains commands to generate forms, reports, and/or graphics files. In a multi-node system, run it on all application tier APPL_TOPs, unless the APPL_TOP only implements the admin server. It does make use of FND_INSTALL_PROCESSSES

• Unified driver (u driver): Named u.drv, it is a consolidated driver containing all copy, database, and generate actions. Apply this driver to all APPL_TOPs on all application tier servers. AutoPatch knows which command should be run on each type of application tier. The unified driver requires only a single execution of AutoPatch. It is currently used only in the Release 11.5.9 Maintenance Pack.It does make use of FND_INSTALL_PROCESSSES

If you merge a patch that contains a unified driver with patches that contain other drivers, the resulting merged patch will contain only a merged unified driver.



Ø  Replacement Files

These files are listed in the copy driver which replaces the outdated forms, reports, html files, sql scripts, object modules with newer versions of files.



Ø  Metadata Files

This contains a list of files included in this patch and the relationship between this patch and other patches. The information in this patch helps you to determine the pre-requisites patches and analyze the impact of patches in this system.


How the patches are applied in EBS ?
Patches in Oracle Applications are applied using the patch utilities.
Patching Utilities:-

1. Auto Patch(adpatch)

2. AD Merge Patch

3. Patch Wizard


Number of Parallel Workers
--------------------------


By default, AutoPatch runs database updates and file generation commands in parallel and prompts you for the number of workers. Tasks are assigned to workers, the workers run the tasks to completion, and AutoPatch assigns new tasks.

The default value for the number of workers is two times the number of CPUs on the node from which you run AutoPatch. Oracle recommends specifying the number of workers as between two and four times the number of CPUs.

Backup Directory

----------------
When AutoPatch runs, a backup directory is created in the directory where you unzip the patch. The old version of each file updated by the patch is copied into the backup directory. When applying large patches (such as release update packs, product family RUPs, and pre-upgrade patches), ensure there is enough disk space on the system where you unzip the patch, or the patching process may fail. We recommend having at least twice the amount of disk space as the unzipped patch file uses.

Tip: Periodically, you can delete the files in the backup directory to free the space.


1.ADPATCH:

----------
When ever applying an application patch, always must should follow the Readme.txt or Readme.html file. And always advised to first test the patches on Test Environment, then go for production Environment.

Step 1: Download the patch to your pc and transfer it to Linux server
login to oracle metalink. (www.metalink.oracle.com)
Select the patches option then select the search type.

Search for patch by writing the patch no. & platform on which you want to download the patch.
Click download.
If you have downloaded the patch at desktop then transfer it to Linux server by using Winscp or any other software.

Note:

Here, you can download the patch and put in any directory.
Unzip the patch.

But while running adpatch it will ask like below path where we need to provide the patch location:

Enter the directory where your Oracle Applications patch has been unloaded

The default directory is [/proxy/ebs/uat01/apps/apps_st/appl/ad/12.0.0/bin] : /<patch directory>

Note: To run the adadmin we need to go adadmin directory. If you are not sure ten you can use below command as:
$ which adadmin
$APPL_TOP/ad/12.0.0/bin/adadmin

Same way if you want to run adpatch then we need to go adpatch directory. If you are not sure then you can use below command as:
$ which adpatch
$APPL_TOP/ad/12.0.0/bin/adpatch

In below example, we are putting patches in same location at adpatch.



Step 2: Unzip the patch. And set the permission

$pwd
/opt/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin

$ unzip p9501440_R12.XDO.B_R12_GENERIC.zip

$ chmod 755 9501440


Step 3: Before applying a patch you must check whether the patch is already applied or not and check for number/list of invalid objects. For this we query the database:

[root@r12 ~]# su - oracle
$ sqlplus apps/*****

SQL> select * from AD_BUGS where bug_number='<patch number>';

For Example:
SQL> select * from AD_BUGS where bug_number='9501440';
no rows selected

Check for INVALID objects.

SQL>Select count(*) from dba_objects where status='INVALID';
SQL> select owner,OBJECT_NAME,OBJECT_TYPE,STATUS from dba_objects where STATUS='INVALID';

Step 4: Run the environment variable for application on Application Tier.

$ cd /opt/oracle/VIS/apps/apps_st/appl/
$. ./APPSVIS_r12.env

Step 5: Stop the application with adstpall.sh utility. We are stopping applications because we are not using Hot Patch.

(Please Note: Database and Listener should be up because while appying patch it will update tables)

$ pwd
/opt/oracle/VIS/inst/apps/VIS_r12/admin/scripts

$ ./adstpall.sh apps/*****


Step 6: Enable the Maintenance Mode

Before you initiate an AutoPatch session, you must shut down the Workflow Business Events System and set up function security so that no Oracle E-Business Suite functions are available to users. This ensures optimal performance and reduces downtime when applying a patch. Maintenance mode provides a clear separation between normal runtime operation of Oracle E-Business Suite and system downtime for maintenance.
During a Maintenance mode downtime, user login is restricted. Users are redirected to a system downtime URL, which informs them that the maintenance session is in progress. The Oracle Applications Manager (OAM) Maintenance Mode page allows you to schedule system downtime and send alert messages to notify users of the downtime schedule.
To enable or disable Maintenance mode, use the Change Maintenance Mode menu in AD Administration. See: Changing Maintenance Mode, Oracle E-Business Suite Maintenance Utilities.

Caution: You can run AutoPatch by using options=hotpatch on the command line when Maintenance mode is disabled. However, applying a 'hot patch' may result in significant degradation of system performance. For more information, see AutoPatch Options.

$ pwd
/opt/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin
$./adadmin

* Provide patch log file name as:
Filename [admin.log]: patchnumber.log

* Batchsize leav it as default, hit enter.
Batchsize [1000]:

* Enter the password for SYSTEM, and then apps password.
By Default System and Apps password is as shown below:

Enter the password for your 'SYSTEM' ORACLE schema: manager
Enter the ORACLE password of Application Object Library [APPS]: apps
1. Generate Applications Files menu

2. Maintain Applications Files menu

3. Compile/Reload Applications Database Entities menu

4. Maintain Applications Database Entities menu

5. Change Maintenance Mode

6. Exit AD Administration

* Select an option 5 and press enter key to Change Maintenance Mode.

* Then, Select an option 1 and press enter to Enable Maintenance Mode.

* Press enter to continue.

* Select option 3 and press Enter key to return to main menu .

* Press enter to Exit AD Administration

Step 7: Run autopatch (adpatch) from the patch directory by entering the following command:

$pwd
/opt/oracle/VIS/apps/apps_st/appl/ad/12.0.0/bin

$ ls -l adpatch
-rwxrwxrwx 1 oracle oinstall 9380 Mar 31  2009 adpatch
$./adpatch


After applying successfully patch disable the Maintenance mode as below.

Step 8: Disabling maintenance mode.

The disabling steps are just same as enabling maintenance mode as shown above steps only the thing is you have to select 2 options to Disable maintenance Mode.
After running



./adadmin read carefully options and choose as 5->2->3->6.

5--> Change maintenance mode.
2--> Disable  maintenance mode.
3--> Return to Main Menu.
6--> Exit AD Administration.

Step 9: After disabling the Maintenance Mode, we need to start the services.

$cd $ADMIN_SCRIPTS_HOME

$./adstrtal.sh apps/<apps_pwd>

After checking all the services from backend like:
$ps –ef|grep applmgr |wc –l
Or
$ps –ef|grep FNDLIBR
Or
$ps –ef|grep FND*

Once all the services are UP and Running.

Step 10: Check for Number of Invalid Objects from below command:

SQL>Select count(*) from dba_objects where status='INVALID';

SQL> select owner,OBJECT_NAME,OBJECT_TYPE,STATUS from dba_objects where STATUS='INVALID';

If there is any new invalid objects then need to recompile.

Then does the front-end sanity check such as checking all the Concurrent Manager’s status and Submit a request.


Log Files:

In addition to the main log file (adpatch.log), AutoPatch also creates several other log files for specific purposes, for example, to record all the actions associated with parallel workers. The log files are written to $APPL_TOP/admin/<SID>/log (UNIX), where <SID> is the value of your ORACLE_SID or TWO_TASK variable, or in %APPL_TOP%\admin\<SID>\log (Windows), where <SID> is the value of ORACLE_SID or LOCAL. Review these files when the AutoPatch session is complete.

The log directory contains adpatch.log and adpatch.lgi, and may contain one or more additional files as described in the following table.

Log Files
-------------------------------------------------------
Log File Used For
adpatch.log Main AutoPatch log file (default name)
adpatch.lgi AutoPatch informational messages (default name)
adrelink.log Relinking
adlibin.log Moving C object files into the C library of a product
adlibout.log Moving C object files out of the C library of a product
adworkxxx.log Database operations run in parallel
<language>_<filename>_ldt.log Seed data loader files

Sunday, March 24, 2019

Oracle E-Business Suite R12.2 Architecture

 This chapter describes the Oracle E-Business Suite architecture and the key features the architecture supports, plus some related points. Topics include:

Let's begin the topic .
Generally Oracle E-Business suite architecture or Machine can be divided into 3 parts or technically we can call it as "Tier" i.e. 3 Tier Architecture .
Various servers or services are distributed among three Tiers .
      
                  1.  
The Client (Desktop) Tier.
                  2.  The Application Tier.
                  3.  The Database Tier.

5. The Oracle E-Business Suite Technology Layer
6. Oracle Configuration Manager
7. Oracle E-Business Suite Patch Nomenclature in


Before going to the Architecture let's have a look on few technical words i.e. Server or Services ,Tier, Machine.

Server :
A server (or services) is a process or group of processes that runs on a single machine and provides a particular functionality. For example, Web services process HTTP requests, and Forms services process requests for activities related to Oracle Forms. The Concurrent Processing server supports data-intensive programs that run in the background.

Tier :

A tier is a logical grouping of services, potentially spread across more than one physical machine. The three-tier architecture that comprises an Oracle E-Business Suite installation is made up of the database tier, which supports and manages the Oracle database; the Application Tier ,which supports and manages the various Oracle E-Business Suite components, and is sometimes known as the middle tier; and the Client Tier (Desktop), which provides the user interface via an add-on component to a standard web browser.

Machine : 

A machine may be referred to as a node, particularly in the context of a group of computers that work closely together in a cluster. Each tier may consist of one or more nodes, and each node can potentially accommodate more than one tier. For example, the database can reside on the same node as one or more application tier components. Note, however, that a node is also a software concept, referring to a logical grouping of servers.

Centralizing the Oracle E-Business Suite software on the application tier eliminates the need to install and maintain application software on each client PC, and also enables Oracle E-Business Suite to scale well with an increasing load. Extending this concept further, one of the key benefits of using the Shared Application Tier File system Model (Originally Shared APPL_TOP) is the need to maintain only a single copy of the relevant Oracle E-Business Suite code, instead of a copy for every application tier machine. 

On the database tier, there is increasing use of Oracle RAC , where multiple nodes support a single database instance to give greater availability and scalability.


Oracle E-Business Suite Three-Tier Architect
Picture
The connection between the application tier and the client tier can operate successfully over a Wide Area Network (WAN). This is because the client and application tiers exchange a minimum amount of information, for example only field values that have changed. In a global operation with users at diverse locations, requiring less network traffic reduces telecommunications costs and improves response times.

1.  The Client (Desktop) Tier.

The client interface is provided through HTML for the large number of HTML-based applications, and via Java applets for the smaller number of Forms-based applications and a few product specific features.

Note: The client tier is sometimes referred to as the Desktop Tier :

Client Tier and Application Tier Components
​​
Picture

​​You log in via the Oracle E-Business Suite Home Page on a desktop client web browser. The Home Page provides a single point of access to HTML-based applications, Forms-based applications, and Business Intelligence applications.

Once successfully logged in via the E-Business Suite Home Page, you are not prompted for your user name and password again, even if you navigate to other tools and products. Oracle E-Business Suite also retains preferences as you navigate through the system. For example, if you registered in the Home Page that German is your preferred language, this preference carries over whether you access Forms-based or HTML-based applications.


Forms Client Applet:

The Forms client applet is a general-purpose presentation applet that supports all Oracle E-Business Suite Forms-based products, including those with customizations and extensions. The Forms client applet is packaged as a collection of Java Archive (JAR) files. The JAR files contain all Java classes required to run the presentation layer of Oracle E-Business Suite forms.

Desktop Java Runtime Environment:

The Forms client applet must run within a Java Virtual Machine (JVM) on the desktop client. It is launched on the user's desktop using a Java Deployment technology, either Java Web Start or Java Plug-in. These are included as part of the Java Runtime Environment (JRE) software. Java Deployment technologies require the JRE software to be installed on the client, so that Java-based applications can run on it. After you download and install the JRE software, you will be able to run Forms-based applications .


The Forms client applet and commonly used JAR files are downloaded from the Web server at the beginning of the client's first session. Less commonly used JAR files are downloaded as needed. All downloaded JAR files are cached locally on the client, ready for future sessions. This eliminates the network traffic that would be involved in downloading them whenever they were required.


Java Web Start:

Java Web Start launches Oracle E-Business Suite Java-based functionality as Java Web Start applications instead of as Java applets. Java Web Start is a Java Deployment technology that is installed as part of the Java Runtime Environment (JRE) software. It provides a browser-independent architecture for deploying Java technology-based applications to the client desktop, and is the recommended configuration for Oracle E-Business Suite.

Java Plug-in:

​Running Oracle E-Business Suite's Java-based content using the Java Plug-in requires a browser that supports Netscape Plug-in Application Programming Interface (NPAPI) plug-ins. Most browsers have now phased out NPAPI plug-in support, preventing he Java Plug-in from working. Oracle E-Business Suite supports launching Java applets (such as the Forms applet) using the Java Plug-in for browsers that support it.

2.  The Application Tier.


The Application tier is the combination of various servers or services groups that process the business logic. And managing communication between the desktop tier and the database tier. This tier is sometimes still referred to as the Middle Tier.

   The Application Tier is the combination of Oracle Application server and Concurrent Manger server. 
You can verify above "Client Tier and Application Tier Components
​​" Diagram for Application Tier components .


Application Tier ORACLE_HOMEs in Release 12.2:

Oracle E-Business Suite Release 12.2 uses two application tier ORACLE_HOMEs.
  • 1.  An OracleAS 10.1.2 ORACLE_HOME that was used in previous 12.x releases.
  • 2. An Oracle Fusion Middleware (FMW) ORACLE_HOME that supports Oracle WebLogic Server (WLS) and supersedes the Java (OracleAS 10.1.3) ORACLE_HOME that was used in previous releases.
The use of these two ORACLE_HOMEs enables Oracle E-Business Suite to take advantage of the latest Oracle technologies.

Application Tier Structure:
Picture
​Notable features of this architecture include:
  • The Oracle E-Business Suite modules (packaged in the file formsapp.ear) are deployed out of the OracleAS 10.1.2 ORACLE_HOME, and the frmweb executable is also invoked out of this ORACLE_HOME.
  • All major services are started out of the Fusion Middleware ORACLE_HOME.
Key changes from earlier releases include:
  • The Oracle Application Server 10.1.2 ORACLE_HOME (sometimes referred to as the Tools, C, or Developer ORACLE_HOME) replaces the 8.0.6 ORACLE_HOME provided by Oracle9i Application Server 1.0.2.2.2 in Release 11i.
  • The FMW ORACLE_HOME (sometimes referred to as the Web or Java ORACLE_HOME) replaces the OracleAS 10.1.3.-based ORACLE_HOME used in Oracle E-Business Suite 12.x releases prior to 12.2.
Web Services

The Web services component of Oracle Application Server processes requests received over the network from the desktop clients, and includes the following major components:
  • Web Listener (Oracle HTTP Server powered by Apache)
  • Java Servlet Engine (Oracle WebLogic Server, WLS)
The Web listener component of the Oracle HTTP server accepts incoming HTTP requests (for particular URLs) from client browsers, and routes the requests to WLS.
If possible, the Web server services the requests itself, for example by returning the HTML to construct a simple Web page. If the page referenced by the URL needs advanced processing, the listener passes the request on to the Servlet Engine, which contacts the database server as needed.

Note: Oracle WebLogic Server integration is new in Release 12.2.

Generally we will get Two types of Application Requests from Client Tier.

i.e. 1. HTML Based Application Requests.
​      2. Form Based Application Requests.


Let's Have a look at How HTML requests will be processed.


1. HTML Based Application Requests:

The Oracle HTML-based applications (originally known as Self-Service applications) add a browser-based, walk-up-and-use functionality to Oracle E-Business Suite. They include numerous products such as Self-Service Expenses, Self-Service Human Resources, Internet Procurement, Internet Receivables, Self-Service Time, Web Suppliers, iStore, iPayment, iSupport, and marketing, and have the following characteristics:
  • Do not use Oracle Forms for the interface
  • Use HTML documents, JavaScript, Java Server Pages, JavaBeans, and Servlets
  • Dynamically generate HTML pages by executing Java code
  • Use a metadata dictionary for flexible layout
  • Operate via a direct connection to the Web server
The Oracle HTML-based applications can be either inquiry or transactional. Inquiry modules only read the Oracle E-Business Suite database. In contrast, transactional modules both read and update the database.

The Oracle Application Framework is the development platform for HTML-based applications. It consists of a Java-based application tier framework and associated services, designed to facilitate the rapid deployment of HTML-based applications.

Notable Oracle Application Framework components include:


  • Business Components for Java (BC4J),included in Oracle JDeveloper, is used to create Java business components for representing business logic. It also provides a mechanism for mapping relational tables to Java objects, and allows the separation of the application business logic from the user interface.
  • Oracle Weblogic server supplies the Oracle Application Framework with underlying security and applications Java services. It provides the Oracle Application Framework with its connection to the database, and with application-specific functionality such as flex fields.
The Framework-based applications logic is controlled by procedures that execute through the Java servlet engine, which is provided by the Apache JServ module. The servlet engine uses the metadata dictionary in constructing the Framework UI.

HTML-Based Applications Architecture:
Picture
​Java Servlet Access with HTML-Based Applications:

An HTML-based Applications module uses the following access path:
  1. The user clicks the hyperlink of a function from a browser.
  2. The browser makes a URL request to the Web listener.
  3. The Web listener contacts the Servlet engine (Oracle WebLogic Server), where it runs a JSP.
  4. The JSP obtains the content from the Oracle E-Business Suite tables and uses information from the metadata dictionary to construct the HTML page.
  5. The resulting HTML page is passed back to the browser, via the Web server.

Oracle Application Framework Architecture:
Picture
​Oracle Application Framework Processing Details:

The following is a more detailed explanation of how the JSP obtains the content from the Oracle E-Business Suite tables and uses information from the metadata dictionary to construct the HTML page.
  1. Oracle WebLogic Server validates user access to the page.
  2. The page definition (metadata UI definition) is loaded from the metadata repository on the database tier into the application tier.
  3. The BC4J objects that contain the application logic and access the database are instantiated.
  4. The Java Controller programmatically manipulates the page definition as necessary, based on dynamic UI rules.
  5. UIX (HTML UI Generator) interprets the page definition, creates the corresponding HTML in accordance with UI standards, and sends the page to the browser.
2. Form Based Application Requests:

​By default, Forms services in Oracle E-Business Suite Release 12.2 are provided by the Forms listener servlet, which, as described further below, facilitates the use of firewalls, load balancing, proxies, and other networking options.

Benefits of using the Forms listener servlet include:
  • Ability to re-establish dropped network connections
  • Fewer machines and ports need to be exposed at the firewall
  • Easier firewall/proxy server configuration
  • More robust and secure deployment over the Internet

Forms Listener Servlet Architecture

The Forms listener servlet is a Java servlet that delivers the ability to run Oracle Forms applications over HTTP or HTTPS connections. It hosts the Oracle E-Business Suite forms and associated runtime engine, mediating the communication between the desktop client and the Oracle database server, displaying client screens, and initiating changes in the database according to user actions.

The Forms listener servlet caches data and provides it to the client as needed, for example when scrolling through multiple order lines that exceed the limitations of a single screen.
The Forms listener servlet can communicate with the desktop client using either a standard HTTP network connection or secure HTTPS network connection. In contrast, Forms services (formerly known as Forms server) communicates with the desktop client using the TCP/IP network protocol, on top of which it layers its own protocol.

The Forms listener servlet communicates with the Oracle database server using the Oracle Net networking infrastructure.

The Forms listener servlet manages the creation of a Forms runtime process for each client, as well as network communications between the client and its associated Forms runtime process. The client sends HTTP requests and receives HTTP responses from the Web services, which acts as the network endpoint for the client.


​Forms Socket Mode Architecture

In the traditional Forms server socket mode architecture, when a user initiates an action in the Forms client applet (such as entering data into a field or clicking a button), data is passed to a Forms server on the application tier. The user interface logic runs in the Forms server, and determines the appropriate user interface effect based on the user's action. For example, a window may open, or another field value may be populated. If necessary, the database tier is contacted for any data not already cached on the application tier, or for data-intensive processing.

Forms Socket Mode Architecture:
Picture
​Once a connection has been made, many operations can be performed with little or no further interaction with the Forms server. For example, when a few field values change in response to a user action, there is no need to update the entire screen. In this scenario, only the changed fields are updated with the new values.

Choice of Mode

As stated, by default Oracle E-Business Suite Release 12.2 utilizes Forms listener servlet mode. However, socket mode is still supported, and may be useful in high-latency, bandwidth-constrained WAN environments.


Concurrent Processing Server:

Concurrent Processing is an Oracle E-Business Suite feature that allows these non–interactive and potentially long-running functions to be executed efficiently alongside interactive operations. It uses operating system facilities to enable background scheduling of data- or resource-intensive jobs, via a set of programs and forms. To ensure that resource-intensive concurrent processing operations do not interfere with interactive operations, they are run by a specialized component , the Concurrent Processing Server. 

Concurrent Processing Server Implementation:

The server is located on the Oracle E-Business Suite application tier, and implemented via the Batch Processing Services Service Group. 


Concurrent Requests and Managers:

Processes that run on the Concurrent Processing server are called Concurrent Requests . When you submit such a request, either through HTML-based or Forms-based applications, a row is inserted into a database table specifying the program to be run. Concurrent Manager then reads the applicable requests in the table, and starts the associated concurrent program.

Concurrent Manager Location:

Traditionally, the concurrent managers were installed on the same machine as the database. However, with the much faster local networks that are now common, and the typical co-location of database and application tier machines, it is generally preferable to run them on a separate machine. This greatly facilitates ease of management and maintenance, as well as providing deployment flexibility.


Specialist Concurrent Managers:

There are a number of specialized concurrent managers.

The Internal Concurrent Manager (ICM): Controls all other concurrent managers. It administers the startup and shutdown of managers as defined by their work shift, monitors for process failure, and cleans up if a failure occurs. The ICM does not process concurrent requests itself (except for queue control requests, such as ACTIVATE, DEACTIVATE, or ABORT).
While the basic ICM definition should not be changed, you can if required modify the sleep Time (number of seconds the ICM waits between checking for new concurrent requests),
PMON (Process Monitor) cycle time  (number of sleep cycles the ICM waits between checking for failed workers), and Queue Size (duration between checks for number of active workers, measured in PMON cycles). If Parallel Concurrent Processing (described below) is being used, you can also set some options for this.

The Conflict Resolution Manager (CRM):Enforces rules designed to ensure that incompatible concurrent requests do not run in the same Conflict Domain (an abstract representation of the groupings used to partition data). As with the Internal Concurrent Manager, the basic CRM definition should not be changed, but you can modify the sleep time for each work shift, as well as some Parallel Concurrent Processing options.

The Standard Manager: As shipped with Oracle E-Business Suite will accept and run any concurrent requests, as it has no specialization rules that would restrict its activities. Consequently, the definition of the Standard Manager should not be altered without careful planning, otherwise some programs might not be able to run at all. Jobs should only be excluded from the Standard Manager after ensuring they can be run by an alternative manager, such as a product-specific manager or user-defined manager.

Transaction Manager: Support synchronous request processing, whereby a pool of server processes responds to requests from client programs. Instead of polling the concurrent requests table to obtain instructions, a transaction manager waits to be signaled by a client. An example is approval of an order, where execution of the request must take place quickly.

The relevant transaction manager program runs on the server, transparently to the client. All transaction programs for a given manager process run in the same database session. Communication between the client and the server is conducted synchronously via Advanced Queueing. At the end of program execution, the client program receives a completion message and a return value, for example denoting approval of the order. This strategy of using non-persistent connections between the client and Transaction Manager processes enables a small pool of server processes to service a large number of clients with near real-time response.



Concurrent Processing Architecture

In Concurrent Processing, programs are run as operating system background processes. These programs may be written using a variety of Oracle tools, programming languages for executables, or the host operating system scripting language.

As noted above, a concurrent program that runs in the concurrent manager's own operating system process is known as an immediate program. Immediate programs run as a function within the concurrent manager's program library.
Examples include PL/SQL programs. In contrast, a concurrent program that runs in a child process of the concurrent manager process is known as a Spawned Program . Examples include SQL programs, SQL Loader programs, Oracle Reports programs, spawned C programs, and host language programs such as UNIX shell scripts or Windows command files.

All reports are run through the Concurrent Processing server manager via the rwrun executable, which spawns an in-process server. This is in contrast to earlier releases of Oracle E-Business Suite, which used the now-obsolete Reports server.

While C programs can be run as immediate programs, it is advisable to run them as spawned programs. This simplifies maintenance, without introducing any disadvantages.
A concurrent request has a life cycle, which consists of three or possibly four phases.


A Concurrent Program Library  contains concurrent programs that can be called by a concurrent manager. An important example is the Oracle Application Object Library program library (FNDLIBR), which contains Oracle E-Business Suite immediate concurrent programs, and is assigned to the standard concurrent manager. Although each concurrent manager can only run immediate concurrent programs from its own concurrent program library, it can also run spawned or Oracle tool concurrent programs.


Concurrent Processing Database Tables:


Table :                                           Content:
                                      
FND_CONCURRENT_REQUESTS:   Details of user requests, including status, start date, and                                                                     Completion date.

FND_CONCURRENT_PROGRAMS:  Details of concurrent programs, including execution method,                                                              Whether the Program is constrained, and whether it must be                                                                 run alone.

FND_CONCURRENT_PROCESSES : Cross-references between concurrent requests and queues,                                                                 and  a history of  concurrent manager processes.

FND_CONCURRENT_QUEUES:        Information about each of the concurrent manager queues.



See my previous post for status codes and phases
https://nareshnadhans.weebly.com/home/concurrent-request-status-codes-and-phase-codes


Caution: Do not update these tables manually. You can (subject to your organization's archiving requirements) periodically run the "Purge Concurrent Requests and/or manager data" program to prevent these tables growing too large

​Concurrent Processing Operations:

Because the Internal Concurrent Manager controls all the other managers, it must be running before any other manager can be activated. Once the ICM has been activated, it starts a Service Manager on each node that is enabled for concurrent processing. Acting as an agent of the ICM, the Service Manager starts the concurrent managers on its node, excluding any managers that have been deactivated, or that have no current work shift. The ICM can be activated and deactivated from the operating system prompt, or Oracle Applications Manager. It can also be deactivated (but not activated) from the Administer Concurrent Managers form.
When the ICM is initiated on UNIX, the $FND_TOP/bin/startmgr program is invoked. This calls $FND_TOP/bin/batchmgr, which then 
Starts a shell process.

  1. Starts the ICM process using the command FNDLIBR, with startup parameters FND, CPMGR, and FNDCPMBR.
  2. Creates log files (std.mgr and wnnn.mgr) in $APPLCSF/$APPLLOG.
Normally, startmgr is run by the user account that owns the application software (for example, applmgr). This account must have write privileges to the log and out directories where the log and output files respectively are written.

The ICM starts up a Service Manager on each node that is enabled for concurrent processing, by instructing the node's Applications Listener (which is dedicated to Concurrent Processing) to spawn a process running the Service Manager executable (FNDSM). The Applications Listener must be configured to source the Oracle E-Business Suite environment file before FNDSM is spawned. Following startup, the Service Manager acts as an agent of the ICM to start and stop concurrent managers on that node, according to their defined work shifts.

Note: The Service Manager is a component of the Generic Service Management (GSM) architecture rather than Concurrent Processing, although GSM and Concurrent Processing are closely integrated.
Concurrent manager processes on a specific node can be seen by running the UNIX commands:


ps -ef | grep FNDLIBR
ps -ef | grep FNDSM

The Service Manager PID seen in the output of the second command can then, if desired, be used to locate all concurrent manager and service processes on the node, since the Service Manager is the parent process for them:


ps -ef | grep <sm_pid>

​On Windows, the Task Manager can be used to locate concurrent manager processes. An FNDLIBR process runs for the Internal Concurrent Manager and each standard manager. The ICM can be distinguished by additional details being displayed, including some of the parameters it was started with.
For every process that was successfully started at operating system level, the ICM inserts a row into FND_CONCURRENT_PROCESSES. It then updates the RUNNING_PROCESSES column to reflect the actual running processes as shown in FND_CONCURRENT_QUEUES.


​Viewing Concurrent Processing Output:

The output from a concurrent processing job goes through several stages before being displayed to the user.
  1. The Concurrent Processing server communicates with the database server via Oracle Net.
  2. The log or output file associated with a concurrent request is passed back to the Report REview Agent  also known as the Web Review Agent.
  3. The Report Review Agent passes a file containing the entire report to the Forms services.
  4. The Forms services pass the report back to the user's browser one page at a time.
Viewing Concurrent Processing Output:
Picture
Parallel Concurrent Processing:

(PCP) allows concurrent processing activities to be distributed across multiple nodes in an Oracle Real Application Clusters (Oracle RAC) environment or similar cluster system. By distributing concurrent processing in this way, hardware resources can be fully utilized, maximizing throughput and providing resilience to node failure, while retaining a central point of control.
Parallel Concurrent Processing enables you to:
  • Run concurrent processes on multiple nodes to improve concurrent processing throughput
  • Continue running concurrent processes on the remaining nodes when one or more nodes fail
  • Administer concurrent managers running on multiple nodes from any node in the cluster
One or more concurrent managers can be specified to run on one or more nodes, to best suit your processing needs and fully utilize available hardware resources.
Parallel Concurrent Processing is enabled by default, so PCP is always available for use in environments where one or more concurrent processing nodes exist.

Note: PCP does not require an Oracle RAC environment. Conversely, you do not have to use PCP in an Oracle RAC environment, although it typically makes sense to do so.

Managing Concurrent Processing :

From the command line, two commands can be entered to control the Internal Concurrent Manager: startmgr, which starts the ICM; and concsub, which is used to stop or abort the ICM, or request the ICM to check on the operating system process for each manager. In addition, an AutoConfig-enabled environment provides a number of scripts for starting and stopping application tier services from the command line.
startup and shutdown script  INST_TOP/admin/scripts/adcmctl.sh.


The various components of the concurrent processing system can be managed from various forms, such as Concurrent Manager: Administer, or from Concurrent Managers or Concurrt Requests under Oracle Applications Manager (OAM).

ORACLE DATABASE CONTENT

ORACLE DATABASE 11gR2 & 12C  CONTENT Pre-Requisite: UNIX, SQL Basics Introduction to Oracle Database §   Introduction of Database ...