Agent has disabled full monitoring of this target. Only target Status is being monitored – EM12c

I ran into this “exception”: Agent has disabled full monitoring of this target. Only target Status is being monitored”:

12c_error1

After a couple of researches, I’ve found that this is a Bug and therefor I needed to follow Doc ID 2207479.1.

First you need to make sure that you’re patching the right ORACLE_HOME:

export ORACLE_HOME=/u01/app/oracle/product/agent12cR5/core/12.1.0.5.0

[server1 25104978]$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.1.0.10.4
Copyright (c) 2017, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/agent12cR5/core/12.1.0.5.0
Central Inventory : /u01/app/oracle/oraInv
 from : /u01/app/oracle/product/agent12cR5/core/12.1.0.5.0/oraInst.loc
OPatch version : 11.1.0.10.4
OUI version : 11.1.0.13.0
Log file location : /u01/app/oracle/product/agent12cR5/core/12.1.0.5.0/cfgtoollogs/opatch/opatch2017-02-14_13-44-41PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/agent12cR5/core/12.1.0.5.0/cfgtoollogs/opatch/lsinv/lsinventory2017-02-14_13-44-41PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

EM Platform (Agent) 12.1.0.5.0
There are 1 products installed in this Oracle Home.


Interim patches (3) :

Patch 10203435 : applied on Thu Jun 11 00:41:03 GMT+00:00 2015
Unique Patch ID: 15915936.1
 Created on 7 Feb 2013, 18:06:13 hrs PST8PDT
 Bugs fixed:
 10203435

Patch 17591700 : applied on Thu Jun 11 00:41:01 GMT+00:00 2015
Unique Patch ID: 16995298
 Created on 21 Nov 2013, 11:54:16 hrs PST8PDT
 Bugs fixed:
 16479818, 6895422, 13583799

Patch 17018143 : applied on Thu Jun 11 00:40:56 GMT+00:00 2015
Unique Patch ID: 17273347
 Created on 7 Feb 2014, 21:45:46 hrs UTC
 Bugs fixed:
 17018143

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

OPatch succeeded.

$ORACLE_HOME/OPatch/opatch napply

And on EM repository, don’t forget to execute the following script:

SYSMAN@EMREP> @clean_event_bug25097559.sql
cleaning up entries for seq id: ############################
clear_stateless_event code completed

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.89

Commit complete.

Elapsed: 00:00:00.01
SYSMAN@EMREP>

Time to upgrade the OPatch

As the title suggest, it’s time to upgrade the OPatch. This is what I got when I wanted to apply a patch (namely 20760982) to a 11.2.0.4 database (linux):

[oracle@server 20760982]$ $ORACLE_HOME/OPatch/opatch apply
 Oracle Interim Patch Installer version 11.2.0.3.4
 Copyright (c) 2012, Oracle Corporation. All rights reserved.
 Oracle Home : /u01/app/oracle/product/11.2.0.4
 Central Inventory : /u01/app/oracle/oraInv
 from : /u01/app/oracle/product/11.2.0.4/oraInst.loc
 OPatch version : 11.2.0.3.4
 OUI version : 11.2.0.4.0
 Log file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2017-01-09_08-16-47AM_1.log

Verifying environment and performing prerequisite checks...
 Prerequisite check "CheckMinimumOPatchVersion" failed.
 The details are:
 The OPatch being used has version 11.2.0.3.4 while the following patch(es) require higher versions:
 Patch 17478514 requires OPatch version 11.2.0.3.5.
 Patch 18031668 requires OPatch version 11.2.0.3.5.
 Patch 18522509 requires OPatch version 11.2.0.3.5.
 Patch 19121551 requires OPatch version 11.2.0.3.5.
 Patch 19769489 requires OPatch version 11.2.0.3.5.
 Patch 20299013 requires OPatch version 11.2.0.3.5.
 Patch 20760982 requires OPatch version 11.2.0.3.5.
 Please download latest OPatch from My Oracle Support.

UtilSession failed: Prerequisite check "CheckMinimumOPatchVersion" failed.
 Log file location: /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2017-01-09_08-16-47AM_1.log

 

And this is what I have on my server:

[oracle@server 11204]$ /u01/app/oracle/product/11.2.0.4/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/11.2.0.4
Central Inventory : /u01/app/oracle/oraInv
 from : /u01/app/oracle/product/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2017-01-09_08-47-49AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/lsinv/lsinventory2017-01-09_08-47-49AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.

As you can see, I have an older version of OPatch.

I followed the following steps to fix this:

  1. Download the latest OPatch from support.oracle.com
    p6880880_112000_Linux-x86-64.zip
  2. Make a backup of the actual OPatch and make sure there is no OPatch folder on $ORACLE_HOME folder
    [oracle@server 11.2.0.4]$ cd $ORACLE_HOME
    [oracle@server 11.2.0.4]$ mv OPatch OPatch_old
  3. Unzip the patch into $ORACLE_HOME
 unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME

And this is how it looks now:

[oracle@server 11204]$ /u01/app/oracle/product/11.2.0.4/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2017, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/11.2.0.4
Central Inventory : /u01/app/oracle/oraInv
 from : /u01/app/oracle/product/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.15
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2017-01-09_09-52-47AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/lsinv/lsinventory2017-01-09_09-52-47AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: server
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.
[oracle@server 11204]$

And now trying again the first patch to deploy:

[oracle@server 20760982]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2017, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/11.2.0.4
Central Inventory : /u01/app/oracle/oraInv
 from : /u01/app/oracle/product/11.2.0.4/oraInst.loc
OPatch version : 11.2.0.3.15
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/cfgtoollogs/opatch/opatch2017-01-09_09-56-47AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 17478514 18031668 18522509 19121551 19769489 20299013 20760982

Do you want to proceed? [y|n]
y

.........


OPatch succeeded.

So all looks good now.

 

Initial setup required for the execution of installer validation failed.

One of my colleagues asked me to deploy the Oracle 12c client 32 bits on Windows 64 bits and I got the error from above right after the I chose the type of the installation.

error2

As per above image, the cause of it is – ” Failed to access temporary location”

I tried almost everything what I could find on Google…..from TEMP not correctly exported, the name of the user used, hidden share…..everything was “like in the book”….but was still failing with the same error. However, I have found this command:

setup.exe -ignorePrereq -J"-Doracle.install.client.validate.clientSupportedOSCheck=false"

and a miracle will happen.

ORA-00354: corrupt redo log block header

Recently I got a problem with one of the ORLs; like the title is suggesting, one of the ORL got corrupted (don’t ask how!) and below is what I did:

ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 8741986 change 136264748341 time 09/06/2016 12:47:59
ORA-00312: online log 4 thread 1: '/u2000/oradata/DB/redo4a.log'

What I had in mind was to bounce the database in mount state and to drop the redo04a.log file and to re-create it. Something like this:

SQL> startup mount
ORACLE instance started.

Total System Global Area 3.2068E+10 bytes
Fixed Size                  2269072 bytes
Variable Size            5905580144 bytes
Database Buffers         2.6105E+10 bytes
Redo Buffers               55242752 bytes
Database mounted.

SQL> alter database drop logfile group 4;
alter database drop logfile group 4
*
ERROR at line 1:
ORA-00350: log 4 of instance DB (thread 1) needs to be archived
ORA-00312: online log 4 thread 1: '/u2000/oradata/DB/redo4a.log'

…and the decision had to be taken:

SQL> alter database clear unarchived logfile group 4;

Database altered.

SQL> alter database drop logfile group 4;

Database altered.

SQL> alter database add logfile group 4 '/u2000/oradata/DB/redo4a.log' size 4G reuse;

Database altered.

SQL> alter database open;

Database altered.

12cR1 not being able to connect “as / sysdba” locally

This came as a surprise when I came back from vacation to discover that all of a sudden can’t do this on my Linux box sqlplus / as sysdba. I was getting ORA-01017. Something like this:

[oracle@dbtest dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Aug 3 09:59:29 2016

Copyright (c) 1982, 2014, Oracle. All rights reserved.

ERROR:
 ORA-01017: invalid username/password; logon denied

Enter user-name: ^C
 [oracle@dbtest dbs]$

In my case, one of my colleagues, took the liberty to set TWO_TASK variable. After removing/unsetting the variable, all came to my desired situation.

As you may know, this TWO_TASK variable overwrites the ORACLE_SID & ORACLE_HOME variables and prohibits the local connections and is letting you to use the sqlnet path.

How to clean EM12c repository after a failed installation or upgrade

Well, as nothing is perfect, it happened to me too…..I had a “never seen before” failed EM12c upgrade on a test environment (fortunately :)) and this helped me to do it from scratch:

Note: this is documented on Doc ID 1395423.1 (useful for one who has access, for those who don’t ….you can check it below)

If BI Publisher is not associated with Enterprise Manager 12c Cloud Control, use the following procedure.

Login to the repository database as SYS user and execute the below:

1. Drop the repository users:

drop user SYSMAN cascade;
drop user SYSMAN_MDS cascade;
drop user MGMT_VIEW cascade;
drop user SYSMAN_RO cascade;
drop user SYSMAN_OPSS cascade;
drop user SYSMAN_APM cascade; 
drop user SYSMAN_BIP;
drop user CLOUD_SWLIB_USER cascade;
drop user CLOUD_ENGINE_USER cascade;
drop role MGMT_USER;

2. Drop the synonyms:

SQL> spool synonyms.lst
SQL> select 'drop '|| decode(owner,'PUBLIC',owner||' synonym '||synonym_name, ' synonym '||owner||'.'||synonym_name) ||';' from dba_synonyms where table_owner in ('SYSMAN', 'SYSMAN_MDS', 'MGMT_VIEW', 'SYSMAN_BIPLATFORM', 'SYSMAN_APM', 'SYSMAN_OPSS', 'SYSMAN_RO') ;
SQL> Spool off
SQL> @synonyms.lst

3. Drop the tablespace objects:

SQL> spool tablespaces.lst
SQL> select 'drop tablespace '||tablespace_name||' including contents and datafiles;' from dba_tablespaces where tablespace_name like 'MGMT%';
SQL> Spool off
SQL> @tablespaces.lst

4. Drop the registry objects:

delete from SCHEMA_VERSION_REGISTRY where COMP_NAME='Metadata Services';
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME='Authorization Policy Manager';
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME='Oracle Platform Security Services';
commit;

If BI Publisher is associated with Enterprise Manager for running reports, then follow this procedure instead.
1. Run DBCA to create a template (structure only) of the existing repository database.
2. Run DBCA to drop the instance storing the EM repository.
3. Run DBCA to create a new instance, using the template created from the old repository instance, to support a new EM 12c installation.