Monday, December 16, 2019

Restore Database from RMAN backups

Restore the database from production backup

Start the database nomount stage

sqlplus / as sysdba

SQL> startup nomount pfile=’<location>/initPROD.ora’;


rman target /

RMAN>restore controlfile from '/u02/prod_backup/prod_Control_Copy.ctl';

RMAN>alter database mount;

RMAN>catalog start with '/u02/prod_backup/';

RMAN>CONFIGURE CHANNEL DEVICE TYPE DISK clear; - This will clear the disk type from production RMAN configurations

RMAN>restore database preview;



Restoration Script:

run {

set newname for database to '/u01/oracle/test/db/data/%U';

set until scn 8854465393;

restore database;

SWITCH DATAFILE ALL;

recover database;

}

Rename the redo log files:

alter database rename file '/u01/oracle/prod/db/data/log05.dbf' to '/u01/oracle/test/db/data/log01.log';

alter database rename file '/u01/oracle/prod/db/data/log06.dbf' to '/u01/oracle/test/db/data/log02.log';

alter database rename file '/u01/oracle/prod/db/data/log07.dbf' to '/u01/oracle/test/db/data/log03.log';

alter database rename file '/u01/oracle/prod/db/data/log08.dbf' to '/u01/oracle/test/db/data/log04.log';


alter database clear unarchived logfile group 8;

Rename the tempfile:

alter database rename file '/u01/oracle/prod/db/data/temp01.dbf' to '/u01/oracle/test/db/data/temp01.dbf';

Create pfile

Change the database name to TEST

$nid target=sys/<sys_password> dbname=TEST

Rename the pfile to initTEST.ora

Change the database name to TEST

Start the database in nomount and create spfile.

Bounce the database

Saturday, December 14, 2019

ADOP Phases


Daily Used Queries


To delete old / unused files:
find /u01/inst/apps/QAT/logs/appl/conc/out -type f -mtime +30 -exec rm -f {} \;    --To delete files older than 30 days
find /path/to/ -type f -mtime +7 -name '*.gz' -execdir rm -- '{}' \;                        --To delete gzip files older than 7days
find . -mtime +10 -print -exec gzip {} \;   --for gzip files                                       --To gzip files older than 10days
find . -mtime +10 | xargs  tar -czvPf  trace_log_$(date +%F).tar.gz                       --To tar files older than 10days
find . -type f -mtime +30 -exec rm -f {} \;                                                           --To remove files older than 30days
delete noprompt archivelog until time 'SYSDATE-15';                                         -- To remove archives from rman older than 15days

To check Inactive / Blocking sessions
select sid,serial#,username,status,schemaname,logon_time from v$session where status='INACTIVE' and username is not null;

select distinct vlock.id1,decode(vlock.request,0,'Holder','Waiter') Type,vses.client_identifier,vses.sid,vses.serial#,vses.inst_id,vses.status,round(vses.last_call_et/60) mins,vses.event,vses.module,vses.sql_id,vses.machine,vses.row_wait_obj#
from gv$session vses, gv$lock vlock
where vlock.sid=vses.sid and vlock.inst_id=vses.inst_id
and (vlock.id1,vlock.id2,vlock.type) in (select id1, id2, type from gv$lock where request>0)
and vlock.ctime/60 > 5
order by id1 ;


To Drop a User who is connected:
DECLARE
  v_user_exists NUMBER;
  user_name CONSTANT varchar2(20) := 'XXEIS';
BEGIN
  LOOP
    -- Kill any currently active sessions
    FOR c IN (SELECT s.sid, s.serial# FROM v$session s WHERE upper(s.username) = user_name)
    LOOP
      EXECUTE IMMEDIATE
        'alter system kill session ''' || c.sid || ',' || c.serial# || ''' IMMEDIATE';
    END LOOP;
    -- Try to drop the user.
    BEGIN
      EXECUTE IMMEDIATE 'drop user ' || user_name || ' cascade';
      EXCEPTION WHEN OTHERS THEN
      IF (SQLCODE = -1940) THEN
        -- Ignore ORA-01940 'Cannot drop user that is currently connected' exception
        NULL;
      ELSE
        RAISE;
      END IF;
    END;
    -- Continue looping, killing sessions and retrying to drop until successful
    BEGIN
      SELECT COUNT(*) INTO v_user_exists FROM dba_users WHERE username = user_name;
      EXIT WHEN v_user_exists = 0;
    END;
  END LOOP;
END;
/

To Get error from the files:
egrep -i "PLS-|ORA-|unab-|Unab-|Error-" *.log

grep -iE "ORA-|Error-|Unab-"  filename

Data Pump:
CREATE DIRECTORY XXSBIWFA AS '/u02/XXSBIWFA';
select *from dba_directories;
GRANT  read,  write  ON  DIRECTORY  XXSBIWFA  TO  XXSBIWFA;
GRANT  DATAPUMP_EXP_FULL_DATABASE  TO  hr;
GRANT  read,  write  ON  DIRECTORY  SBI_DIR  TO  XXEBS;
expdp \"/ as sysdba\" schemas=XXOCA_M directory=XXOCA_M_EXP dumpfile=XXOCA_M.dmp logfile=XXOCA_M.log
expdp XXSBIWFA/XXSBIWFA schemas=XXSBIWFA directory=XXSBIWFA dumpfile=XXSBIWFA3rdSep.dmp logfile=expdp_XXSBIWFA.log
impdp \'/ AS SYSDBA\' remap_schema=XXSBIWFA:XXSBIWFA2 dumpfile=XXSBIWFA3rdSep.dmp directory=XXSBIWFA  logfile=XXSBIWFAimp.log
select *from tab;

To Compile Invalid Objects:
select owner,object_name,object_type,status from dba_objects where STATUS='INVALID' and OWNER='XXSBIWFA';
EXEC DBMS_UTILITY.compile_schema(schema => 'XXSBIWFA2');
 @/u01/DEMO2_DB/db/tech_st/11.2.0/rdbms/admin/utlrp.sql
SELECT COUNT (*) FROM ALL_OBJECT WHERE STATUS='INVALID' ;
exec DBMS_UTILITY.compile_schema(schema => 'XXEIS');
select object_name, object_type, owner from dba_objects where status='INVALID' and owner='XXSPLASH_STOWERSLST' ;
EXEC DBMS_UTILITY.compile_schema(schema => 'XXSPLASH_STOWERSLST') ;

To Check the Quota of Tablespace Size:
set linesize 300
set pagesize 300

select a.tablespace_name, b.total,
       c.available, d.large_extent,
       (b.total - c.available) used,
       round((((b.total - c.available)*100)/b.total),2) pctused
  from (select tablespace_name, (sum(bytes)/1024)/1024 total
          from dba_data_files group by tablespace_name)  b,
       (select tablespace_name,  nvl(round(((sum(bytes)/1024)/1024),2),0) available
          from dba_free_space group by tablespace_name)  c,
       (select tablespace_name, (max(bytes)/1024)/1024 large_extent
          from dba_free_space group by tablespace_name)  d,
       dba_tablespaces  a
where a.tablespace_name = b.tablespace_name(+)
   and a.tablespace_name = c.tablespace_name(+)
   and a.tablespace_name = d.tablespace_name(+)
/

 select default_tablespace from dba_users where username='XXWFAOCA';

select file_name,file_id,bytes/1024/1024/1024 from dba_data_files where tablespace_name='TEMP';

To get version of File name at OS Level
strings -a | grep '$Header' file_name
adident Header file_name

Convert Trace files with TKPROF
tkprof <trace_File>.trc <tkprof>.txt sys=no explain=apps/<apps pwd>

ADOP options in 12.2

ADOP Options in 12.2

ADOP stands for Application DBA Online Patching and this was introduced in EBS R12.2
This is new feature that we can able to patch running system without taking any down time for a significant period of time
ADOP uses dual file system to support online patching

If you want to know all the available options in ADOP, try below command
$adop -examples

To check the status of ADOP session
$adop -status

To get the list of log files along with the snippet of the error message corresponding to each log file try this command
$adopscanlog -latest=yes

Onlilne Patching Cycle: Consists of 5phases which needs to be execute in order.
Source the environment variable
adop phase=prepare
adop phase=apply patches=000000
adop phase=finalize
adop phase=cutover
source the environment variable
adop phase=cleanup



Also multiple phases can be executed in a single adop command
Example: adop phase=finalize,cutover,cleanup

Prior to cutover phase, it is possible to execute additional 'apply' and 'finalize' phases as needed.
Exaple: adop phase=prepare
        adop phase=apply patches=000000
adop phase=finalize
adop phase=apply patches=000000
adop phase=cutover
adop phase=cleanup

If you apply any patches after the finalize, you need to run the finalize again before cutover

Parameters applicable to all phases:

workers=<number> Number of parallel workers used to execute tasks. Default value is computed according to CPU cores.
Example: adop phase=prepare workers=8

prompt=(yes/no) [default:yes]
    This parameter specifies whether adop should prompt for user input on warnings.
By default adop will ask user whether to continue or exit on some warning messages. If this parameter is set to 'no' adop will remain fully non-iterative, and will continue past any warning messages without user confirmation.
Example: adop phase=cutover prompt=no

Prepare Parameters:
skipsyncerror=(yes/no) [default:no]
    This specifies whether to ignore errors that may occur during incremental file system synchronization. This might happen if you applied a patch in the previous patching cycle
Example: adop phase=prepare skipsyncerror=yes

Apply Parameters:

apply=(yes/no) [default:yes]
    This parameter controls adop acually applies the patch. In test environment we can use this parameter to complete the patch cycle without applying the patch
Example: adop phase=apply apply=no patches=000000

Apply two patches in series:
adop phase=apply patches=123456,987654

Apply patch to a user-specific directory
patchtop=<directory-name> [default:$PATCH_TOP]
Example: adop phase=apply patches=000000 patchtop=/u01/fs_ne/EBSapps/patches

apply_mode=(online/downtime/hotpatch) [default:online]
 Use online mode to apply a patch to the patch edition during an online patching cycle.
 Downtime mode to apply a patch to the run edition when services are down.
 Hotpatch mode to apply a patch to the run edition when services are up and running. [Use only when Oracle recommends]

Example: adop phase=apply patches=000000 apply_mode=downtime


adop phase=fs_clone
It will check for any pending cleanup actions
It will clone patch file system from run file system
It will check if there are any blocking managed server ports

Weblogic Server Upgrade from 12.2.1.2 to 12.2.1.3

Oracle WebLogic Server Upgrade from 12.2.1.2 to 12.2.1.3


Applies To: Oracle Fusion Middleware - Version 12.2.1.2.0

Information in this document applies to any platform.

Goal: Goal of this document is to upgrade WebLogic Server from 12.2.1.2 to 12.2.1.3


What's New in Oracle WebLogic Server 12c (12.2.1.3.0):

Feature

Description

Service Restart In Place

Service Restart In Place adds support for the ability to use any custom store with any migration policy.

Message limit in a JMS message subscription

WebLogic JMS adds a message limit option to help prevent individual overloaded subscriptions from using up all available resources

Security

New features include:

The WebLogic Security Service adds the secured production mode feature, which helps ensure a highly secure environment for applications and resources. See Support for Secured Production Mode.
A new security provider, Oracle Identity Cloud Integrator, that is an authentication and identity assertion provider that can access users, groups, and Oracle Identity Cloud Service scopes and application roles stored in the Oracle Identity Cloud Service.
Use of the SHA2 signature algorithm as the default for signing requests and responses. For backward compatibility, set the com.bea.common.security.saml2.useSHA1SigAlgorithm to true. 
By default, certificates that are expired or not yet valid are no longer used in SAML signing. To allow use of these certificates, set the com.bea.common.security.saml2.allowExpiredCerts to true.
Zero Downtime Patching

ZDT Patching adds support for modifying workflows using custom hooks.

Applied Patches List

Oracle WebLogic Server adds the ability to obtain a list of patches that have been applied to a server instance.

JDBC data sources

New features include:

Shared pooling for WebLogic data sources. Shared pooling provides the ability for multiple data source definitions to share an underlying connection pool.
Additional integration support for several new Oracle Database 12.2 features.
Initial Capacity Enhancement in the Connection Pool. WebLogic Server 12.2.1.3 enhances creation of initial capacity connections in a data source by providing control over connection retry, early failure, and critical resources.
JTA

WebLogic JTA adds transaction guard, which provides at-most-once execution during planned and unplanned outages and prevents duplicate submissions. See Transaction Guard.

Temporary Configuration Overriding

Temporary configuration overriding lets administrators place configuration information, contained in an XML file, in a known location where running servers identify and load it, overriding aspects of the existing configuration.

Apache Ant

This patch set release of WebLogic Server now includes Apache Ant 1.9.8, which may have an impact on the use of the clientgen Ant task. See Upgraded Version of Apache Ant in Upgrading Oracle WebLogic Server.

JEP 290

WebLogic Server uses the JDK JEP 290 mechanism to filter incoming serialization data and prevent denial of service (DOS) attacks. See JEP 290 Utilization.

Deprecated components

The following components are deprecated in this patch set and will be removed in a future release of WebLogic Server:

The following WebLogic JMS features and components:
·         WebLogic Replicated Store, which is intended solely for use in Oracle Exalogic Elastic Cloud environments

·         JMS resource adapter

·         WebLogic JMS Automatic Reconnect

·         WebLogic JMS Application Modules for Deployment

WebLogic SAF Agent support for JAX-RPC Reliable Messaging
EJBGen utility
The AnonymousAdminLookupEnabled attribute on the SecurityConfigurationMBean
The RESTful management resources listed in Deprecated RESTful Management Features.


Solution: Upgrade can be performed by running the Reconfiguration Wizard only.   It is not necessary to run the Upgrade Assistant (UA) for schemas or configuration upgrades.

1.      Install WebLogic Server 12.2.1.3.0 in a new Oracle home.


2.      Run the Reconfiguration Wizard to upgrade your domain. Document below has detailed information about Reconfiguration Wizard:

Fusion Middleware Upgrading Oracle WebLogic Server
https://docs.oracle.com/middleware/12213/wls/WLUPG/upgrade_dom.htm#WLUPG384



Before that we have to upgrade java jdk version

[oraweb@orawlda1 ~]$ java -version

java version "1.8.0_112"

Java(TM) SE Runtime Environment (build 1.8.0_112-b15)

Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)


Take the Domain Backup
[oraweb@orawls u01]$ cp -r oraweb/ oraweb/oraweb_backup/



Reference Docs:
How to Install WebLogic 12.2.1.3 and Create the Domain (Doc ID 2329789.1)

How To Replicate WebLogic 12c (12.2.1.3.0) Standalone Installation onto Remote Linux Server Without XServer? (Doc ID 2535666.1)

How To Upgrade WebLogic Server From 12.2.1.1 To 12.2.1.3? (Doc ID 2391980.1)

https://docs.oracle.com/en/middleware/fusion-middleware/12.2.1.3/wlsig/installing-oracle-weblogic-server-and-coherence-software.html#GUID-5C7D4437-46A2-45A2-85F3-738B0DFE9AE2


Existing System Properties:

/u01/oraweb/products/fmw_12.2.1

/u01/oraweb/config/domains

/u01/oraweb/config/applications

[oraweb@orawls applications]$ echo $ORACLE_HOME

/u01/oraweb/products/fmw_12.2.1

[oraweb@orawls applications]$ echo $DOMAIN_HOME

/u01/oraweb/config/domains/fra_domain

[oraweb@orawls applications]$ echo $JAVA_HOME

/u01/oraweb/jdk/current_ver

[oraweb@orawls jdk]$ ls

current_ver  jdk1.8.0_112  jdk-8u112-linux-x64.tar.gz

[oraweb@orawls jdk]$ pwd

/u01/oraweb/jdk


[oraweb@orawls ~]$ vi .bash_profile

export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom ${JAVA_OPTIONS}"


# Oracle sourcing for Forms / Reports Install


export TNS_ADMIN=/u01/$USER/config/domains/fra_domain/config/fmwconfig

export ORACLE_HOME=/u01/$USER/products/fmw_12.2.1

export FORMS_PATH=/u01/$USER/products/fmw_12.2.1/forms

export PATH=$ORACLE_HOME/OPatch:$PATH

export PATH=$JAVA_HOME/bin:$ORACLE_HOME/bin:$FORMS_PATH/bin:$PATH

export PATH=$ORACLE_HOME/oracle_common/common/bin/:$PATH

# end of Oracle sourcing for Forms / Reports Install.


# Set $ORACLE_SID for custom written scripts.

export ORACLE_SID=WEB


# Oracle sourcing for Weblogic rda tool.

export DOMAIN_HOME=/u01/$USER/config/domains/fra_domain

# End of Oracle sourcing for Weblogic rda tool.

PATH=$PATH:$HOME/bin


export PATH

[oraweb@orawls applications]$ echo $PATH

/u01/oraweb/products/fmw_12.2.1/oracle_common/common/bin/:/u01/oraweb/jdk/current_ver/bin:/u01/oraweb/products/fmw_12.2.1/bin:/u01/oraweb/products/fmw_12.2.1/forms/bin:/u01/oraweb/products/fmw_12.2.1/OPatch:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oraweb/bin


Create a complete backup copy of your existing deployment.

Complete all of the required pre-upgrade tasks for your environment.

Pre-Upgrade Checklist in component upgrade guides

Install the product distributions in a new Oracle home.

Oracle Universal Installer (OUI)

Run a pre-upgrade readiness check to determine if your deployment is ready to be upgraded.

Upgrade Assistant (UA)

Create new schemas for your Fusion Middleware components.

Use the Repository Creation Utility (RCU) for schemas that require custom settings such as additional tablespace size, for example.

Or:

Use the Upgrade Assistant to create missing or required schemas using the default schema settings. Schemas are created during the upgrade process.

Upgrade the 11g or previous 12c database schemas for the components you will be upgrading.

Upgrade Assistant (UA)

Reconfigure the domain.

Reconfiguration Wizard

Upgrade component configurations.

Upgrade Assistant (UA)

Perform all required post-upgrade tasks.

Verify that the upgrade is successful. At a minimum, verify that the servers and node manager start and your applications functions as expected.


Moved the files fmw_12.2.1.3.0_infrastructure_Disk1_1of1 and jdk-8u131-linux-x64.tar to the server and unzip at the desired location.

Before you upgrade, you must backup your domain folders and shut down all servers in the application environment.

(Reference: https://docs.oracle.com/cd/E23943_01/web.1111/e13754/roadmap.htm#WLUPG123)


Jdk Upgrade:


we will upgrade from JDK version 1.8.0_112 to 1.8.0_131 and we have a Linux 64 bit environment.

Make sure weblogic server and admin server are all stopped before following the below steps (nohup $DOMAIN_HOME/bin/stopWebLogic.sh &)

·         Download JDK, copy it to the server and unzip it.

[oraweb@orawls jdk]$ ls -ltrh

total 352M

-rwxr--r-- 1 oraweb oinstall 175M Apr 17  2017 jdk-8u112-linux-x64.tar.gz

lrwxrwxrwx 1 oraweb oinstall   30 Apr 17  2017 current_ver -> /u01/oraweb/jdk/jdk1.8.0_112

drwxr-xr-x 8 oraweb oinstall 4.0K Sep  7  2018 jdk1.8.0_112

-rwxr--r-- 1 oraweb oinstall 177M Oct 31 14:02 jdk-8u131-linux-x64.tar.gz

[oraweb@orawls jdk]$ tar -xvnzf jdk-8u131-linux-x64.tar.gz


Symbolic link changed to point to new version

ln -nfs jdk1.8.0_131/ current_ver


Update the Java Home path in following files

ORACLE_HOME/oui/.globalEnv.properties

DOMAIN_HOME/bin/setNMJavaHome.sh  
DOMAIN_HOME/nodemanager/nodemanager.properties
DOMAIN_HOME/bin/setDomainEnv.sh 


Now start the admin server

[oraweb@orawls products]$ export DISPLAY=”172.22.23.27:10.0”


Ran the below command through VNC server to launch GUI

$ $JAVA_HOME/bin/java -jar fmw_12.2.1.2.0_infrastructure.jar


ADF managed server details

Installing and Configuring Oracle Forms and Reports

Download the software

unzip fmw_12.2.1.3.0_fr_linux64_Disk1_1of2.zip

./fmw_12.2.1.3.0_fr_linux64.bin


Give the JAVA_HOME as jdk_home

Now run the upgrade assistant ua from the new home

Password: adminpw


Start NodeManager from backend. Got error as it is already running. Shutdown the weblogic server admin. Kill all the processes running on the node. Start weblogic admin.

Check NodeManager Properties file. Commented SecureListener parameter or make it false and start the NodeManager now. Go to the weblogic console and start the managed servers one by one.




Friday, December 13, 2019

How to reset Weblogic Server Password



$DOMAIN_HOME/bin/stopWebLogic.sh

->Rename the data folder.

$ mv $DOMAIN_HOME/servers/AdminServer/data $DOMAIN_HOME/servers/AdminServer/data-backup

Set the environment variables.
$  $DOMAIN_HOME/bin/setDomainEnv.sh


$ cd $DOMAIN_HOME/security
$ java weblogic.security.utils.AdminAccount weblogic Yellow292scotch .

java weblogic.security.utils.AdminAccount <weblogic> <Yellow292scotch>


Update the “$DOMAIN_HOME/servers/AdminServer/security/boot.properties” file with the new username and password. The file format is shown below.
username=weblogic
password=Yellow292scotch


Start the WebLogic domain.
$ $DOMAIN_HOME/bin/startWebLogic.sh

nohup $DOMAIN_HOME/bin/startWebLogic.sh > $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.out &


Weblogic Server Failed to Start: Authentication denied: Boot identity not valid



Weblogic Server Startup failed: Caused By: 
weblogic.security.SecurityInitializationException: Authentication denied: Boot identity not valid

Server Fails to Start with Error, BEA-090402 - Authentication Denied: Boot Identity Not Valid, after Changing Password

Edit the boot.properties file at <ORACLE_WLS_HOME>/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/security/boot.properties, override the encrypted password and replace it with the new one in clear text, for example, in our case, "manager":

# Generated by Configuration Wizard on Thu Sep 25 12:49:49 EDT 2008
username=<Encrypted_Value>password=manager



If it is not resolved!..  You can start the server without boot.properties file.
Try starting with the below single command

java -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic123 -Dweblogic.system.StoreBootIdentity=true -Dweblogic.Name=AdminServer weblogic.Server


Thursday, November 14, 2019

Oracle E-Business suite 12.2.9 Installation


Oracle EBS R12 (12.2.9) Installation on Oracle Linux 6.8 (64 bit)

Oracle E-Business suite 12.2.9 Installation on Oracle Linux 6.8 (64 bit)

By

Anil Bandi
DATE : 14/11/2019
  HYDERABAD, tELANGANA


Table of Contents


1.      Reference Document
2.      High Level Installation Steps
3.      Patch Download
4.      Stage Preparation
5.      Operating System Prerequisite
6.      Check System Prerequisite using Oracle Remote Diagnostic Agent
7.      VNC Server Configuration
8.      Base Version 12.2.0 Installation
9.      Apply Required Database Patches
10.    Apply Required Application Tier Patches
11.    Apply Consolidated Seed Table Upgrade Patch
12.    Apply the Latest AD and TXK Delta Release Update Packs
13.    Apply Oracle E-Business Suite 12.2.6 Release Update Pack
14.    Post-Update Steps
15.    Startup /Shutdown Steps


1.    Reference Document


       a)       Oracle E-Business Suite Release Notes, Release 12.2 (Doc ID 1320300.1)
       b)      Oracle E-Business Suite Release 12.2.9 Readme (Doc ID 2495027.1)
       c)       Applying the Latest AD and TXK Release Update Packs to Oracle E-Business Suite Release      12.2 (Doc ID 1617461.1)
       d)      Oracle E-Business Suite 12.2 Patching Technology Components Guide (Doc ID 1355068.1)
       e)      Oracle E-Business Suite Release 12.2: Consolidated List of Patches and Technology Bug Fixes   (Doc ID 1594274.1)
       f)        Database Initialization Parameters for Oracle E-Business Suite Release 12 (Doc ID 396009.1)
       g)       How to Change Temporary Directories in Apps? (Doc ID 469377.1)


2.    High Level Installation Steps


      a)       Configure Operating System prerequisite for R12.2.9 and 12c Database
      b)      Install R12.2.0 with 12c Database using startcd 51.
      c)       Run ETCC in both database tier and Application tier to get the list of            required patches and apply.
      d)      Upgrade to AD.C.11 and TXK.C.11
      e)      Apply the R12.2.9 upgrade patch 28840850
      f)        FS_CLONE for filesystem cloning
      g)       Apply the Help patch.

Downloading Software and Unzipping Start Here Files

After creating the stage area directory, you must download into that directory the components of the latest Oracle E-Business Suite Release 12.2 software distribution (also known as a media pack) that are used by Rapid Install. The Oracle E-Business Suite Release 12.2 software distribution includes Oracle E-Business Suite, Oracle Database, and Oracle Fusion Middleware. It is obtainable in zip format from the Oracle Software Delivery Cloud.
Suggested Reading: Before you download the files, read the Release Notes for the specific release you are installing.
To download the required components of the Oracle E-Business Suite Release 12.2 software distribution:
1.     Sign in to the Oracle Software Delivery Cloud with your My Oracle Support Credentials.
2.     Select Download Package as the search category, enter Oracle E-Business Suite as the search term, and choose Search.
3.     In the search results, select the latest Oracle E-Business Suite package for Release 12.2, such as Oracle E-Business Suite 12.2.9.0.0
4.     Click the Selected Software cart.
5.     Select only the following releases:
o    Oracle E-Business Suite 12.2.0 Current
o    Oracle WebLogic Server 10.3.6.0.0
o    Oracle Web Tier 11.1.1.9.0
o    Oracle Database 12.1.0.2.0
Ensure that all other releases in the list are deselected.
6.     Select the platform for each of the selected releases, and choose Continue.
7.     Read and accept the license agreement, and choose Continue.
8.     By default, all available files are selected. Select only the required files and choose Download to start the download into your stage directory. You must download the following specific components of the Oracle E-Business Suite Release 12.2 software distribution:
o    Oracle E-Business Suite Release 12.2.0 Rapid Install Start Here (all parts)
o    Oracle E-Business Suite Release 12.2.0 for <Platform> Rapid Install (all disks and parts)
o    Oracle E-Business Suite Release 12.2.0 for <Platform> Rapid Install Technology one-off Patches
o    Oracle WebLogic Server 10.3.6 (11gR1) Generic with Coherence 3.7.1
o    Oracle Web Tier 11.1.1.9.0 Utilities (11g Patch Set 7) - Oracle Fusion Middleware for <Platform>
o    Oracle Database 12.1.0.2.0 for <Platform>


3.    Patch Download

Download required installer https://edelivery.oracle.com and patch from https://support.oracle.com site.
      a)       Download Rapid Install Startcd 12.2.0.51 (Patch 22066363)
b)    Oracle E-Business Suite Release 12.2.0 for Linux x86-64 Rapid Install 
1)    Oracle Database 12.1.0.2.0 for Linux x86-64
                      i.        V46095-01_1of2.zip Oracle Database 12c Release 1 (12.1.0.2.0)
                     ii.        V46095-01_2of2.zip Oracle Database 12c Release 1 (12.1.0.2.0)

2)    Oracle E-Business Suite 12.2.9 for Linux x86-64
                      i.        V982743-01_1of2.zip
                     ii.        V982743-01_2of2.zip
                    iii.        V982746-01_1of10.zip              
                    iv.        V982746-01_2of10.zip              
                     v.        V982746-01_3of10.zip  
                    vi.        V982746-01_4of10.zip  
                   vii.        V982746-01_5of10.zip  
                  viii.        V982746-01_6of10.zip  
                    ix.        V982746-01_7of10.zip  
                     x.        V982746-01_8of10.zip
                    xi.        V982746-01_9of10.zip              
                   xii.        V982746-01_10of10.zip             
                  xiii.        V983437-01.zip             
                  xiv.        V983438-01.zip 

3)    Oracle E-Business Suite 12.2.0 Current for Linux x86-64
              i.              V35803-01_1of3.zip                  
             ii.              V35803-01_2of3.zip                  
            iii.              V35803-01_3of3.zip                  
             iv.              V35804-01_1of2.zip                  
              v.              V35804-01_2of2.zip                  
             vi.              V35802-01.zip              
            vii.              V100060-01_1of3.zip                
           viii.              V100060-01_2of3.zip                
            ix.              V100060-01_3of3.zip                
             x.              V100061-01.zip             
            xi.              V100054-01.zip             
           xii.              V100055-01.zip             
          xiii.              V100052-01_1of3.zip                
          xiv.              V100052-01_2of3.zip                
           xv.              V100052-01_3of3.zip                
          xvi.              V100053-01_1of2.zip                
         xvii.              V100053-01_2of2.zip                
        xviii.              V100058-01.zip             
          xix.              V100059-01_1of2.zip                
           xx.              V100059-01_2of2.zip                
          xxi.              V100056-01.zip             
         xxii.              V100057-01.zip             
        xxiii.              V100102-01.zip

4)    Oracle Web Tier 11.1.1.9.0 for Linux x86-64
              i.        V75792-01.zip

5)    Oracle WebLogic Server 10.3.6.0.0 for Linux x86-64
             ii.        V29856-01.zip        


4.    Stage Preparation


[root@erpdev ~]#  mkdir –p /u01/Stage122
[root@erpdev ~]#  unzip p22066363_R12_GENERIC.zip
[root@erpdev ~]#  cd /u01/Stage122/startCD/Disk1/rapidwiz/bin
[root@erpdev ~]#  ./buildStage.sh
Oracle E-Business Suite Rapid Install
Version 12.2.0

Press Enter to continue...
Build Stage Menu
------------------------------------------------------
1. Create new stage area
2. Copy patches to existing stage area
3. List files in TechPatches directory
4. Exit menu

Enter your choice [4]: 1

Rapid Install Platform Menu

1. Oracle Solaris SPARC (64-bit)
2. Linux x86 (64-bit)
3. IBM AIX on Power Systems (64-bit)
4. HP-UX Itanium
5. Exit Menu

Enter your choice [5]: 2
……………………..
Specify the directory containing the zipped installation media:
/u01/EBS_Installer/12.2.6
…………………………..
Unzip command is: /u01/ Stage122/startCD/Disk1/rapidwiz/unzip/Linux_x64/unzip -o         
Unzipping V35802-01.zip
Unzipping V35803-01_1of3.zip
Unzipping V35803-01_2of3.zip
Unzipping V35803-01_3of3.zip
Unzipping V35804-01_1of2.zip
Unzipping V35804-01_2of2.zip
Unzipping V46095-01_1of2.zip
Unzipping V46095-01_2of2.zip
Unzipping V100059-01_1of2.zip
Unzipping V100059-01_2of2.zip
Unzipping V100060-01_1of3.zip
Unzipping V100060-01_2of3.zip
Unzipping V100060-01_3of3.zip
Unzipping V100053-01_1of2.zip
Unzipping V100053-01_2of2.zip
Unzipping V100054-01.zip
Unzipping V100055-01.zip
Unzipping V100056-01.zip
Unzipping V100057-01.zip
Unzipping V100058-01.zip
Unzipping V100061-01.zip
Unzipping V100102-01.zip
Unzipping V75792-01.zip
Unzipping V29856-01.zip
……………………………
Finished unzipping shiphome.
Unzipping Oracle Software Delivery Cloud one-off patches...
Press Enter to continue...
……………………………
Finished unzipping Oracle Software Delivery Cloud one-off patches.
Press Enter to continue...
……………………………
Finished copying additional patches.
Verifying stage area...
Directory /u01/Stage122/TechInstallMedia is valid.
Directory /u01/Stage122/TechPatches/DB is valid.
Directory /u01/Stage122/TechPatches/MiddleTier is valid.
Directory /u01/Stage122/EBSInstallMedia/AppDB is valid.
Directory /u01/Stage122/EBSInstallMedia/Apps is valid.
Directory /u01/Stage122/EBSInstallMedia/AS10.1.2 is valid.
Directory /u01/Stage122/TechInstallMedia/database is valid.
Directory /u01/Stage122/TechInstallMedia/ohs11119 is valid.
Directory /u01/Stage122/TechInstallMedia/wls1036_generic is valid.
Stage area verified.
Press Enter to continue...

5.    Operating System Prerequisite


     a)      Installing rpms for EBS 12.2 and RDBMS 12C

[root@erpdev ~]# cd /etc/yum.repos.d
[root@erpdev ~]#  vi public-yum-ol6.repo
[ol6_latest]
gpgcheck=1
enabled=1

[ol6_addons]
gpgcheck=1
enabled=1

#[ol6_UEK_latest]
#gpgcheck=1
#enabled=1

[root@erpdev ~]#  yum update
[root@erpdev ~]#  yum install –y oracle-ebs-server-R12-preinstall
[root@erpdev ~]#  yum install –y oracle-rdbms-server-12cR1-preinstall

    b)      Check all rpms using below command

[root@erpdev ~]# rpm -qa --qf "%{n}-%{v}-%{r}.%{arch}\n" | grep openmotif21
openmotif21-2.1.30-11.EL6.i686
Run ldconfig –v command to relink all symbolic libraries
[root@erpdev ~]#  ldconfig –v

    c)       Create soft link for library as below for 10.1.2 Server

[root@erpdev ~]# ls -lrt /usr/lib/libXtst.so.6
lrwxrwxrwx. 1 root root 16 Feb 20 20:53 /usr/lib/libXtst.so.6 -> libXtst.so.6.1.0
[root@erpdev ~]# unlink /usr/lib/libXtst.so.6
[root@erpdev ~]# ln -s /usr/X11R6/lib/libXtst.so.6.1 /usr/lib/libXtst.so.6
[root@erpdev ~]# ls -lrt /usr/lib/libXtst.so.6
lrwxrwxrwx 1 root root 29 Feb 25 16:12 /usr/lib/libXtst.so.6 -> /usr/X11R6/lib/libXtst.so.6.1
[root@erpdev ~]# ln -s /usr/lib/libgdbm.so.2.0.0 /usr/lib/libdb.so.2

   d)      Check Threading model in Linux should be NPTL

            [root@erpdev ~]# getconf GNU_LIBPTHREAD_VERSION
NPTL 2.12

   e)      Disable selinux and shutdown iptables,ip6tables services also on run levels

[root@erpdev ~]# vi /etc/selinux/config
change SELINUX=enforcing to SELINUX=disabled
[root@erpdev ~]# service iptables stop
[root@erpdev ~]# service ip6tables stop
[root@erpdev ~]# chkconfig --level 0123456 ip6tables off
[root@erpdev ~]# chkconfig --level 0123456 iptables off

    f)        Check kernel settings for the parameters are correctly set 

Note: If the current value for any parameter is higher than the value listed in the following table, then do not change the value of that parameter. 

[root@erpdev ~]# vi /etc/sysctl.conf


# kernel.semmsl 256
# kernel.semmns 32000
# kernel.semopm 100
# kernel.semmni 142
kernel.sem = 250 32000 100 142
kernel.shmall = 20971524
kernel.shmmax Half the size of the physical memory (in bytes), and at least 42949672952
kernel.shmmni = 4096
kernel.msgmax = 8192
kernel.msgmnb = 65535
kernel.msgmni = 2878
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 05
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

Note : Parameter kernel.sem = 250 32000 100 128 is changed to kernel.sem = 250 32000 100 142
 

    g)      Check Domain Name System (DNS) Resolver Parameters , it should be below

[root@erpdev ~]#  vi /etc/resolv.conf
nameserver 192.168.100.252
nameserver 8.8.8.8
options attempts:5
options timeout:15

    h)      Verifying Host Names

[root@erpdev ~]#  vi /etc/hosts
127.0.0.1   localhost.localdomain localhost
::1         localhost.localdomain localhost
192.168.1.113 erpdev.dblgroup.com erpdev

    i)        Verify that the /etc/sysconfig/network file is formatted as follows

[root@erpdev ~]#  vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=erpdev.dblgroup.com
# oracle-rdbms-server-12cR1-preinstall : Add NOZEROCONF=yes
NOZEROCONF=yes

 If the /etc/sysconfig/networking/profiles/default/network file exists, remove it.
 [root@erpdev ~]#  rm -rf /etc/sysconfig/networking/profiles/default/network

  
    j)        Modify ulimit settings in limits.conf

[root@erpdev ~]#  vi /etc/security/limits.conf 
* hard nofile 65536
* soft nofile 4096
* hard nproc 16384
* soft nproc 2047
* hard stack 16384
* soft stack 10240

   k)      Swap space on the system be 16 GB or more

[root@erpdev ~]#  grep SwapTotal /proc/meminfo
SwapTotal:       4194300 kB

   l)        Create OS group, User
[root@erpdev ~]#   groupadd dba
[root@erpdev ~]#   useradd –g dba erpdev
[root@erpdev ~]#   passwd erpdev

   m)    Create directories and change permissions
[root@erpdev ~]#  mkdir –p /u01/ERPDEV
[root@erpdev ~]#  mkdir –p /u01/ERPDEV/temp
[root@erpdev ~]#  chmod –R 775 /u01/ERPDEV
[root@erpdev ~]#  chown –R erpdev:dba /u01/ERPDEV

   n)      Create Inventory 
[root@erpdev ~]#  mkdir –p /u01/ERPDEV/oraInventory
[root@erpdev ~]#  chown -R erpdev.dba /u01/ERPDEV/oraInventory/
[root@erpdev ~]#  vi /etc/oraInst.loc
inventory_loc=/u01/ERPDEV/oraInventory
inst_group=dba


6.    Check System Prerequisite using Oracle Remote Diagnostic Agent


Download and Unzip Patch p21769913_81517314_Linux-x86-64.zip

[root@erpdev ~]#  cd rda
[root@erpdev ~]#  ./rda.sh -T hcve 

 Run rda for the below Rule Sets and make sure there is no failed result,

         a)      Oracle Database 12c R1 (12.1.0) Preinstallation (Linux)
         b)      Oracle E-Business Suite Release 12 (12.2.0) Preinstall (Linux x86_64)

7.    VNC Server


8.    Base Version 12.2.0 Installation

      Check Rapid Wizard Version and start Installation


[root@erpdev ~]#  export DISPLAY=:2
[root@erpdev ~]#  xhost +
[root@erpdev ~]#  ./rapidwiz -version
Version 12.2.0.51
[root@erpdev ~]#  unset ENV
[root@erpdev ~]#  export TEMP=/u01/ERPDEV/temp
[root@erpdev ~]# cd /u01/Stage122/startCD/Disk1/rapidwiz/
[root@erpdev rapidwiz]# ./rapidwiz


9.    Apply Required Database Patches



        a)      Document Reference for this Section

a.       Doc ID 1594274.1
b.       Doc ID 2114016.1

Download Patch p17537119_R12_GENERIC.zip

The EBS Technology Codelevel Checker (ETCC) utility provides two scripts you can run to help ensure you have the necessary database and application tier bugfixes installed on your Oracle E-Business Suite Release 12.2 system. 

        b)      For Database Tier

a.       Download and apply latest PSU Patch p24732082_121020_Linux-x86-64.zip.

[ebscrp@erptest 12.1.0]$ . *.env
[ebscrp@erptest 24732082]$ export          PATH=$PATH:/u01/DBLTEST/12.1.0/OPatch/
[dbltest@erpdev ~]$ unzip  p24732082_121020_Linux-x86-64.zip
[dbltest@erpdev ~]$  cd 24732082
                          [dbltest@erpdev  24732082]$  opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Following patches have conflicts. Please contact Oracle Support and get the                                                                                 merged patch of the patches :
……………………………….
18485835, 20476776, 24732082
………………………………...
[dbltest@erpdev 24732082]$  opatch rollback –id  18485835
[dbltest@erpdev 24732082]$  opatch rollback –id  20476776
             [dbltest@erpdev 24732082]$  ]$  opatch prereq  CheckConflictAgainstOHWithDetail -ph ./
                          ………………………………….
                          Prereq "checkConflictAgainstOHWithDetail" passed.
                          ………………………………….
 
            Ensure that you shut down all the services running from the Oracle home.
 
[dbltest@erpdev ~]$  opatch apply
[dbltest@erpdev ~]$  sqlplus /nolog
SQL> Connect / as sysdba
SQL> startup
SQL> quit
[dbltest@erpdev ~]$   cd /u01/DBLTEST/12.1.0/OPatch/
[dbltest@erpdev OPatch]$   ./datapatch -verbose

b.       Run etcc on DB Tier

[dbltest@erpdev ~]$  mkdir –p $ORACLE_HOME/appsutil/etcc
[dbltest@erpdev ~]$  unzip p17537119_R12_GENERIC.zip

Copy below 4 files to new etcc directory,
                                                                                      i.       checkDBpatch.sh
                                                                                    ii.       checkDBpatch.cmd
                                                                                  iii.       txk_R1220_DB_base_bugs.xml
                                                                                  iv.       txk_R1220_DB_mappings.xml


[dbltest@erpdev ~]$  cd $ORACLE_HOME/appsutil/etcc
[dbltest@erpdev etcc]$ sh checkDBpatch.sh

PATCH RECOMMENDATION SUMMARY AFTER LATEST PSU PATCH 24732082 APPLIED
============================================================
Oracle Database Release 12.1.0.2  (PATCHSET UPDATE 12.1.0.2.170117)
-------------------------------------------------------------------------------
  Patch 24568754 [12.1.0.2.161018 version]
    - Filename: p24568754_12102161018_Linux-x86-64.zip
  Patch 24566317 [12.1.0.2.160719 version]
    - Filename: p24566317_12102160719_Linux-x86-64.zip
  Patch 25128602 [12.1.0.2.170117 version]
    - Filename: p25128602_12102170117_Linux-x86-64.zip
  Patch 20766180 [12.1.0.2.4 version]
    - Filename: p20766180_121024_Generic.zip
  Patch 21321429 [12.1.0.2.170117 version]
    - Filename: p21321429_12102170117_Generic.zip
  Patch 21967332 [12.1.0.2.160419 version]
    - Filename: p21967332_12102160419_Linux-x86-64.zip
  Patch 22338374 [12.1.0.2.160119 version]
    - Filename: p22338374_12102160119_Linux-x86-64.zip
  Patch 24326444 [12.1.0.2.161018 version]
    - Filename: p24326444_12102161018_Linux-x86-64.zip
  Patch 24560906 [12.1.0.2.5 version]
    - Filename: p24560906_121025_Linux-x86-64.zip
Apply the required patches and rerun this script

You should check the patch READMEs for minimum opatch version requirements.
The latest opatch is available from My Oracle Support via Patch 6880880.
+-----------------------------------------------------------------------------+
A consolidated zip file with the required patches for Database release
12.1.0.2.170117 is available on My Oracle Support via:

  Patch 25201332 [12.1.0.2.170117 version]
    - EBS RELEASE 12.2 CONSOLIDATED DATABASE FIXES FOR JAN 2017

Note: This zip does not include any database bundle patches or PSUs.
+-----------------------------------------------------------------------------+
See Doc ID 1147107.1 for any special instructions for these patches.
Note: Footnotes in Doc ID 1594274.1 also apply to corresponding overlay patches.
Stored Technology Codelevel Checker results in the database dbltest successfully.
Finished prerequisite patch testing : Sat Mar 11 13:38:09 BDT 2017
Log file for this session: ./checkDBpatch_47684.log

        c)       Apply the below patches using opatch

1
24568754
2
24566317
3
18793246
4
25128602
5
20766180
6
22098146
7
21321429
8
21864513
9
21904072
10
21967332
11
22338374
12
22731026
13
24326444
14
24560906

[dbltest@erpdev ~]$  export PATH=$PATH:$ORACLE_HOME/OPatch

To Check the patch applied or not use below command

[dbltest@erpdev ~]$  opatch lsinventory | grep 19908836

Download Patch p25201332_12102170117_Linux-x86-64.zip for all the etcc-bundle patches.
Ensure that you shut down all the services running from the Oracle home.

[dbltest@erpdev ~]$  unzip p25201332_12102170117_Linux-x86-64.zip
[dbltest@erpdev ~]$  cd etcc-bundle/LINUX_X86-64/database/12.1.0.2.170117

Minimum OPatch version required is 12.1.0.1.4

[dbltest@erpdev ~]$  cd $ORACLE_HOME/OPatch
[dbltest@erpdev ~]$   ./opatch version
OPatch Version: 12.1.0.1.10
                Apply all the patches using opatch.
[dbltest@erpdev ~]$  unzip p24568754_12102161018_Linux-x86-64.zip
            [dbltest@erpdev ~]$  cd 24568754
[dbltest@erpdev 24568754]$  opatch prereq CheckConflictAgainstOHWithDetail -ph ./
[dbltest@erpdev 24568754]$  opatch apply

Start the services from the Oracle home

[dbltest@erpdev 24568754]$  cd $ORACLE_HOME/OPatch
[dbltest@erpdev OPatch]$  datapatch

Ensure that you shut down all the services running from the Oracle home.
  
[dbltest@erpdev 12.1.0.2.170117]$  unzip p24566317_12102160719_Linux-x86-64.zip
[ebscrp@erptest 24566317]$ opatch lsinventory | grep 23054246
Sub-patch  23054246; "Database Patch Set Update : 12.1.0.2.160719 (23054246)"
[dbltest@erpdev 12.1.0.2.170117]$  cd 24566317
[dbltest@erpdev 24566317]$  opatch prereq CheckConflictAgainstOHWithDetail -ph ./
[dbltest@erpdev 24566317]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$ unzip p18793246_121020_Generic.zip
[dbltest@erpdev 12.1.0.2.170117]$ cd 18793246
[dbltest@erpdev 18793246]$ opatch apply
[dbltest@erpdev 18793246]$  cd $ORACLE_HOME/OPatch
[dbltest@erpdev OPatch]$  datapatch

Ensure that you shut down all the services running from the Oracle home.

[dbltest@erpdev 12.1.0.2.170117]$  unzip p25128602_12102170117_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 25128602
[dbltest@erpdev 25128602]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$  unzip p20766180_121024_Generic.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 20766180
[dbltest@erpdev 20766180]$  opatch apply –local

[dbltest@erpdev 12.1.0.2.170117]$  unzip p22098146_121020_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 22098146
[dbltest@erpdev 22098146]$ opatch apply
[dbltest@erpdev 22098146]$  cd $ORACLE_HOME/OPatch
[dbltest@erpdev OPatch]$  datapatch
Ensure that you shut down all the services running from the Oracle home.

[dbltest@erpdev 12.1.0.2.170117]$  unzip p21321429_12102170117_Generic.zip
[dbltest@erpdev 12.1.0.2.170117]$   cd 21321429
[dbltest@erpdev 21321429]$   opatch apply
[dbltest@erpdev 21321429]$  cd $ORACLE_HOME/OPatch
[dbltest@erpdev OPatch]$  datapatch

Ensure that you shut down all the services running from the Oracle home.

[dbltest@erpdev 12.1.0.2.170117]$  unzip p21864513_121020_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 21864513
[dbltest@erpdev 21864513]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$  unzip p21904072_121020_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 21904072
[dbltest@erpdev 21904072]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$  unzip  p21967332_12102160419_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 21967332
[dbltest@erpdev 21967332]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$  unzip p22338374_12102160119_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 22338374
[dbltest@erpdev 22338374]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$  unzip p22731026_121020_Generic.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 22731026
[dbltest@erpdev 22731026]$  opatch apply
[dbltest@erpdev 22731026]$  cd $ORACLE_HOME/OPatch

[dbltest@erpdev OPatch]$  datapatch

Ensure that you shut down all the services running from the Oracle home.

[dbltest@erpdev 12.1.0.2.170117]$  unzip p24326444_12102161018_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 24326444
[dbltest@erpdev 24326444]$  opatch apply

[dbltest@erpdev 12.1.0.2.170117]$  unzip p24560906_121025_Linux-x86-64.zip
[dbltest@erpdev 12.1.0.2.170117]$  cd 24560906
[dbltest@erpdev 24560906]$  opatch apply

        d)      After applying database patches, ensure the following additional tasks are performed
Compare & copy $APPL_TOP/admin/adgrants.sql from the administration server node to the database server node $ORACLE_HOME/appsutil/sql. Use SQL*Plus to connect to the database as SYSDBA and run the script using the following command:
SQL>sqlplus "/ as sysdba" @adgrants.sql <APPS schema name>

Use SQL*Plus to connect to the database as SYSDBA and run utlrp.sql script using the following command:
SQL>sqlplus "/ as sysdba" @?/rdbms/admin/utlrp.sql

        e)      Run etcc again to check all the required DB patch applied

           [dbltest@erpdev etcc]$  sh checkDBpatch.sh
            ………………………….
All the required one-off bugfixes are present in database ORACLE_HOME.
………………………….


10.           Apply Required Application Tier Patches


[dbltest@erpdev ~]$  mkdir –p /u01/DBLTEST/etcc
[dbltest@erpdev ~]$  unzip p17537119_R12_GENERIC.zip

Copy below 4 files to new etcc directory,
                                                          I.            checkMTpatch.cmd
                                                       II.            checkMTpatch.sh
                                                     III.            txk_R1220_MT_base_bugs.xml
                                                     IV.            txk_R1220_MT_mappings.xml
[dbltest@erpdev ~]$  cd /u01/DBLTEST/etcc
[dbltest@erpdev ~]$  ./checkMTpatch.sh
……………………………………………………
Patch recommendation summary
Oracle Forms and Reports 10.1.2.3.0
 Patch 24946444      - Filename: p24946444_101232_LINUX.zip
Oracle Fusion Middleware (FMW) - Web Tier 11.1.1.9.0
  Patch 22288381    - Filename: p22288381_111190_Generic.zip
Oracle Fusion Middleware (FMW) - oracle_common 11.1.1.9.0
  Patch 9905685       - Filename: p9905685_111190_Generic.zip
  Patch 21366277    - Filename: p21366277_111190_Generic.zip
  Patch 21628307    - Filename: p21628307_111190_Generic.zip
  Patch 24606362    - Filename: p24606362_111190_Generic.zip

Oracle WebLogic Server (WLS) 10.3.6.0.7
  Patch 23743997 [SU Patch [K25M]: WLS PSU 10.3.0.6.161018]
    - Filename: p23743997_1036_Generic.zip
A consolidated zip file with the required application tier patches is
available on My Oracle Support via:
  Patch 25201333
    - EBS RELEASE 12.2 CONSOLIDATED FMW FIXES FOR JAN 2017
+-----------------------------------------------------------------------------+
[WARNING]  Patch 23743997 [SU Patch [K25M]: WLS PSU 10.3.0.6.161018] is missing.
This is the recommended minimum WLS patch set.
You should install it now, and then rerun this script to check for any
further fixes available.
================


Download & Unzip etcc_bundle patch 25201333
[dbltest@erpdev ~]$   unzip p25201333_R12_LINUX.zip
[dbltest@erpdev ~]$   cd etcc-bundle/LINUX_X86-64
[dbltest@erpdev LINUX_X86-64]$ ls
                        forms  oracle_common  webtier  wls  

 EBS RELEASE 12.2 CONSOLIDATED FMW FIXES FOR 161018 AND 160719

       1. Oracle Forms and Reports

[dbltest@erpdev ~]$  export ORACLE_HOME=/u01/DBLTEST/fs1/EBSapps/10.1.2
[dbltest@erpdev ~]$  export PATH=$ORACLE_HOME/OPatch:$PATH
            [dbltest@erpdev ~]$  opatch lsinventory|grep 8551790
            [dbltest@erpdev ~]$  opatch lsinventory|grep 24946444
[dbltest@erpdev ~]$  unzip p24946444_101232_LINUX.zip
[dbltest@erpdev ~]$  cd 24946444
[dbltest@erpdev 24946444]$  opatch apply

       2.  Oracle Fusion Middleware (FMW) - Web Tier

            [dbltest@erpdev ~]$  export ORACLE_HOME=/u01/DBLTEST/fs1/FMW_Home/webtier
            [dbltest@erpdev ~]$  export PATH=$ORACLE_HOME/OPatch:$PATH
[dbltest@erpdev ~]$  opatch lsinventory|grep 22288381
[dbltest@erpdev ~]$  unzip p22288381_111190_Generic.zip
[dbltest@erpdev ~]$  cd 22288381
[dbltest@erpdev 22288381]$  opatch apply

       3.  Oracle Fusion Middleware (FMW) - oracle_common
            [dbltest@erpdev ~]$  export ORACLE_HOME =  /u01/DBLTEST/fs1/FMW_Home/oracle_common
            [dbltest@erpdev ~]$  export PATH=$ORACLE_HOME/OPatch:$PATH
[dbltest@erpdev ~]$  opatch lsinventory|grep 9905685
[dbltest@erpdev ~]$   unzip p9905685_111190_Generic.zip
[dbltest@erpdev ~]$  cd 9905685
[dbltest@erpdev 9905685]$  cd oui
[dbltest@erpdev oui]$  opatch apply
[dbltest@erpdev ~]$   unzip p21366277_111190_Generic.zip
[dbltest@erpdev ~]$  cd 21366277
[dbltest@erpdev 21366277]$  opatch apply

[dbltest@erpdev ~]$   unzip p21628307_111190_Generic.zip
[dbltest@erpdev ~]$  cd 21628307
[dbltest@erpdev 21628307]$  opatch apply
[dbltest@erpdev ~]$   unzip p24606362_111190_Generic.zip
[dbltest@erpdev ~]$  cd 24606362
[dbltest@erpdev 24606362]$  opatch apply

      4.  Oracle WebLogic Server (WLS)

            [dbltest@erpdev ~]$  export ORACLE_HOME =  /u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
            [dbltest@erpdev ~]$  cp p23743997_1036_Generic.zip /u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir
            [dbltest@erpdev ~]$  unzip p23743997_1036_Generic.zip
[dbltest@erpdev ~]$  ls -ltr *.jar
[dbltest@erpdev ~]$  cd  /u01/DBLTEST/fs1/FMW_Home/utils/bsu
[dbltest@erpdev ~]$  echo $DISPLAY
            [dbltest@erpdev ~]$  echo $DISPLAY=:2:0
[dbltest@erpdev bsu]$   ./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_me/utils/bsu/cache_dir -patchlist=K25M -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
Checking for conflicts...
Conflict(s) detected - resolve conflict condition and execute patch installation again
Conflict condition details follow:
Patch K25M is mutually exclusive and cannot coexist with patch(es): CW9T,VKXF,FCX7,Y5AP,1LRI,2GYW,BLTG
==========================
Patch 23743997 will end with above conflicts message. So we need to be first remove the list of conflicting patch then retry Patch  23743997.


Patch Need to be removed: CW9T, VKXF, 1LRI, 2GYW, BLTG, FCX7, Y5AP

[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=CW9T -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=VKXF -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=1LRI -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=2GYW -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=BLTG -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=FCX7 -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3
[dbltest@erpdev bsu]$   ./bsu.sh -remove -patchlist=Y5AP -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3

Now again apply patch 23743997

[dbltest@erpdev bsu]$   ./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=K25M -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3 


      5.  Run ETCC again to get the patch list

           [dbltest@erpdev ~]$  cd /u01/DBLTEST/etcc
           [dbltest@erpdev ~]$  ./checkMTpatch.sh

     6.  Download, Move & Unzip below patch to the cache_dir directory

a)       24608998 [QMJP]
b)      13729611 [Z9PC]
c)       17319481 [9KCT]
d)      19259028 [KRDE]
e)      19687084 [NJVF]
f)        22323006 [DI8E]

     7. To install the patches, use below commands

./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=QMJP -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3   
./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=Z9PC -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3 
./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=9KCT -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3  
./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=KRDE -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3 
./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=NJVF -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3  
./bsu.sh -install -patch_download_dir=/u01/DBLTEST/fs1/FMW_Home/utils/bsu/cache_dir -patchlist=DI8E -prod_dir=/u01/DBLTEST/fs1/FMW_Home/wlserver_10.3  

     8.  To check  the MT patch list again run the following       

[dbltest@erpdev ~]$  cd /u01/DBLTEST/etcc
[dbltest@erpdev ~]$  ./checkMTpatch.sh

Now you should get the message as "All required patches are present"

      9.  Set Database Parameter

Oracle Database 12c Release 1 uses cost based optimization. If you are using Oracle Database 12.1.0.2, the following optimizer parameter should always be set to 'false'. This setting should be completed before proceeding with the next steps and should not be changed thereafter.

SQL>create spfile from pfile;
SQL>shutdown immediate;
SQL>startup;
SQL> alter system set optimizer_adaptive_features=false scope=spfile;
You can verify the parameter was set correctly by running the following command, which should return the value FALSE:
SQL>show parameter optimizer_adaptive_features
      10. Download the Consolidated seed patches and AD C, TXK  and Post patches,


a)       Consolidated seed patches:
        p17204589_12.2.0_R12_GENERIC.zip
        p21900871_12.2.0_R12_GENERIC.zip

b)      AD C.8 patches:
p21841299_R12.AD.C_R12_LINUX.zip
                               p24578455_R12.AD.C_R12_GENERIC.zip
                               p24494551_R12.AD.C_R12_GENERIC.zip
                               p25025325_R12.AD.C_R12_GENERIC.zip
c)       AD C. delta 8 patches:
                               p21830810_R12.TXK.C_R12_GENERIC.zip
d)      TXK.C.8 patches:
                                 p18525466_R12.TXK.C_R12_GENERIC.zip
                                  p23569114_R12.TXK.C_R12_GENERIC.zip
                                 p23705992_R12.TXK.C_R12_GENERIC.zip

       11.    All Downloaded files are moved to /u01/DBLTEST/fs_ne/EBSapps/patch
       12.   Unzip the above patch files.

11.  Apply Consolidated Seed Table Upgrade Patch


         [dbltest@erpdev ~]$  sh $ADMIN_SCRIPTS_HOME/adstpall.sh
         [dbltest@erpdev ~]$  sh $ADMIN_SCRIPTS_HOME/adadminsrvctl.sh start
         [dbltest@erpdev ~]$  adop phase=apply patches=17204589,21900871 merge=yes                                                            hotpatch=yes
         [dbltest@erpdev ~]$  sh $ADMIN_SCRIPTS_HOME/adstrtall.sh


12.   Apply the Latest AD and TXK Delta Release Update Packs


      1.       Start up only the Oracle Weblogic Admin Server on the run edition application tier file system.
[dbltest@erpdev ~]$  sh $ADMIN_SCRIPTS_HOME/adstpall.sh
[dbltest@erpdev ~]$  sh $ADMIN_SCRIPTS_HOME/adadminsrvctl.sh start

      2.       Run the adgrants.sql script as a user that can connect as SYSDBA to grant privileges to selected SYS objects and create PL/SQL profiler objects.
Patch AD.C
**** Patch 21841299 ****
1. Create $ORACLE_HOME/appsutil/admin on the database server.
2. Compare the version of adgrants.sql(UNIX) in $APPL_TOP/admin  to that in patch directory.
3. Copy the higher version of adgrants.sql (UNIX) to
$ORACLE_HOME/appsutil/admin.
4. Set the environment to point to ORACLE_HOME on the database server.
5. Use SQL*Plus to run the script:
[dbltest@erpdev ~]$  $ sqlplus /nolog
[dbltest@erpdev ~]$  SQL> @$ORACLE_HOME/appsutil/admin/adgrants.sql APPS
                               [dbltest@erpdev ~]$  adop phase=apply patches=21841299 hotpatch=yes

     3.       Instructions for running AD Grants  *** check adgrants in patch 24494551. 
Run the adgrants.sql script as a user that can connect as SYSDBA to grant privileges to selected SYS objects and create PL/SQL profiler objects.

1. Create $ORACLE_HOME/appsutil/admin on the database server.
2. Compare the version of adgrants.sql(UNIX) in $APPL_TOP/admin to that in patch directory.
3. Copy the higher version of adgrants.sql (UNIX) to
$ORACLE_HOME/appsutil/admin.
4. Set the environment to point to ORACLE_HOME on the database server.
5. Use SQL*Plus to run the script:
[dbltest@erpdev ~]$  $ sqlplus /nolog
[dbltest@erpdev ~]$  SQL> @$ORACLE_HOME/appsutil/admin/adgrants.sql APPS
[dbltest@erpdev ~]$  adop phase=apply patches=24578455,24494551,25025325 merge=yes    hotpatch=yes workers=8
[dbltest@erpdev ~]$  adop phase=apply patches=21830810 hotpatch=yes workers=8

    4.       Patch TXK C
[dbltest@erpdev ~]$   adop phase=apply patches=18525466,23569114,23705992 hotpatch=yes merge=yes workers=8
After applying this patch, update all Database Tier Nodes with the code level provided by this patch, by performing the following steps :

    5.       After applying the above Patch 23705992 perform below steps

a.       On the Application Tier

                  [dbltest@erpdev DBLTEST]$ . /u01/DBLTEST/EBSapps.env run
[dbltest@erpdev ~]$  cd $ADMIN_SCRIPTS_HOME
[dbltest@erpdev scripts]$ ./adautocfg.sh
[dbltest@erpdev appl]$ cd /u01/DBLTEST/fs1/EBSapps/appl
[dbltest@erpdev appl]$ . *.env
[dbltest@erpdev appl]$  perl<AD_TOP>/bin/admkappsutil.pl
This will create appsutil.zip in <INST_TOP>/admin/out

b.      On the Database Tier

[dbltest@erpdev ~]$  cd /u01/DBLTEST/12.1.0
[dbltest@erpdev ~]$  . *.env
Copy or FTP the appsutil.zip file to the <RDBMS ORACLE_HOME>
[dbltest@erpdev ~]$  unzip -o appsutil.zip
c.       Re-run adpreclone.pl on the database tier and on the primary node of the Application tier

Note:
Since new updates included in this patch have been applied to the system, adpreclone must be executed again in order to apply them into the clone directory structures used during cloning.
[dbltest@erpdev ~]$  perl adpreclone.pl dbTier
[dbltest@erpdev ~]$  perl adpreclone.pl appsTier

d.      Migrate Latest Code to Database Tier
Update all database tier nodes with the latest code, by performing the following steps:

[dbltest@erpdev appl]$ cd /u01/DBLTEST/fs1/EBSapps/appl
[dbltest@erpdev appl]$ . *.env
Execute the admkappsutil.pl utility to create the appsutil.zip file in <INST_TOP>/admin/out.
[dbltest@erpdev appl]$ perl<AD_TOP>/bin/admkappsutil.pl

[dbltest@erpdev ~]$  cd /u01/DBLTEST/12.1.0
[dbltest@erpdev ~]$  . *.env
Copy or FTP the appsutil.zip file to <RDBMS ORACLE_HOME>.
       [dbltest@erpdev ~]$  unzip -o appsutil.zip
                   [dbltest@erpdev ~]$  cd $ORACLE_HOME/appsutil/scripts/dbltest_erpdev
                   [dbltest@erpdev ~]$  adautocfg.sh
                   [dbltest@erpdev DBLTEST]$ . EBSapps.env run
                   [dbltest@erpdev DBLTEST]$  cd $ADMIN_SCRIPTS_HOME
                   [dbltest@erpdev ~]$  adautocfg.sh

13. Apply Oracle E-Business Suite 12.2.9 Release Update Pack

 1. Source the run edition applications environment.
[dbltest@erpdev DBLTEST]$  .<INSTALL_BASE>/EBSapps.env run

      2. Stop the Oracle Weblogic Admin Server and Node Manager services.
Applying the patch in downtime mode requires all application tier services to be down. Therefore, WeblogicAdminServer and Node Manager that were started previously when applying the latest Release Update Packs for AD and TXK for Release 12.2 need to be shut down.

a)       Stop the Oracle Weblogic Admin Server on the run file system.
 [dbltest@erpdev DBLTEST]$  sh $ADMIN_SCRIPTS_HOME/adadminsrvctl.sh stop
b)      Stop the Node Manager service on the run file system.
[dbltest@erpdev DBLTEST]$  sh $ADMIN_SCRIPTS_HOME/adnodemgrctl.sh stop


 3. Apply Oracle E-Business Suite 12.2.9 Release Update Pack Patch 28840850 on the run edition application environment, using downtime mode.
 [dbltest@erpdev DBLTEST]$  adop phase=apply apply_mode=downtime patches=28840850 workers=8

   4.Start all application tier services on the run file system.
 [dbltest@erpdev DBLTEST]$  sh $ADMIN_SCRIPTS_HOME/adstrtal.sh

   5. Perform adop cleanup action.
             [dbltest@erpdev DBLTEST]$  adop phase=cleanup

   6. Synchronize file systems
Synchronize the file systems using the command shown below. This action will copy the new run edition code and configuration to the other file system, to ensure that both file systems are in sync before applying patches using the regular adop cycle on the other file system.
            
            [dbltest@erpdev DBLTEST]$  adop phase=fs_clone

14.   Post-Update Steps


      1. Apply Oracle E-Business Suite Release 12.2.6 Online Help Patch 28840850 using adop hotpatch mode on the run file system.

[dbltest@erpdev DBLTEST]$ . /u01/DBLTEST/EBSapps.env run
[dbltest@erpdev DBLTEST]$ adop phase=apply patches=28840850 hotpatch=yes

      2.  Perform 2 Cycle of Prepare and Cutover phase as follows,

[dbltest@erpdev DBLTEST]$ . /u01/DBLTEST/EBSapps.env run
[dbltest@erpdev DBLTEST]$  adop phase=prepare, cutover
[dbltest@erpdev DBLTEST]$ . /u01/DBLTEST/EBSapps.env run
[dbltest@erpdev DBLTEST]$  adop phase=prepare, cutover

      3. Inventory migration to Central Inventory

[dbltest@erpdev DBLTEST]$ . /u01/DBLTEST/EBSapps.env run
[dbltest@erpdev ~]$  cd $ADMIN_SCRIPTS_HOME
[dbltest@erpdev ~]$  adstpall.sh apps/apps
 [dbltest@erpdev DBLTEST]$ echo $CONTEXT_FILE
/u01/DBLTEST/fs1/inst/apps/dbltest_erpdev/appl/admin/dbltest_erpdev.xml
Edit the context file and set the value of the context variable s_ebs_central_inventory to 'true'.
[dbltest@erpdev scripts]$ ./adautocfg.sh
[dbltest@erpdev scripts]$ echo $FND_TOP
/u01/DBLTEST/fs1/EBSapps/appl/fnd/12.0.0
[dbltest@erpdev scripts]$  perl <FND_TOP>/patch/115/bin/txkMigrateInventory.pl -contextfile=<CONTEXT_FILE>
Ensure that all application tier Oracle Homes have been migrated to the EBS Installation Central Inventory.

      4.  Update Database Util File Directory Location and Database Parameter: -

               [dbltest@erpdev ~]$  mkdir –p  /u01/DBLTEST/temp
               [dbltest@erpdev ~]$  sql> create pfile from spfile ;
                                update pfile util_file_dir parameter with new location
                                util_file_dir=/u01/DBLTEST/temp
                                 processes 1000
                                 sessions 1536
                                 sga_target 5G
                                 pga_aggregate_target 3G
                                 open cursors 1000
               [dbltest@erpdev ~]$  sql> startup pfile=’$ORACLE_HOME/dbs/initdbltest.ora’ ;
               [dbltest@erpdev ~]$  sql> shutdown immediate;  
               [dbltest@erpdev ~]$  sql> startup;
               [dbltest@erpdev ~]$  cd $ORACLE_HOME/appsutil/scripts/dbltest_erpdev      
               [dbltest@erpdev ~]$  adautocfg.sh

15.   Startup /Shutdown Steps


Startup DB and APPS TIER

[dbltest@erpdev ~]$  cd /u01/DBLTEST/12.1.0
[dbltest@erpdev ~]$  . *.env
[dbltest@erpdev ~]$  cd /u01/DBLTEST/12.1.0/appsutil/scripts/dbltest_erpdev
[dbltest@erpdev ~]$  addbctl.sh start
[dbltest@erpdev ~]$  addlnctl.sh start dbltest

[dbltest@erpdev ~]$  cd /u01/DBLTEST
[dbltest@erpdev ~]$  . .EBSapps.env run
[dbltest@erpdev ~]$  cd $ADMIN_SCRIPTS_HOME
[dbltest@erpdev ~]$  adstrtal.sh apps/apps777
Enter the WebLogic Server password: weblogic098

Shutdown APPS and DB TIER

[dbltest@erpdev ~]$  cd /u01/DBLTEST
[dbltest@erpdev ~]$  . .EBSapps.env run
[dbltest@erpdev ~]$  cd $ADMIN_SCRIPTS_HOME
[dbltest@erpdev ~]$  adstpall.sh apps/apps777
Enter the WebLogic Server password: weblogic098

[dbltest@erpdev ~]$  cd /u01/DBLTEST/12.1.0
[dbltest@erpdev ~]$  . *.env
[dbltest@erpdev ~]$  cd /u01/DBLTEST/12.1.0/appsutil/scripts/dbltest_erpdev
[dbltest@erpdev ~]$  addbctl.sh stop immediate
[dbltest@erpdev ~]$  addlnctl.sh stop dbltest