DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Friday, November 20, 2015

Deinstall 11gR2 Grid Infrastructure and 11gR2 RAC software after upgraded to 12c


How to do it:

1. Backup OraInventory

cp -R oraInventory oraInventory_orig

2. Uninstall 11gR2 Oracle RAC Home as below, OraInventory is updated on all nodes     accordingly.

$ export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1

$ export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbrac_1

$ cd $ORACLE_HOME/deinstall

$ ./deinstall -silent

$ cd /oracle/app/oracle/product

$ rm -r 11.2.0

$ cd /oracle/app/oraInventory/ContentsXML

$ cat inventory.xml|grep 11.2.0 #To verify OracleHome is remove or not 
  
3. Uninstall 11gR2 Grid Home. ( Doc ID 458893.1 ) ( Doc ID 1346305.1 )

$ export ORACLE_HOME=/oracle/app/11.2.0/grid

$ $ORACLE_HOME/OPatch/opatch lsinventory -all

$ cd $ORACLE_HOME/oui/bin

$ ./runInstaller -silent -
detachHome ORACLE_HOME=/oracle/app/11.2.0/grid ORACLE_HOME_NAME=Ora11g_gridinfrahome1

$ cd /oracle/app/oraInventory/ContentsXML

$ $ORACLE_HOME/OPatch/opatch lsinventory -all

$ cat inventory.xml|grep 11.2.0 #To verify GridHome is remove or not

$ sudo su -

# cd /oracle/app/

# rm -fr 11.2.0


Sunday, November 15, 2015

Agent down due to OutOfMemoryError

Agent Startup failed solution:

Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Starting agent ................................................. failed.
Fatal agent error: Target Interaction Manager failed at Startup
Fatal agent error: Target Interaction Manager failed at Startup
Fatal agent error: Target Interaction Manager failed at Startup
EMAgent is Thrashing. Exiting watchdog
Consult emctl.log and emagent.nohup in: /oracle/app/oracle/Agent12c4/agent_inst/sysman/log

[oracle@rac2 ~]$

Analysis:

/oracle/app/oracle/Agent12c4/agent_inst/sysman/log

emagent.nohup:

Agent is going down due to an OutOfMemoryError
----- Sun Nov 15 03:20:44 2015::18184::EMAgent will be restarted because of an Out of Memory Exception. -----

gcagent.log

2015-11-15 03:20:35,619 [1:main] ERROR - Critical error:
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2882)


Solution:
To resolve this Outof Memory issue we need to increase java heap size in "emd.properties".

File location: /oracle/app/oracle/Agent12c4/agent_inst/sysman/config

vi emd.properties

Old:

#agentJavaDefines=-Xmx208M -XX:MaxPermSize=96M

New:

agentJavaDefines=-Xmx512M -XX:MaxPermSize=96M
_zombieSuspensions=true
_canceledThreadWait=210
_cancelThreadTimeout=300


[oracle@rac2 config]$ emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
Starting agent ............................ started.

[oracle@rac2 config]$ 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             : /oracle/app/oracle/Agent12c4/agent_inst
Agent Log Directory    : /oracle/app/oracle/Agent12c4/agent_inst/sysman/log
Agent Binaries         : /oracle/app/oracle/Agent12c4/core/12.1.0.5.0
Agent Process ID       : 24177
Parent Process ID      : 24092
Agent URL              : https://rac2:3872/emd/main/
Local Agent URL in NAT : https://rac2:3872/emd/main/
Repository URL         : https://rac2:4903/empbs/upload
Started at             : 2015-11-15 03:31:36
Started by user        : oracle
Operating System       : Linux version 2.6.32-431.el6.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : 2015-11-15 03:32:13
Last attempted upload                        : 2015-11-15 03:32:13
Total Megabytes of XML files uploaded so far : 0.23
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 44.09%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2015-11-15 03:32:01
Last successful heartbeat to OMS             : 2015-11-15 03:32:01
Next scheduled heartbeat to OMS              : 2015-11-15 03:33:01

---------------------------------------------------------------
Agent is Running and Ready
[oracle@rac2 config]$

Refrence:

EM12c: Enterprise Manager 12c Cloud Control Agent Stops with Logged (gcagent.log) Message: ERROR - Critical error: java.lang.OutOfMemoryError: Java heap space (Doc ID 1947595.1)

Thursday, November 12, 2015

Object list where more block changes happened - Data based on awr

/* Object List where more block changes happened. This will help us to find more archive generation based on which object */

set pages 10000
set lines 170
col object_name format a40
col object_type format a30

SELECT dhso.object_name, object_type, SUM (db_block_changes_delta)
FROM dba_hist_seg_stat dhss, dba_hist_seg_stat_obj dhso, dba_hist_snapshot dhs
WHERE dhs.snap_id = dhss.snap_id
AND dhs.instance_number = dhss.instance_number
AND dhss.obj# = dhso.obj#
AND dhss.dataobj# = dhso.dataobj#
AND begin_interval_time BETWEEN TO_DATE ('20-10-2015 00:00:00', 'DD-MM-YYYY HH24:mi:ss') AND TO_DATE ('29-10-2015 23:59:59', 'DD-MM-YYYY HH24:mi:ss')
GROUP BY dhso.object_name, object_type
HAVING SUM (db_block_changes_delta) > 0
ORDER BY 2, SUM (db_block_changes_delta) DESC
/

Find Total archive generated with Size - day wise

/* Script to find total number of archives generated with the size per day */

 
select to_char(COMPLETION_TIME,'DD/MON/YYYY') Day,
sum(blocks*block_size)/1048576/1024 "Size(GB)",
count(sequence#) "Total Archives"
from (select distinct sequence#,
thread#,
COMPLETION_TIME,
blocks,
block_size
from v$archived_log
where completion_time>=sysdate-30)
group by to_char(COMPLETION_TIME,'DD/MON/YYYY')
order by 1;