Category Archives: 11gR2

How to delete/add Oracle Home entry from central inventory(oraInventory)

How to delete/add Oracle Home entry from central inventory(oraInventory)

How to delete/add Oracle Home entry from Central Inventory(oraInventory)

We often encounter “OPatch failed with error code 73”. There might be other reason but one could be due to the corrupted inventory. Please follow the below guideline to resolve this issue.

oracle@host1-/home/oracle/>$ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /u01/app/oraInventory
from           : /u01/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2016-03-18_03-08-06AM_1.log
List of Homes on this system:
Home name= Ora11g_gridinfrahome1, Location= “/u01/app/grid/product/11.2.0/grid”
Home name= OraDb11g_home1, Location= “/u01/app/oracle/product/11.2.0/dbhome_1”
Home name= agent11ghome1, Location= “/u01/app/oracle/agent11g”
Inventory load failed… OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
Oracle Home dir. path does not exist in Central Inventory
Oracle Home is a symbolic link
Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo
OPatch failed with error code 73
———————————————————–

Solution(first try to remove the entry from the oraInventory):

oracle@host1-/u01/app/oracle/product/11.2.0/dbhome_2/oui/bin/>./runInstaller -silent -deinstall REMOVE_HOMES={“/u01/app/oracle/product/11.2.0/dbhome_2”}
Starting Oracle Universal Installer…
Checking swap space: must be greater than 500 MB.   Actual 16103 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-03-18_03-19-24AM. Please wait …oracle@host1.vm.itg.corp.us.shldcorp.com-/u01/app/oracle/product/11.2.0/dbhome_2/oui/bin/>Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.
Starting deinstall
Starting deinstallDeinstall in progress (Wednesday, February 2, 2011 2:37:45 PM MSK)
End of install phases.(Wednesday, February 2, 2011 2:37:49 PM MSK)
End of deinstallations
Please check ‘/u01/oracle/oraInventory/logs/silentInstall2011-02-02_02-37-36PM.log’ for more details.

Then add the oracle home entry into the oraInventory(it is basically gets added into the inventory.xml file:

oracle@host1-/u01/app/oracle/product/11.2.0/dbhome_2/oui/bin/>./runInstaller -attachHome ORACLE_HOME=”/u01/app/oracle/product/11.2.0/dbhome_2″ ORACLE_HOME_NAME=”OraDb11g_home2″
Starting Oracle Universal Installer…
Checking swap space: must be greater than 500 MB.   Actual 16103 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
‘AttachHome’ was successful.

Now check the lsinventory command

oracle@host1-/home/oracle/>ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /u01/app/oraInventory
from           : /u01/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2016-03-18_03-38-51AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/lsinv/lsinventory2016-03-18_03-38-51AM.txt

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

Oracle Database 11g                                                  11.2.0.4.0
There are 1 product(s) installed in this Oracle Home.

Interim patches (1) :

Patch  20760982     : applied on Thu Aug 20 06:49:13 EDT 2015
Unique Patch ID:  18908105
Patch description:  “Database Patch Set Update : 11.2.0.4.7 (20760982)”
Created on 4 Jun 2015, 00:23:20 hrs PST8PDT
Sub-patch  20299013; “Database Patch Set Update : 11.2.0.4.6 (20299013)”
Sub-patch  19769489; “Database Patch Set Update : 11.2.0.4.5 (19769489)”
Sub-patch  19121551; “Database Patch Set Update : 11.2.0.4.4 (19121551)”
Sub-patch  18522509; “Database Patch Set Update : 11.2.0.4.3 (18522509)”
Sub-patch  18031668; “Database Patch Set Update : 11.2.0.4.2 (18031668)”
Sub-patch  17478514; “Database Patch Set Update : 11.2.0.4.1 (17478514)”
Bugs fixed:
17288409, 21051852, 18607546, 17205719, 17811429, 17816865, 20506699
17922254, 17754782, 16934803, 13364795, 17311728, 17441661, 17284817
16992075, 17446237, 14015842, 19972569, 17449815, 17375354, 19463897
17982555, 17235750, 13866822, 18317531, 17478514, 18235390, 14338435
20803583, 13944971, 20142975, 17811789, 16929165, 18704244, 20506706
17546973, 20334344, 14054676, 17088068, 18264060, 17346091, 17343514
19680952, 18471685, 19211724, 13951456, 16315398, 18744139, 16850630
19049453, 18673304, 17883081, 19915271, 18641419, 18262334, 17006183
18277454, 16833527, 10136473, 18051556, 17865671, 17852463, 18554871
17853498, 18334586, 17588480, 17551709, 19827973, 17842825, 17344412
18828868, 17025461, 11883252, 13609098, 17239687, 17602269, 19197175
18316692, 17313525, 12611721, 19544839, 18964939, 17600719, 18191164
19393542, 17571306, 20777150, 18482502, 19466309, 17040527, 17165204
18098207, 16785708, 17174582, 16180763, 17465741, 16777840, 12982566
19463893, 12816846, 16875449, 17237521, 19358317, 17811438, 17811447
17945983, 18762750, 17184721, 16912439, 18061914, 17282229, 18331850
18202441, 17082359, 18723434, 19554106, 14034426, 18339044, 19458377
17752995, 17891943, 17258090, 17767676, 16668584, 18384391, 17040764
17381384, 15913355, 18356166, 14084247, 20506715, 13853126, 18203837
14245531, 16043574, 17848897, 17877323, 17468141, 17786518, 17912217
17037130, 18155762, 16956380, 17478145, 17394950, 18189036, 18641461
18619917, 17027426, 16268425, 19584068, 18436307, 17265217, 17634921
13498382, 20004087, 17443671, 18000422, 20004021, 17571039, 21067387
16344544, 18009564, 14354737, 18135678, 18614015, 18362222, 17835048
16472716, 17936109, 17050888, 17325413, 14010183, 18747196, 17761775
16721594, 17082983, 20067212, 21179898, 17302277, 18084625, 15990359
18203835, 17297939, 16731148, 17811456, 17215560, 13829543, 14133975
17694209, 18091059, 17385178, 8322815, 17586955, 17201159, 17655634
18331812, 19730508, 18868646, 17648596, 16220077, 16069901, 17348614
17393915, 17957017, 17274537, 18096714, 17308789, 18436647, 14285317
19289642, 14764829, 18328509, 17622427, 16943711, 14368995, 17346671
18996843, 17783588, 16618694, 17672719, 18856999, 18783224, 17851160
17546761, 17798953, 18273830, 19972566, 16384983, 17726838, 17360606
13645875, 18199537, 16542886, 17889549, 14565184, 17071721, 20299015
17610798, 20657441, 17397545, 18230522, 16360112, 19769489, 12905058
18641451, 12747740, 18430495, 17042658, 17016369, 14602788, 19972568
19788842, 18508861, 14657740, 17332800, 13837378, 19972564, 17186905
18315328, 19699191, 17437634, 19006849, 19013183, 17296856, 18674024
17232014, 16855292, 21051840, 14692762, 17762296, 17705023, 19121551
19854503, 19309466, 18681862, 20558005, 17390160, 18554763, 18456514
13955826, 16306373, 18139690, 17501491, 17299889, 17752121, 17889583
18673325, 18293054, 17242746, 17951233, 17649265, 18094246, 19615136
17011832, 16870214, 17477958, 18522509, 20631274, 16091637, 17323222
16595641, 16524926, 18228645, 18282562, 17596908, 17156148, 18031668
16494615, 17545847, 17614134, 13558557, 17341326, 17891946, 17716305
16392068, 19271443, 18092127, 17614227, 18440047, 14106803, 16903536
18973907, 18673342, 17389192, 16194160, 17006570, 17612828, 17721717
17570240, 17390431, 16863422, 18325460, 19727057, 16422541, 17267114
19972570, 18244962, 18765602, 18203838, 16198143, 17246576, 14829250
17835627, 18247991, 14458214, 21051862, 16692232, 17786278, 17227277
16042673, 16314254, 16228604, 16837842, 17393683, 17787259, 20331945
20074391, 15861775, 16399083, 18018515, 21051858, 18260550, 17036973
16613964, 17080436, 16579084, 18384537, 18280813, 20296213, 16901385
15979965, 18441944, 16450169, 9756271, 17892268, 11733603, 17587063
16285691, 16538760, 18180390, 18193833, 21051833, 17238511, 17824637
16571443, 18306996, 14852021, 18674047, 17853456, 12364061

——————————————————————————–

OPatch succeeded.

RAC Log File Locations

RAC Log File Locations

If you are using Oracle RAC (doesn’t matter how many nodes you have) You need to know where log files are located.

The Cluster Ready Services Daemon (crsd) Log Files

Log files for the CRSD process (crsd) can be found in the following directories:

                 CRS home/log/hostname/crsd

Oracle Cluster Registry (OCR) Log Files

The Oracle Cluster Registry (OCR) records log information in the following location:

                CRS Home/log/hostname/client

Cluster Synchronization Services (CSS) Log Files

You can find CSS information that the OCSSD generates in log files in the following locations:

                CRS Home/log/hostname/cssd

Event Manager (EVM) Log Files

Event Manager (EVM) information generated by evmd is recorded in log files in the following locations:

                CRS Home/log/hostname/evmd

RACG Log Files

The Oracle RAC high availability trace files are located in the following two locations:

CRS home/log/hostname/racg

$ORACLE_HOME/log/hostname/racg

Core files are in the sub-directories of the log directories. Each RACG executable has a sub-directory assigned exclusively for that executable. The name of the RACG executable sub-directory is the same as the name of the executable.

You can follow below table which define locations of logs files:

Oracle Clusterware log files

Cluster Ready Services Daemon (crsd) Log Files:
$CRS_HOME/log/hostname/crsd

Cluster Synchronization Services (CSS):
$CRS_HOME/log/hostname/cssd

Event Manager (EVM) information generated by evmd:
$CRS_HOME/log/hostname/evmd

Oracle RAC RACG:
$CRS_HOME/log/hostname/racg
$ORACLE_HOME/log/hostname/racg

Oracle RAC 11g Release 2 log files

Clusterware alert log:
$GRID_HOME/log/<host>/alert<host>.log

Disk Monitor daemon:
$GRID_HOME/log/<host>/diskmon

OCRDUMP, OCRCHECK, OCRCONFIG, CRSCTL:
$GRID_HOME/log/<host>/client

Cluster Time Synchronization Service:
$GRID_HOME/log/<host>/ctssd

Grid Interprocess Communication daemon:
$GRID_HOME/log/<host>/gipcd

Oracle High Availability Services daemon:
$GRID_HOME/log/<host>/ohasd

Cluster Ready Services daemon:
$GRID_HOME/log/<host>/crsd

Grid Plug and Play daemon:
$GRID_HOME/log/<host>/gpnpd:

Mulitcast Domain Name Service daemon:
$GRID_HOME/log/<host>/mdnsd

Event Manager daemon:
$GRID_HOME/log/<host>/evmd

RAC RACG (only used if pre-11.1 database is installed):
$GRID_HOME/log/<host>/racg

Cluster Synchronization Service daemon:
$GRID_HOME/log/<host>/cssd

Server Manager:
$GRID_HOME/log/<host>/srvm

HA Service Daemon Agent:
$GRID_HOME/log/<host>/agent/ohasd/oraagent_oracle11

HA Service Daemon CSS Agent:
$GRID_HOME/log/<host>/agent/ohasd/oracssdagent_root

HA Service Daemon ocssd Monitor Agent:
$GRID_HOME/log/<host>/agent/ohasd/oracssdmonitor_root

HA Service Daemon Oracle Root Agent:
$GRID_HOME/log/<host>/agent/ohasd/orarootagent_root

CRS Daemon Oracle Agent:
$GRID_HOME/log/<host>/agent/crsd/oraagent_oracle11

CRS Daemon Oracle Root Agent:
$GRID_HOME/log/<host> agent/crsd/orarootagent_root

Grid Naming Service daemon:
$GRID_HOME/log/<host>/gnsd

Performance Tuning Functions

V$SQL_MONITOR displays SQL statements whose execution have been (or are being) monitored by Oracle. An entry is created in V$SQL_MONITOR every time the execution of a SQL statement is being monitored. SQL monitoring is automatically started when a SQL statement runs parallel or when it has consumed at least 5 seconds of CPU or I/O time.

V$SQL_MONITOR is a replacement for v$session_longops
Statistics collection is now automatic in 11g with v$sql_monitor.

With V$SQL_MONITOR, Oracle 11g will automatically collect the execution plans for these long-running statements. These statements are visible within V$SQL_PLAN_MONITOR. The V$SQL_MONITOR view will also display execution statistics.

Each time the execution of a SQL statement is monitored, an entry is created in V$SQL_MONITOR.

The refresh rate for the statistics in v$sql_monitor is once per second, which is very close to real time.

The retention for v$sql_monitor is designed such that the SQL monitoring information is not deleted immediately after the execution is completed. In fact, v$sql_monitor retains the information for at least one minute; however, v$sql_monitor continues to monitor new statements, so entries will be deleted in order to reclaim the space.

The important execution statistics inside v$sql_monitor include:

•v$sql_monitor. elapsed_time

•v$sql_monitor. cpu_time

•v$sql_monitor. fetches

•v$sql_monitor. buffer_gets

•v$sql_monitor. disk_reads

•v$sql_monitor. direct_writes

•v$sql_monitor. application_wait_time

•v$sql_monitor. concurrency_wait_time

•v$sql_monitor. cluster_wait_time

•v$sql_monitor. user_io_wait_time

•v$sql_monitor. plsql_exec_time

•v$sql_monitor. java_exec_time

Of course, like many of Oracle’s most appealing features, v$sql_monitor is available via a license for the Oracle Diagnostic & Tuning Pack.


V$SQL_MONITOR

V$SQL_PLAN_MONITOR

Oracle11gR2 Linux install

This should be found in linux_common.ksh

Preinstall requirements:

Minimum RAM requirement: 1.5 GB for GRID Infrastructure and 2.5GB for GI plus RAC

you can verify easily by:

# grep memTotal /proc/meminfo

For Swap space checking
# grep SwapTotal /proc/meminfo
For disk temp space
# df -h /tmp