Wednesday 22 March 2017

OEM-12c: Agent Upload issue EMD upload error:full upload has failed:uploadXMLFiles skipped:: OMS version not checked yet

Problem

12c agent fails to upload after reinstallation with following errors:

EMD upload error:full upload has failed: uploadXMLFiles skipped :: OMS version n                                                                             ot checked yet. If this issue persists check trace files for ping to OMS related                                                                              errors. (OMS_DOWN)

Heartbeat Status: OMS is unreachable



Applied standard method but doesn't get success.  Here is the below

dns100:> emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/Agent12cR5/agent_inst
Agent Log Directory    : /u01/app/oracle/Agent12cR5/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/Agent12cR5/core/12.1.0.5.0
Agent Process ID       : 3202
Parent Process ID      : 3125
Agent URL              : https://dns100.ora.com:3872/emd/main/
Local Agent URL in NAT : https://dns100.ora.com:3872/emd/main/
Repository URL         : https://oem251.ora.com:4902/empbs/upload
Started at             : 2015-10-03 05:39:37
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.209.1.el5uek (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           : 87
Size of XML files pending upload(MB)         : 0.28
Available disk space on upload filesystem    : 87.64%
Collection Status                            : Collections enabled
Heartbeat Status                             : OMS is unreachable
Last attempted heartbeat to OMS              : 2015-10-03 05:40:49
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2015-10-03 05:41:20

---------------------------------------------------------------
Agent is Running and Ready

Stopping Agent

dns100:> emctl stop agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Stopping agent ..... stopped.

Deleting pending upload logs


dns100:> cd /u01/app/oracle/Agent12cR5/agent_inst/sysman/emd/upload
dns100:> ls
pending  upload
dns100:> rm -rf *
dns100:> cd ../state/
dns100:> ls
configLogs      inbox                  recvlet_state         storage
configstate     mcePersist             severityTraceRecords
fetchlet_state  oracleHomeFirstConfig  statemgmt
dns100:> rm -rf *

Starting Agent


dns100:> emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Starting agent ........... started.

Checking the status of Agent,  still showing "OMS IS UNREACHABLE"


dns100:> emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : (unknown)
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/Agent12cR5/agent_inst
Agent Log Directory    : /u01/app/oracle/Agent12cR5/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/Agent12cR5/core/12.1.0.5.0
Agent Process ID       : 4252
Parent Process ID      : 4209
Agent URL              : https://dns100.ora.com:3872/emd/main/
Local Agent URL in NAT : https://dns100.ora.com:3872/emd/main/
Repository URL         : https://oem251.ora.com:4902/empbs/upload
Started at             : 2015-10-03 05:44:59
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.209.1.el5uek (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           : 41
Size of XML files pending upload(MB)         : 0.23
Available disk space on upload filesystem    : 87.64%
Collection Status                            : Collections enabled
Heartbeat Status                             : OMS is unreachable
Last attempted heartbeat to OMS              : 2015-10-03 05:45:16
Last successful heartbeat to OMS             : (none)
Next scheduled heartbeat to OMS              : 2015-10-03 05:45:46

---------------------------------------------------------------
Agent is Running and Ready

And when uploading the getting below error


dns100:> emctl upload agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload error:full upload has failed: uploadXMLFiles skipped :: OMS version n                                                                             ot checked yet. If this issue persists check trace files for ping to OMS related                                                                              errors. (OMS_DOWN)


Cause

The agent has been uploading to same OMS earlier and has been reinstalled on the same host and port. OMS blocks the agent after reinstallation and will not allow for any further uploads until the information available at repository and agent  are in synchronization.



Solution

After reinstallation need to add agent and host target and then need to perform sync operation for the upload to be successful.

Perform the following steps to resolve the issue:

Before performing below ensure that Agent must up.  Issue following command to add agent and host targets:


dns100:> emctl config agent addinternaltargets
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.

This would list the agent target in Setup > Add Target > Auto Discovery Results 

Now Securing the agent.  By doing this would show the host and agent in pending status under Targets > All targets

dns100:> emctl secure agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Agent successfully stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password :
Agent successfully restarted...   Done.
Securing agent...   Successful.


Following steps to show the status of host and agent as up

  • Stopping Agent
  • Clearstate Agent
  • Starting Agent



Stopping Agent

dns100:> emctl stop agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Stopping agent ..... stopped.

Clearing the Agent State


dns100:> emctl clearstate agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
EMD clearstate completed successfully

Starting Agent

dns100:> emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Starting agent ........... started.

Checking status of Agent


dns100:> emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : 12.1.0.5.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/Agent12cR5/agent_inst
Agent Log Directory    : /u01/app/oracle/Agent12cR5/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/Agent12cR5/core/12.1.0.5.0
Agent Process ID       : 6608
Parent Process ID      : 6565
Agent URL              : https://dns100.ora.com:3872/emd/main/
Local Agent URL in NAT : https://dns100.ora.com:3872/emd/main/
Repository URL         : https://oem251.ora.com:4903/empbs/upload
Started at             : 2015-10-03 05:52:05
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.209.1.el5uek (amd64)
Last Reload            : (none)
Last successful upload                       : 2015-10-03 05:52:14
Last attempted upload                        : 2015-10-03 05:52:14
Total Megabytes of XML files uploaded so far : 0.01
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 87.64%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2015-10-03 05:52:10
Last successful heartbeat to OMS             : 2015-10-03 05:52:10
Next scheduled heartbeat to OMS              : 2015-10-03 05:53:10

---------------------------------------------------------------
Agent is Running and Ready

Uploading Agent


dns100:> emctl upload
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

Checking status of Agent


dns100:> emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.5.0
OMS Version            : 12.1.0.5.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/Agent12cR5/agent_inst
Agent Log Directory    : /u01/app/oracle/Agent12cR5/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/Agent12cR5/core/12.1.0.5.0
Agent Process ID       : 6608
Parent Process ID      : 6565
Agent URL              : https://dns100.ora.com:3872/emd/main/
Local Agent URL in NAT : https://dns100.ora.com:3872/emd/main/
Repository URL         : https://oem251.ora.com:4903/empbs/upload
Started at             : 2015-10-03 05:52:05
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.209.1.el5uek (amd64)
Last Reload            : (none)
Last successful upload                       : 2015-10-03 05:52:40
Last attempted upload                        : 2015-10-03 05:52:40
Total Megabytes of XML files uploaded so far : 0.02
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 87.64%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2015-10-03 05:52:10
Last successful heartbeat to OMS             : 2015-10-03 05:52:10
Next scheduled heartbeat to OMS              : 2015-10-03 05:53:10

---------------------------------------------------------------
Agent is Running and Ready



In My case everything running smooth now.  But in some case I observer issue with synchronization, if you are facing then follow below support doc (1376968.1).

EM 12c: How to Perform Enterprise Manager 12c Cloud Control Agent Resynchronization (Doc ID 1376968.1)

Thursday 9 March 2017

Unix Basic command

1. mkdir -p /u01/app_shared/oracle/admin/archive
2.chmod -R 775 /u01/app_shared/oracle/admin/
3. chown -R hrisidm:hrisidm /u01/app_shared/oracle/admin/

Nullable files creation:

cat /dev/null > logfile
EX: cat /dev/null > sde.log


=============================
find . -type f -size +120000000c -exec lsof {} \;

find /u01 -type f -mtime +365 -exec rm '{}' \;

find /u01 -type f -mtime +365 -exec lsof '{}' \;

find /tmp/sess_* -mtime +1h -exec rm {} \;

#!/bin/bash

find /tmp/sess_* -mtime +1h -exec rm {} \;

As per the man page for find, I understand that this is expected behavior:

 -mtime n
        File’s  data was last modified n*24 hours ago.  See the comments
        for -atime to understand how rounding affects the interpretation
        of file modification times.

-atime n
       File  was  last  accessed n*24 hours ago.  When find figures out
       how many 24-hour periods ago the file  was  last  accessed,  any
       fractional part is ignored, so to match -atime +1, a file has to
       have been accessed at least two days ago.

ctime

ctime is the inode or file change time. The ctime gets updated when the file attributes are changed, like changing the owner, changing the permission or moving the file to an other filesystem but will also be updated when you modify a file.

mtime

mtime is the file modify time. The mtime gets updated when you modify a file. Whenever you update content of a file or save a file the mtime gets updated.

Most of the times ctime and mtime will be the same, unless only the file attributes are updated. In that case only the ctime gets updated.

atime
atime is the file access time. The atime gets updated when you open a file but also when a file is used for other operations like grep, sort, cat, head, tail and so on.

Examples:

# perform nightly cleanup of log files older than 8 days
49 23 * * * ( find /u01/app/kumar/applications/prd/doh/log -mtime +8 -exec rm {} \; ) > /dev/null 2>&1
# perform nightly cleanup of report files older than 2 days
48 23 * * * ( find /u01/app/kumar/applications/prd/doh/bin/reports -mtime +2 -exec rm {} \; ) > /dev/null 2>&1
# perform nightly cleanup of dart files older than 10 days
47 23 * * * ( find /u01/app/kumar/applications/prd/doh/dart/bkup -mtime +10 -exec rm {} \; ) > /dev/null 2>&1

cd \u01
find . -name "*.lok" -print -exec lsof {} \;

cd \u01
find . -name "*.lok" -print -exec rm {} \;

cd /u01
find . -name "*.DAT" -print -exec lsof {} \;

cd /u01
find . -name "*.DAT" -print -exec rm {} \;

Clear the files content using cat,:> and truncate commands:Null files

1) cat /dev/null>access.log
2) :> access.log
3) truncate -s 0 access.log
If you specify the size as 0, the contents of the file will be cleared. Let’s confirm this

4) stat file.txt
===========================================================================================================
grep -in "25/Nov/2014" access_log | head
----------------------------------------
aims@asl175:/u900/app/apache2063/logs> grep -in "25/Nov/2014" access_log | head
19908668 :136.236.108.1 - - [25/Nov/2014:05:11:25 +1000] "POST /servlet/com.esri.esrimap.Esrimap?client=eview&ServiceName=ibimap_tot HTTP/1.1" 200 685912
19908669:136.236.108.1 - - [25/Nov/2014:05:11:52 +1000] "POST /servlet/com.esri.esrimap.Esrimap?client=eview&ServiceName=ibimap_tot HTTP/1.1" 200 419

grep -in "25/Nov/2014" access_log | tail
----------------------------------------
aims@asl175:/u900/app/apache2063/logs> grep -in "25/Nov/2014" access_log | tail
19912445:136.236.14.241 - - [25/Nov/2014:15:56:53 +1000] "POST /servlet/com.esri.esrimap.Esrimap?client=eview&ServiceName=ibimap_tot&CustomService=query HTTP/1.1" 200 925
19912446:136.236.14.241 - - [25/Nov/2014:15:56:53 +1000] "POST /servlet/com.esri.esrimap.Esrimap?client=eview&ServiceName=ibimap_tot&CustomService=query HTTP/1.1" 200 925
19912447:136.236.14.241 - - [25/Nov/2014:15:56:54 +1000] "POST /servlet/com.esri.esrimap.Esrimap?client=eview&ServiceName=ibimap_tot&CustomService=query HTTP/1.1" 200 925

Finally its stored in one fail used into below sed command:

sed -n '19908668,19912447p' access_log > /tmp/access_log.txt
-----------------------------------------------------------------------------------------------------------------
3) :%s/oldstring/correntstirng/g


4) mailx -s "hello" -a /supportdocs/mware/home/information_15042014.txt surendra.swamy@brisbane.qld.gov.au

5) rm `ls -l|grep "Apr" |grep access_log |awk '{print $9}'`

6) ls -l|grep "May" |grep *der  |grep 2011 |awk '{print $6 "  " $7 " "  $8 " "  $9}'

7) rm `ls -l|grep "May" |grep *der  |grep 2011 |awk '{print $6 "  " $7 " "  $8 " "  $9}'`

8) scp -rp file_name oracle@prd-ofmw02-101:/u9000/app/oracle/product/java/

9) ls -lrt *.fmb | wc -l

10 . sh /u01/soa_soasuite_shared/app/oracle/admin/aserver/soa_domain/bin/startWebLogic.sh

ctrl+z

bg

disown

netstat:

¦ Oracle Management Agent Port = 3872, 1830 - 1849
To verify if a port is free, run the following command:
¦ On Unix:

netstat -anp | grep

example : netstat -apn | grep 3872

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