Patch EM13c

After installing EM13c, you may want to install the latest patches as well. We’ll start with OPatch and OMSPatcher.

Download the following patches from Oracle Support:

p6880880_139000_Generic.zip => OPatch
p19999993_132000_Generic.zip => OMSPatch

Go to your patching staging area:

cd /app/oracle/media/patches
unzip p6880880_139000_Generic.zip

Check the existing versions:

[oracle@oms13c]$ $OMS_HOME/OMSPatcher/omspatcher version
OMSPatcher Version: 13.8.0.0.0
OPlan Version: 12.1.0.2.2
OsysModel build: Mon Dec 21 18:31:52 PST 2015
OMSPatcher succeeded.
[oracle@oms13c]$ $OMS_HOME/OPatch/opatch version
OPatch Version: 13.8.0.0.0
OPatch succeeded.
[oracle@oms13c]$
[oracle@oms13c]$ $AGENT_HOME/OPatch/opatch version
OPatch Version: 13.8.0.0.0
OPatch succeeded.
[oracle@oms13c agent_13.2.0.0.0]$ 

Now, let’s take some backups before deploying the new patch version:

cd $OMS_HOME
[oracle@oms13c]$ mv OMSPatcher OMSPatcher.OLD
[oracle@oms13c]$ mv OPatch OPatch.OLD

Upgrade the OPatch on 13.2 OMS Home :

[oracle@oms13c]$ /app/oracle/em13c/oracle_common/jdk/bin/java -jar /app/oracle/media/patches/6880880/opatch_generic.jar -silent oracle_home=/app/oracle/em13c/
Launcher log file is /tmp/OraInstall2018-05-24_09-45-32AM/launcher2018-05-24_09-45-32AM.log.
Extracting the installer . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2596.992 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 2047 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 1954 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2018-05-24_09-45-32AM
Installation Summary
Disk Space : Required 26 MB, Available 31,479 MB

Feature Sets to Install:
 Next Generation Install Core 13.9.1.0.1
 OPatch 13.9.1.3.0
 OPatch Auto OPlan 13.9.1.0.0
Session log file is /tmp/OraInstall2018-05-24_09-45-32AM/install2018-05-24_09-45-32AM.log
Loading products list. Please wait.
 1%
 40%
Loading products. Please wait.
 42%
 43%
 44%
 45%

.........

S_COMP_INPROGRESS_SAVE_INVENTORY
 Component : oracle.glcm.opatchauto.core.actions.classpath
S_COMP_INPROGRESS_SAVE_INVENTORY
 Component : oracle.glcm.opatchauto.core.wallet.classpath
S_COMP_INPROGRESS_SAVE_INVENTORY
Logs successfully copied to /app/oraInventory/logs.

Now let’s check the version:

[oracle@oms13c]$ $OMS_HOME/OPatch/opatch version
OPatch Version: 13.9.1.3.0
OPatch succeeded.
[oracle@oms13c]$

Upgrade the OPatch on 13.2 Agent Home

Stop the agent

./emctl stop agent

Let’s make a backup of OPatch:

cd $AGENT_HOME

mv OPatch OPatch.OLD

Run the patch:

[oracle@oms13c]$ /app/oracle/em13c/agent/jdk/bin/java -jar /app/oracle/media/patches/6880880/opatch_generic.jar -silent oracle_home=/app/oracle/em13c/agent13c

Launcher log file is /tmp/OraInstall2018-05-24_09-56-56AM/launcher2018-05-24_09-56-56AM.log.
Extracting the installer . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2596.992 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 2047 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 1954 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2018-05-24_09-56-56AM
Installation Summary
Disk Space : Required 26 MB, Available 31,373 MB
Feature Sets to Install:
 Next Generation Install Core 13.9.1.0.1
 OPatch 13.9.1.3.0
 OPatch Auto OPlan 13.9.1.0.0
Session log file is /tmp/OraInstall2018-05-24_09-56-56AM/install2018-05-24_09-56-56AM.log
Loading products list. Please wait.
 1%
 40%
Loading products. Please wait.
 42%
 43%
 44%

......

S_COMP_INPROGRESS_SAVE_INVENTORY
 Component : oracle.glcm.opatchauto.core.wallet.classpath
S_COMP_INPROGRESS_SAVE_INVENTORY
 Component : jsch.lib
S_COMP_INPROGRESS_SAVE_INVENTORY
Logs successfully copied to /app/oraInventory/logs.

Check the version

[oracle@oms13c]$ $AGENT_HOME/OPatch/opatch version
OPatch Version: 13.9.1.3.0
OPatch succeeded.
[oracle@oms13c]$

Start the agent

./emctl start agent

Install OMS Patcher:

This is done in the traditional way:

unzip p19999993_132000_Generic.zip -d $OMS_HOME

Check now the OPatch version

[oracle@oms13c]$ $OMS_HOME/OMSPatcher/omspatcher version
OMSPatcher Version: 13.8.0.0.2
OPlan Version: 12.2.0.1.6
OsysModel build: Tue Apr 04 07:25:39 UTC 2017
OMSPatcher succeeded.

 

OMS Patch OMS-patch-25841652 ( p25841652_132000_Generic.zip)

unzip p25841652_132000_Generic.zip -d OMS-patch-25841652

Stop OMS (but keep the weblogic components up):

[oracle@oms13c]$ ./emctl stop oms
Oracle Enterprise Manager Cloud Control 13c Release 2 
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
Stopping Oracle Management Server...
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
JVMD Engine is Down
[oracle@oms13c]$ ./emctl status oms
Oracle Enterprise Manager Cloud Control 13c Release 2 
Copyright (c) 1996, 2016 Oracle Corporation.  All rights reserved.
WebTier is Up
Oracle Management Server is Down
JVMD Engine is Down
BI Publisher Server is Up
[oracle@oms13c]$ 

Go to the folder where u have unzipped the patch and run the analyzer:

cd /app/oracle/media/patches/OMS-patch-25841652/25841652
[oracle@oms13c 25841652]$ $OMS_HOME/OMSPatcher/omspatcher apply -analyze OMSPatcher.OMS_DISABLE_HOST_CHECK=true
OMSPatcher Automation Tool
Copyright (c) 2017, Oracle Corporation.  All rights reserved.
OMSPatcher version : 13.8.0.0.2
OUI version        : 13.9.1.0.0
Running from       : /app/oracle/em13c
Log file location  : /app/oracle/em13c/cfgtoollogs/omspatcher/opatch2018-05-24_11-52-32AM_1.log
OMSPatcher log file: /app/oracle/em13c/cfgtoollogs/omspatcher/25841652/omspatcher_2018-05-24_11-52-38AM_analyze.log
Please enter OMS weblogic admin server URL(xxxxxxx:xxxx):> 
Please enter OMS weblogic admin server username(xxxxxxxxx):> 
Please enter OMS weblogic admin server password:> 
WARNING: Could not apply the patch "25414328" because the "oracle.sysman.vi.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
WARNING: Could not apply the patch "25414306" because the "oracle.sysman.emfa.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
WARNING: Could not apply the patch "25118889" because the "oracle.sysman.vt.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
WARNING: Could not apply the patch "25414263" because the "oracle.sysman.csm.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
WARNING: Could not apply the patch "25580681" because the "oracle.sysman.ssa.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
WARNING: Could not apply the patch "25414356" because the "oracle.sysman.smf.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
Configuration Validation: Success

Running apply prerequisite checks for sub-patch(es) "25414294,25414339,25414245,25765741,25739957" and Oracle Home "/app/oracle/em13c"...

Sub-patch(es) "25414294,25414339,25414245,25765741,25739957" are successfully analyzed for Oracle Home "/app/oracle/em13c"

Complete Summary

================

All log file names referenced below can be accessed from the directory "/app/oracle/em13c/cfgtoollogs/omspatcher/2018-05-24_11-52-32AM_SystemPatch_25841652_1"

Prerequisites analysis summary:

-------------------------------

The following sub-patch(es) are applicable:

             Featureset                                    Sub-patches                                                                         Log file
             ----------                                    -----------                                                                         --------
  oracle.sysman.top.oms   25414294,25414339,25414245,25765741,25739957   25414294,25414339,25414245,25765741,25739957_opatch2018-05-24_11-52-37AM_1.log

The following sub-patches are incompatible with components installed in the OMS system:
25414328,25414306,25118889,25414263,25580681,25414356

--------------------------------------------------------------------------------
The following warnings have occurred during OPatch execution:
1)  Could not apply the patch "25414328" because the "oracle.sysman.vi.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
2)  Could not apply the patch "25414306" because the "oracle.sysman.emfa.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
3)  Could not apply the patch "25118889" because the "oracle.sysman.vt.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
4)  Could not apply the patch "25414263" because the "oracle.sysman.csm.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
5)  Could not apply the patch "25580681" because the "oracle.sysman.ssa.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
6)  Could not apply the patch "25414356" because the "oracle.sysman.smf.oms.plugin with version 13.2.1.0.0" core component of the OMS or the plug-in for which the patch is intended is either not deployed or deployed with another version in your Enterprise Manager system.
--------------------------------------------------------------------------------
OMSPatcher Session completed with warnings.
Log file location: /app/oracle/em13c/cfgtoollogs/omspatcher/25841652/omspatcher_2018-05-24_11-52-38AM_analyze.log

OMSPatcher completed with warnings.
[oracle@oms13c 25841652]$ 

Ignore these errors and move on with deploying the patch:

$OMS_HOME/OMSPatcher/omspatcher apply OMSPatcher.OMS_DISABLE_HOST_CHECK=true

After it’s finished:

$OMS_HOME/OMSPatcher/omspatcher lspatches

Start OMS:

./emctl start oms

 

 

 

 

 

Advertisements

Install EM13c in silent mode

Suppose you have already the server created.

As root user install the necessary packages for EM13c:

yum install make -y
yum install binutils -y
yum install gcc -y
yum install libaio -y
yum install glibc-common -y
yum install libstdc++ -y
yum install libXtst -y
yum install sysstat -y
yum install glibc -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y

Create the necessary folders (as oracle)

mkdir –p /app/oraInventory
mkdir -p /app/oracle/em13c/middleware
mkdir -p /app/oracle/em13c/agent13c
mkdir -p /app/oracle/em13c/gc_inst
mkdir -p /app/oracle/em13c/swlib

Run the installer (if you don’t have enough tmp space one can use  J-Djava.io.tmpdir=

Don’t forget to make the em13200_linux64.bin executable: 

chmod u+x em13200_linux64.bin

If you don’t have enough tmp space don’t forget to create the path where you have space:

mkdir -p /app/em13-temp

Get the response file and edit it:

[oracle@oms13c]$  ./em13200_linux64.bin -J-Djava.io.tmpdir=/app/em13-temp -getResponseFileTemplates -outputLoc /app/oracle/media

0%.........................................................................100%

Launcher log file is /app/em13-temp/OraInstall2018-05-23_10-10-54AM/launcher2018-05-23_10-10-54AM.log.

Copying response file template(s)

to /app2/oracle/media ...

  Copying response file template software_only.rsp

  Copying response file template new_install.rsp

  Copying response file template upgrade.rsp

Finished copying response file template(s)

The log(s) can be found here: /app/em13-temp/OraInstall2018-05-23_10-10-54AM.

Make a copy of it and make sure u remove all the “” :

cp new_install.rsp my_new_install.rsp
vi my_new_install.rsp

Now you’re good to run the installer and wait for about 2h 🙂 :

[oracle@oms13c]$./em13200_linux64.bin -J-Djava.io.tmpdir=/app/em13-temp -silent -ignoreSysPrereqs -responseFile /responsefile-location/my_new_install.rsp

How to get the response file for a silent install of EM13c

[oracle@oms13c]$  ./em13200_linux64.bin -J-Djava.io.tmpdir=/app/em13-temp -getResponseFileTemplates -outputLoc /app/oracle/media

0%.........................................................................100%

Launcher log file is /app/em13-temp/OraInstall2018-05-23_10-10-54AM/launcher2018-05-23_10-10-54AM.log.

Copying response file template(s)

to /app2/oracle/media ...

  Copying response file template software_only.rsp

  Copying response file template new_install.rsp

  Copying response file template upgrade.rsp

Finished copying response file template(s)

The log(s) can be found here: /app/em13-temp/OraInstall2018-05-23_10-10-54AM.

X11 connection rejected because of wrong authentication.

This is a nice one, while you’re configuring the ssh port forwarding to get your display from the source server onto destination server using SUDO.

In case you don’t know the oracle user’s password on the destination server, but you have sudo privilege, you’re going to do something like this:

On the source:
Change the X11Forwarding from NO to YES in the following file /etc/ssh/sshd_config

ssh server1 -X (using your local user)

On the destination server you get this:

/usr/bin/xauth: file /home/localuser/.Xauthority does not exist
 [localuser@server1 ~]$ ls -l /home/localuser/.Xauthority
 -rw-------. 1 localuser localuser 83 Jan 14 08:41 /home/localuser/.Xauthority
 [localuser@server1 ~]$ xclock

But now you would like to sudo as oracle user and you’ll get this:

[localuser@server1 ~]$ sudo su - oracle
 Last login: Mon Jan 14 03:09:02 UTC 2018
 [oracle@server1 ~]$ xclock
 Error: Can't open display:
 [oracle@server1 ~]$ export DISPLAY=localhost:10.0
 [oracle@server1 ~]$ xclock
 X11 connection rejected because of wrong authentication.
 Error: Can't open display: localhost:10.0
 [oracle@server1 ~]$ exit

One of the solutions would be this:

The reason for not being able to open the display is because on the user oracle we don’t have the same .Xauthority file. So we’re going to add it:

localuser@server1 ~]$ xauth list
 server1/unix:10 MIT-MAGIC-COOKIE-1 0ee9eda295cad0ba2913f8d9df5c61d
-- as oracle user do this:
oracle@server1 ~]$ xauth add server1/unix:10 MIT-MAGIC-COOKIE-1 0ee9eda295cad0ba2913f8d9df5c61d

Problem solved.

List all running jobs

SET PAUSE ON
SET PAUSE 'Press Return to Continue'
SET PAGESIZE 60
SET LINESIZE 300
SET VERIFY OFF
 
SELECT a.job "Job",
       a.sid,
       a.failures "Failures",       
       Substr(To_Char(a.last_date,'DD-Mon-YYYY HH24:MI:SS'),1,20) "Last Date",      
       Substr(To_Char(a.this_date,'DD-Mon-YYYY HH24:MI:SS'),1,20) "This Date"             
FROM   dba_jobs_running a
/