Search In The Blog

Saturday 8 April 2017

How to drop pluggable database from CDB

How to drop pluggable database from CDB


We have running below pluggable database under container database. Out of all this pluggable database we want to drop only one pluggable database MY_UNIFIED_TEST.

SQL > show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
       115 MUMBAI                          READ WRITE NO
       116 DELHI                          READ WRITE NO
       119 PUNE                          READ WRITE NO
       123 GOA                          READ WRITE NO
       129 MY_UNIFIED_TEST                READ WRITE NO


First as good database administrator we need to consider for the backup for the future use. So take the export backup or rman backup of the pluggable database MY_UNIFIED_TEST.

nohup expdp system/Welcome1@<hostname>:1521/my_unified_test directory=expmy_unified_test dumpfile=my_unified_test_06Apr2017_%U.dmp logfile=my_unified_test_06Apr2017log LOGTIME=ALL CLUSTER=NO CONTENT=ALL FULL=Y parallel=5 &


To drop the pluggable database, the pdb should be closed or unplugged. After completion of the backup kindly close the database.
You can’t drop PDB$SEED pluggable database.

Connect to the container database and execute below statement.

SQL> ALTER PLUGGABLE DATABASE MY_UNIFIED_TEST CLOSE IMMEDIATE;

Pluggable database closed.

SQL>


Check the status of the pdb.
SQL > show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
       115 MUMBAI                          READ WRITE NO
       116 DELHI                          READ WRITE NO
       119 PUNE                          READ WRITE NO
       123 GOA                          READ WRITE NO
       129 MY_UNIFIED_TEST                MOUNT     NO


The OPEN MODE of the pluggable database is MOUNT so you can now go ahead and drop the pdb.




If you want to check what are the different ways to connect pluggbale database





There are two ways to drop the pluggable database.
1)  “KEEP DATAFILES” - By keeping the datafiles associated with pdb. The tempfiles will get dropped associated with this pdb.
2)  “INCLUDING DATAFILES” – all datafiles and tempfiles associated with the pdb get dropped.

Here we used INCLUDING DATAFILES as we want to release the space from the ASM too.


SQL> DROP PLUGGABLE DATABASE MY_UNIFIED_TEST INCLUDING DATAFILES;

Pluggable database dropped.

SQL>



You should monitor the alert log of the container database.

Alert log of cdb –
Thu Apr 06 19:17:05 2017
alter pluggable database MY_UNIFIED_TEST open
Thu Apr 06 19:17:06 2017
Database Characterset for MY_UNIFIED_TEST is WE8MSWIN1252
Opening pdb MY_UNIFIED_TEST (129) with no Resource Manager plan active
Pluggable database MY_UNIFIED_TEST opened read write
Completed: alter pluggable database MY_UNIFIED_TEST open
alter pluggable database MY_UNIFIED_TEST close immediate
Thu Apr 06 19:17:59 2017
ALTER SYSTEM: Flushing buffer cache inst=1 container=129 local
Thu Apr 06 19:18:13 2017
Pluggable database MY_UNIFIED_TEST closed
Completed: alter pluggable database MY_UNIFIED_TEST close immediate
DROP PLUGGABLE DATABASE MY_UNIFIED_TEST INCLUDING DATAFILES
Thu Apr 06 19:36:41 2017
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.769.924274035
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.823.924274011
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.2416.924273987
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.2413.924273963
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.1332.929269035
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.1071.929269013
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.1070.929268991
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_portal.480.929268965
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/users.2046.924273177
Thu Apr 06 19:36:52 2017
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/TEMPFILE/temp.2474.924273171
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/sysaux.2473.924273169
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/system.2472.924273169
Deleted Oracle managed file +DATA/MYCDB/3DF334A2FE653A71E053720B4B0A32BC/DATAFILE/unified_indx.1424.931619925
Completed: DROP PLUGGABLE DATABASE MY_UNIFIED_TEST INCLUDING DATAFILES



Check the status now.

SQL > show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
       115 MUMBAI                          READ WRITE NO
       116 DELHI                          READ WRITE NO
       119 PUNE                          READ WRITE NO
       123 GOA                          READ WRITE NO


I hope this exercise will help you.



Tuesday 4 April 2017

How to rollback patch from EM management agent 12c

How to rollback patch from EM management agent 12c


Here we are performing the rollback patch from EM management agent in EM12c.

Please follow below steps to apply patch on EM agent - 


[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ export ORACLE_HOME=/u01/oraem12c/agent12c/core/12.1.0.4.0
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ export PLUGIN_HOME=/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ emctl status agent
-bash: emctl: command not found
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 20717
Parent Process ID      : 20630
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-04-03 14:33:15
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 295
Size of XML files pending upload(MB)         : 0.42
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status       : OMS responded illegally [ERROR- Failed to update Target type Metadata]
Last attempted heartbeat to OMS              : 2017-04-03 15:23:39
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-04-03 15:24:10

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl stop agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Stopping agent ..... stopped.
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ $ORACLE_HOME/OPatch/opatch rollback -id 22068912 -oh $PLUGIN_HOME^C
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ echo $PLUGIN_HOME
/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ $ORACLE_HOME/OPatch/opatch rollback -id 22068912 -oh $PLUGIN_HOME
Oracle Interim Patch Installer version 11.1.0.10.4
Copyright (c) 2017, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
Central Inventory : /u01/app/oraInventory
   from           : /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0/oraInst.loc
OPatch version    : 11.1.0.10.4
OUI version       : 11.1.0.12.0
Log file location : /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0/cfgtoollogs/opatch/22068912_Apr_03_2017_15_25_11/rollback2017-04-03_15-25-11PM_1.log

RollbackSession rolling back interim patch '22068912' from OH '/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0'

Patching component oracle.sysman.vi.plugin.agent, 12.1.0.1.0...
RollbackSession removing interim patch '22068912' from inventory
Log file location: /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0/cfgtoollogs/opatch/22068912_Apr_03_2017_15_25_11/rollback2017-04-03_15-25-11PM_1.log

OPatch succeeded.
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Starting agent ............... started.
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : 12.1.0.4.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 105020
Parent Process ID      : 104922
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-04-03 15:25:38
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : 2017-04-03 15:25:55
Last attempted upload                        : 2017-04-03 15:25:55
Total Megabytes of XML files uploaded so far : 0.47
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2017-04-03 15:25:49
Last successful heartbeat to OMS             : 2017-04-03 15:25:49
Next scheduled heartbeat to OMS              : 2017-04-03 15:26:49

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$
[oraem12c@examyservdbadm1 ~]$ ps -ef | grep pmon
oracle    15668      1  0 Jan19 ?        00:15:03 ora_pmon_WEB1
oracle    40405      1  0  2016 ?        00:15:28 asm_pmon_+ASM1
oracle    42298      1  0  2016 ?        00:10:52 mdb_pmon_-MGMTDB
oraem12c 116133  92657  0 15:31 pts/4    00:00:00 grep pmon
oracle   263080      1  0 Feb27 ?        00:15:22 ora_pmon_FOIS1
[oraem12c@examyservdbadm1 ~]$





 pwd
/oragrid/oemcc/middleware/oms/bin
$

$ ./emcli login -username=sysman
Syntax Error: Unrecognized argument -username
Syntax Error: Too many positional arguments
    -- =sysman"
$
$ ./emcli login -username=sysman
Enter password :

Login successful
$ ./emcli list_plugins_on_server
OMS name is tfoisapp1:4889_Management_Service
Plug-in Name                                 Plugin-id                     Version [revision]

Oracle Engineered System Healthchecks        oracle.em.sehc                12.1.0.5.0
Oracle Tuxedo                                oracle.fmw.txdo               12.1.0.3.0
Oracle Cloud Framework                       oracle.sysman.cfw             12.1.0.1.0
Oracle Database                              oracle.sysman.db              12.1.0.6.0
Oracle Fusion Middleware                     oracle.sysman.emas            12.1.0.6.0
Oracle MOS (My Oracle Support)               oracle.sysman.mos             12.1.0.6.0
Oracle Virtual Infrastructure                oracle.sysman.vi              12.1.0.1.0
Oracle Virtualization                        oracle.sysman.vt              12.1.0.6.0
Oracle Exadata                               oracle.sysman.xa              12.1.0.6.0

$
$




How to apply patch on EM management agent 12c

How to apply patch on EM management agent 12c


Hello Everyone,

We have OEM 12c for monitoring our exadata environment. We experienced bug for the EM false alarm, so support advised to apply the patch on the EM agent.
BUG 21513052 - Intermittent false alerts report Oracle Virtual Server target as Down


High Level Plan -

The BUG has been fixed at agent side, please apply the Patch 22068912

Please follow readme instructions to apply the patch

To apply patches manually, follow these steps:

1.Run the following command to stop the Management Agent:

$ $ORACLE_HOME/bin/emctl stop agent

2.Maintain a location for storing the contents of the patch ZIP file. In the rest of the document, this location (absolute path) is referred to as <PATCH_TOP_DIR>.

3.Extract the contents of the patch ZIP file to the location you created in Step (1). To do so, run the following command:

$ unzip -d <PATCH_TOP_DIR> p22068912_121010_Generic.zip

4.Navigate to the <PATCH_TOP_DIR>/22068912 directory:

$ cd <PATCH_TOP_DIR>/22068912

5.Run the following commands to install the patch.

export ORACLE_HOME=/u01/oraem12c/agent12c/core/12.1.0.4.0

export PLUGIN_HOME=/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0

$ORACLE_HOME/OPatch/opatch apply -oh $PLUGIN_HOME

6.Start the Management Agent by running the following command:

$ $ORACLE_HOME/bin/emctl start agent


Actual Implementation –

[oraem12c@examyservdbadm1 tmp]$
[oraem12c@examyservdbadm1 tmp]$ cp p22068912_121010_Generic.zip /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/
[oraem12c@examyservdbadm1 tmp]$
[oraem12c@examyservdbadm1 tmp]$
[oraem12c@examyservdbadm1 tmp]$ cd /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ ls -lrt
total 196
-rw-r--r-- 1 oraem12c oinstall 199025 Apr  3 14:02 p22068912_121010_Generic.zip
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ chmod 777 p22068912_121010_Generic.zip
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : 12.1.0.4.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 197589
Parent Process ID      : 197468
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-03-17 13:18:09
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : 2017-04-03 14:03:14
Last attempted upload                        : 2017-04-03 14:03:14
Total Megabytes of XML files uploaded so far : 45.09
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2017-04-03 14:03:21
Last successful heartbeat to OMS             : 2017-04-03 14:03:21
Next scheduled heartbeat to OMS              : 2017-04-03 14:04:21

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl stop agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Stopping agent ..... stopped.
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent is Not Running
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ pwd
/u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ unzip -d /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912 p22068912_121010_Generic.zip
Archive:  p22068912_121010_Generic.zip
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/etc/
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/etc/config/
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/etc/config/actions.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/etc/config/inventory.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/README.html
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/dmCfgHardware.sh
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/compute_graphite_identifiers.pl
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/nimbula_test_service_post.pl
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/conditionContext.pl
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/dmGvmCfgDetails.sh
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/scripts/dmGvmLoad.sh
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/archives/
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/archives/em-vi-nimbulafetchlet-pojo.jar
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/archives/em-vi-dmfetchlet-pojo.jar
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/archives/em-vi-dmintegrationcore-pojo.jar
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_si_virtual_server.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_si_virtual_platform.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_nimbula_cluster.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_si_virtual_platform_nimbula_metrics.xmlp
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_si_server.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_si_server_nimbula_metrics.xmlp
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_nimbula_site.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/targetType/oracle_si_virtual_server_nimbula_metrics.xmlp
   creating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_si_virtual_server.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_si_virtual_platform.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_nimbula_cluster.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_si_virtual_server_nimbula_collection.xmlp
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_si_server.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_si_virtual_server_direct_collection.xmlp
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/files/default_collection/oracle_nimbula_site.xml
  inflating: /u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912/README.txt
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ ls -lrt
total 200
drwxr-xr-x 4 oraem12c oinstall   4096 Nov 11  2015 22068912
-rwxrwxrwx 1 oraem12c oinstall 199025 Apr  3 14:02 p22068912_121010_Generic.zip
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ cd 22068912
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ export ORACLE_HOME=/u01/oraem12c/agent12c/core/12.1.0.4.0
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ export PLUGIN_HOME=/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ cd /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
[oraem12c@examyservdbadm1 oracle.sysman.vi.agent.plugin_12.1.0.1.0]$
[oraem12c@examyservdbadm1 oracle.sysman.vi.agent.plugin_12.1.0.1.0]$ ls -lrt
total 56
-rw-r--r-- 1 oraem12c oinstall 4884 Mar 14  2014 plugin_registry.xml.tpl
-rw-r--r-- 1 oraem12c oinstall 4882 May 23  2014 plugin_registry.xml
-rw-r--r-- 1 oraem12c oinstall 2776 May 23  2014 plugin.xml
-rw-r----- 1 oraem12c oinstall   56 Mar  7  2016 oraInst.loc
drwxr-xr-x 2 oraem12c oinstall 4096 Nov  7 16:51 META-INF
drwxr-xr-x 2 oraem12c oinstall 4096 Nov  7 16:51 archives
drwxr-xr-x 2 oraem12c oinstall 4096 Nov  7 16:51 scripts
drwxr-xr-x 4 oraem12c oinstall 4096 Nov  7 16:51 install
drwxr-xr-x 9 oraem12c oinstall 4096 Nov  7 16:51 inventory
drwxr-xr-x 4 oraem12c oinstall 4096 Nov  7 16:51 targetType
drwxr-xr-x 4 oraem12c oinstall 4096 Nov  8 12:06 cfgtoollogs
drwxr-xr-x 3 oraem12c oinstall 4096 Mar 25 10:01 default_collection
[oraem12c@examyservdbadm1 oracle.sysman.vi.agent.plugin_12.1.0.1.0]$
[oraem12c@examyservdbadm1 oracle.sysman.vi.agent.plugin_12.1.0.1.0]$ cd -
/u01/oraem12c/agent12c/core/12.1.0.4.0/OPatch/22068912/22068912
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ echo $PLUGIN_HOME
/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ which opatch
/usr/bin/which: no opatch in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin)
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ $ORACLE_HOME/OPatch/opatch apply -oh $PLUGIN_HOME
Oracle Interim Patch Installer version 11.1.0.10.4
Copyright (c) 2017, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0
Central Inventory : /u01/app/oraInventory
   from           : /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0/oraInst.loc
OPatch version    : 11.1.0.10.4
OUI version       : 11.1.0.12.0
Log file location : /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0/cfgtoollogs/opatch/22068912_Apr_03_2017_14_05_54/apply2017-04-03_14-05-54PM_1.log

Applying interim patch '22068912' to OH '/u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0'
Verifying environment and performing prerequisite checks...
All checks passed.
Backing up files...

Patching component oracle.sysman.vi.plugin.agent, 12.1.0.1.0...

Verifying the update...
Patch 22068912 successfully applied
Log file location: /u01/oraem12c/agent12c/plugins/oracle.sysman.vi.agent.plugin_12.1.0.1.0/cfgtoollogs/opatch/22068912_Apr_03_2017_14_05_54/apply2017-04-03_14-05-54PM_1.log

OPatch succeeded.
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Starting agent .................. started.
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 377118
Parent Process ID      : 377003
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-04-03 14:06:47
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 26
Size of XML files pending upload(MB)         : 0.05
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status       : OMS responded illegally [ERROR- Failed to update Target type Metadata]
Last attempted heartbeat to OMS              : 2017-04-03 14:07:09
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-04-03 14:07:39

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 377118
Parent Process ID      : 377003
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-04-03 14:06:47
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 27
Size of XML files pending upload(MB)         : 0.05
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status       : OMS responded illegally [ERROR- Failed to update Target type Metadata]
Last attempted heartbeat to OMS              : 2017-04-03 14:07:28
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-04-03 14:07:58

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl upload agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload error:full upload has failed: uploadXMLFiles skipped :: OMS version not checked yet. If this issue persists check trace files for ping to OMS related errors. (OMS_DOWN)
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 377118
Parent Process ID      : 377003
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-04-03 14:06:47
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 33
Size of XML files pending upload(MB)         : 0.06
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status       : OMS responded illegally [ERROR- Failed to update Target type Metadata]
Last attempted heartbeat to OMS              : 2017-04-03 14:08:09
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-04-03 14:08:39

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$ /u01/oraem12c/agent12c/agent_inst/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/oraem12c/agent12c/agent_inst
Agent Log Directory    : /u01/oraem12c/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/oraem12c/agent12c/core/12.1.0.4.0
Agent Process ID       : 377118
Parent Process ID      : 377003
Agent URL              : https://examyservdbadm1.cris.co.in:3872/emd/main/
Local Agent URL in NAT : https://examyservdbadm1.cris.co.in:3872/emd/main/
Repository URL         : https://tfoisapp1:1159/empbs/upload
Started at             : 2017-04-03 14:06:47
Started by user        : oraem12c
Operating System       : Linux version 2.6.39-400.276.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 40
Size of XML files pending upload(MB)         : 0.06
Available disk space on upload filesystem    : 90.85%
Collection Status                            : Collections enabled
Heartbeat Status       : OMS responded illegally [ERROR- Failed to update Target type Metadata]
Last attempted heartbeat to OMS              : 2017-04-03 14:09:48
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2017-04-03 14:10:18

---------------------------------------------------------------
Agent is Running and Ready
[oraem12c@examyservdbadm1 22068912]$
[oraem12c@examyservdbadm1 22068912]$

After applying the patch we are unable to push the data to OMS, so we need to rollback the patch.

Please follow below link to check the steps to rollback the patch 22068912.
http://sunoracleworld.blogspot.com/2017/04/how-to-rollback-patch-from-em.html



Heartbeat Status       : OMS responded illegally [ERROR- Failed to update Target type 
This is known error after applying patch on EM agent, we need to apply pre requisite patch om OMS first, so please follow above steps to rollback EM patch first then apply patch 22135501 on OMS. then again you can apply the patch 22068912 on EM agent again.


Please check below link to check how to apply prerequisite patch on OMS HOME.
http://sunoracleworld.blogspot.com/2017/04/how-to-apply-patch-on-oms-home.html



I hope this exercise will help you.

Thank you!!!!!!!