10 November, 2017

R12.2 ONLINE PATCHING (ADOP) QUESTIONS

Q1
WHAT IS THE CONCEPT OF ADOP?
A1
Online patching is the most important new feature in Oracle E-Business Suite Release 12.2. It is the ability to patch a running system without having to take the system down for a significant period of time while the patches are applied.
‘adop’ is the utility you use to apply patches in R12.2

Q2
WHAT IS PATCH TOP DIRECTORY IN R12.2?
A2
In R12.2 there is a new directory location environment variable called $PATCH_TOP which points to $NE_BASE/EBSapps/patch
$NE_BASE points to <Non-Editioned-filesystem-directory>
Download the patch into the patch top directory and unzip it. This is the default location where the adop will look for patch files.
If you are planning to put patches in non-defualt location then you need to use adop parameter ‘patchtop=<patch_path>’ to explicitly define this location.


Q3
HOW IS PATCH MERGING DONE IN ADOP? IS ADMRGPCH COMMAND USED IN EARLIER EBS RELEASES STILL VALID IN R12.2?
A3
In earlier EBS releases, the AD Merge Patch tool was used to merge multiple patches into a single patch, so that the common tasks only needed to be performed once.
In Oracle EBS 12.2, all the functionality of AD Merge Patch has been included in the adop patching tool itself.
By default, adop will automatically merge all patches specified with the ‘patches’ parameter.
You can still use earlier AD Merge Patch tool but you should disable adop’s merging of patches, by adding to the adop command line > ‘merge=no’


Q4
WHAT HAPPENS WHEN ADOP COMMAND IS RUN?
A4
adop will perform all the tasks required to apply the patch:
> Reads patch metadata to determine patch dependencies and requirements
> Attempt to recover previously failed patching session (if any)
> Reads and validate the patch/product driver files
> Compares version numbers of existing files against the patch files and Backs up all existing files that will be changed by the patch
> Copies files
> Archive files in libraries
> Relinks executables, Generates forms, reports, messages, graphics, and Java archive (JAR) files
> Compiles JSP files and invalid database objects. Updates database objects
> Runs AutoConfig if required
> Saves patch information to the database
All tasks are similar to what adpatch utility used to do earlier.


Q5
FROM WHICH FILESYSTEM ADOP COMMAND SHOULD BE RUN?
A5
We always run adop utility from the run edition file system. The adop process automatically sets its environment correctly, regardless of the edition it is run from.

EBS R12.2 OS ENVIRONMENT VARIABLES

Below are some of the important Operating system level environment variables  related to R12.2.
$ echo $FILE_EDITION
<shows which file edition you are using, run or patch>

$ echo $RUN_BASE
<shows absolute path to run file system>

$ echo $PATCH_BASE
<shows absolute path to patch file system>

$ echo $NE_BASE
<shows absolute path to non-edition file system>

$ echo $APPL_TOP_NE
<non-editioned appl_top path. Equivalent to $NE_BASE/EBSapps/appl>

$ echo $LOG_HOME
<Application Instance Specific Log Directory>

$ echo $ADOP_LOG_HOME
<Online patching Specific Log Directory. Equivalent to $NE_BASE/EBSapps/log/adop>

$ echo $IAS_ORACLE_HOME
<FMW Web Tier Home Directory>

$ echo $ORACLE_HOME
< 10.1.2 ORACLE_HOME>

$ echo $CONTEXT_FILE
<Source for information populating template files (autoconfig)>

$ echo $EBS_DOMAIN_HOME
<WLS Deployment of Oracle E-Business Suite 12.2 Domain (instance specific)>

$ echo $ADMIN_SCRIPTS_HOME
<Shell scripts to control processes associated to the Applications Instance>

$ echo $EBS_ORACLE_HOME
<Oracle E-Business Suite 12.2 FMW Deployment directory>

$ echo $RW
<10.1.2 reports directory>

$ echo $HOSTNAME
<hostname without domain name>

$ echo $APPS_VERSION
<to get the EBS version>

And the most important part is for setting up the right environment don’t directly hard code the RUN environemnt .env file in the .profile of OS user as online patching switches the filesystem from RUN to PATCH and vice versa and it can really create confusion.
Instead use EBSapps.env environment file (created under BASE directory) with ‘RUN’ as argument. It will automatically find which file system (fs1 or fs2) is currently RUN file system. it will then serach the correct ENV file under $APPL_TOP of RUN/PATCH (whatever you asked for) and lay out the correct environment.
So EBSapps.env is third ENV file besides the ENV files under PATCH and RUN APPL_TOPs. EBSapps.env file internally will point to the correct ENV file based on your needs.
For example, in our case base directory is ‘/u01/oracle/dba’
. /u01/oracle/dba/EBSapps.env RUN
It will set environemnt and display below information on screen.
E-Business Suite Environment Information
 —————————————-
 RUN File System : /u01/oracle/dba/fs2/EBSapps/appl
 PATCH File System : /u01/oracle/dba/fs1/EBSapps/appl
 Non-Editioned File System : /u01/oracle/dba/fs_ne
 DB Host: dbhost.hertz.com Service/SID: dba
 Sourcing the RUN File System …

23 June, 2017

ORA-00845: MEMORY_TARGET not supported on this system

I have encountered below error for my new database while startup the database.

SQL> startup;
ORA-00845: MEMORY_TARGET not supported on this system
 
Cause : ORA-00845: MEMORY_TARGET not supported on this system

Action:  You will get a ORA-00845 error if your shared memory file system is not big enough to accommodate memory_target and memory_max_target. There are two possible ways to remove the ORA-00845 error:

       - Reduce the value for the memory_target parameter
       - Increase the temporary memory allocation on the server.  This should fix the ORA-00845 error:


# umount tmpfs
# mount -t tmpfs shmfs -o size=1500m /dev/shm



Before:


[root@rsvmsb076 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G  1.9G  2.1G  49% /dev/shm
tmpfs           3.9G  8.4M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/xvda3      9.6G  3.6G  5.2G  41% /
/dev/xvdc1      337G  8.3G  311G   3% /u01
/dev/xvda1      497M  231M  267M  47% /boot
tmpfs           799M     0  799M   0% /run/user/1000
tmpfs           799M     0  799M   0% /run/user/0
 

[root@rsvmsb076 ~]# mount -t tmpfs shmfs -o size=7g /dev/shm
 
After :

[root@rsvmsb076 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
shmfs           7.0G     0  7.0G   0% /dev/shm
tmpfs           3.9G  8.4M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/xvda3      9.6G  3.6G  5.2G  41% /
/dev/xvdc1      337G  8.3G  311G   3% /u01
/dev/xvda1      497M  231M  267M  47% /boot
tmpfs           799M     0  799M   0% /run/user/1000
tmpfs           799M     0  799M   0% /run/user/0

 

After increasing the temporary memory allocation on the server, this issue got resolved.

Now i am able to start the database without any issue.

SQL> startup;
ORACLE instance started.

Total System Global Area 3355443200 bytes
Fixed Size                  2929936 bytes
Variable Size            1929382640 bytes
Database Buffers         1409286144 bytes
Redo Buffers               13844480 bytes
Database mounted.
Database opened.
SQL>
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
TEST2     READ WRITE

ORA-01102: cannot mount database in EXCLUSIVE mode

I have encountered ORA-01102: cannot mount database in EXCLUSIVE mode error while starting new database.


SQL> startup;
ORACLE instance started.
Total System Global Area 3355443200 bytes
Fixed Size                  2929936 bytes
Variable Size            1929382640 bytes
Database Buffers         1409286144 bytes
Redo Buffers               13844480 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode



Cause : Some other instance has the database mounted exclusive or shared.


Action: Shut down other instance or mount in a compatible mode 


ORA-01102 occurs when you are mounting(opening) database , typically because another instance is already opened in parallel (exclusive) mode.

I have noticed 2 instances are running


[oracle@rsvmsb075 ~]$ ps -ef | grep pmon
oracle    1154     1  0 Jun21 ?        00:00:06 ora_pmon_test1
oracle   15652     1  0 21:17 ?        00:00:00 ora_pmon_TEST1
oracle   15759 15626  0 21:20 pts/0    00:00:00 grep pmon

Stopped 2 instances and modified .bash_profile correctly.


Now i am able to start the database without any issues .

SQL> startup;
ORACLE instance started.

Total System Global Area 3355443200 bytes
Fixed Size                  2929936 bytes
Variable Size            1929382640 bytes
Database Buffers         1409286144 bytes
Redo Buffers               13844480 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
TEST1     READ WRITE


28 May, 2017

How to check RMAN backup channels

set lines 200
set pages 200


select s.sid,p.spid,s.client_info
from v$process p, v$session s
where p.addr = s.paddr and client_info like '%rman%';



       SID SPID                     CLIENT_INFO
---------- ------------------------ ---------------------------
      1187 20672                    rman channel=ORA_DISK_5
      1224 20673                    rman channel=ORA_DISK_6
      1628 20674                    rman channel=ORA_DISK_7
       268 20667                    rman channel=ORA_DISK_1
       656 20668                    rman channel=ORA_DISK_2
       844 20669                    rman channel=ORA_DISK_3
       962 20671                    rman channel=ORA_DISK_4
      1665 20685                    rman channel=ORA_DISK_8
      2087 20731                    rman channel=ORA_DISK_13
      2386 20692                    rman channel=ORA_DISK_9
      2536 20705                    rman channel=ORA_DISK_10
      2723 20710                    rman channel=ORA_DISK_11
       875 20719                    rman channel=ORA_DISK_12
      2220 20732                    rman channel=ORA_DISK_14
      2625 20733                    rman channel=ORA_DISK_15
      2667 20738                    rman channel=ORA_DISK_16

16 rows selected.


22 April, 2017

Script to gather the Apache, WLS and Apps log files

#####################################################################################
#### Start of script for EBS 12.1.x
#####################################################################################
(
# pick up files which have been modified
HowManyDaysOld=3
echo "Picking up files which have been modified in the last ${HowManyDaysOld} days"
set -x
find $LOG_HOME/ora/10.1.3 -type f -mtime -${HowManyDaysOld} > m.tmp
find $LOG_HOME/appl/admin -type f -mtime -${HowManyDaysOld} >> m.tmp
find $LOG_HOME/appl/rgf -type f -mtime -${HowManyDaysOld} >> m.tmp
zip -r AppsLogFiles_`hostname`_`date '+%m%d%y'`.zip -@ < m.tmp
rm m.tmp
) 2>&1 | tee mzLogZip.out
#####################################################################################
#### End of script
#####################################################################################

18 April, 2017

Script to List Materialized Views Dependent on Specific Tables

This script will report on any materialized views that are dependent on a specific table.

REM LOCATION:   Object Management\Materialized Views and Materialized View Logs
REM FUNCTION:   Find dependent tables for a given MView
REM TESTED ON:  10.2.0.3, 11.1.0.6
REM PLATFORM:   non-specific
REM REQUIRES:   dbms_metadata
REM
REM  This is a part of the Knowledge Xpert for Oracle Administration library.
REM  Copyright (C) 2008 Quest Software
REM  All rights reserved.
REM
REM ******************** Knowledge Xpert for Oracle Administration ********************
UNDEF ENTER_OWNER_NAME
UNDEF ENTER_TABLE_NAME
SET serveroutput on
SET feedback off

DECLARE
   v_output   VARCHAR2 (2000);
   v_owner    VARCHAR2 (30);
   v_table    VARCHAR2 (30);
BEGIN
   v_owner := UPPER ('&&ENTER_OWNER_NAME');
   v_table := UPPER ('&&ENTER_TABLE_NAME');
   dbms_mview.get_mv_dependencies (v_owner || '.' || v_table, v_output);
   DBMS_OUTPUT.put_line (CHR (13));
   DBMS_OUTPUT.put_line
      ('Materialized Views Dependent on table      &&ENTER_OWNER_NAME..&&ENTER_TABLE_NAME'
      );
   DBMS_OUTPUT.put_line (CHR (13));
   DBMS_OUTPUT.put_line (v_output);
END;
/
 
 

Sample Output

 

Materialized Views Dependent on table      SCOTT.EMP

"SCOTT"."MV_TEST","SCOTT"."MV_EMP" 
 
 
 
or
 
 
 
select * from dba_dependencies where referenced_name='MSC_TRADING_PARTNERS' and TYPE='MATERIALIZED VIEW'; 

 

Finding OPP Manager log for a concurrent request

=> Use below query to find the OPP manager log for a concurrent request.  SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.lo...