Sunday, February 26, 2017

How to resolve PRVF-0002: could not retrieve local node name


 Error:  PRVF-0002: could not retrieve local node name


Solution:
-------------

first check hostname in server

[root@pri etc]# hostname
pri.localdomain
[root@pri etc]#

Old host file

[root@pri etc]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@pri etc]#
[root@pri etc]#


Now make entry of server ip and hostname in host file


[root@pri etc]#
[root@pri etc]#
[root@pri etc]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.12 pri  pri.localdomain
[root@pri etc]#
[root@pri etc]#

after  restart oracle oui

Saturday, February 11, 2017

Move or Rename the Tempfile in Oracle ASM


Move or Rename the Tempfile in Oracle
==================================


Step1:-  Login as sysdba

Step2: Check Tempfile status corresponding to tablepace  using below query

 SQL> SELECT v.file#, t.file_name, v.status
   FROM dba_temp_files t, v$tempfile v
   WHERE t.file_id = v.file#
   and t.TABLESPACE_NAME='TEMP1';
    
     FILE# FILE_NAME                                STATUS
---------- ---------------------------------------- -------
         2 +DATA2/orcl/tempfile/temp1.269.935535665 ONLINE

SQL>

Step3: Make offline file which want to move using below query

SQL>
SQL> alter database tempfile '+DATA2/orcl/tempfile/temp1.269.935535665' offline;

Database altered.

SQL>
SQL>

Step 4: Check status of file

SQL> SELECT v.file#, t.file_name, v.status
   FROM dba_temp_files t, v$tempfile v
   WHERE t.file_id = v.file#
   and t.TABLESPACE_NAME='TEMP1';  2    3    4

     FILE# FILE_NAME                                STATUS
---------- ---------------------------------------- -------
         2 +DATA2/orcl/tempfile/temp1.269.935535665 OFFLINE



Step 5:- login  in asm instance and copy file to  one diskgroup to another diskgroup


[grid@rac1 ~]$ . oraenv
ORACLE_SID = [grid] ? +ASM1
The Oracle base has been set to /u01/app/grid
[grid@rac1 ~]$
[grid@rac1 ~]$ asmcmd
ASMCMD> ls
DATA1/
DATA2/
ASMCMD>
ASMCMD>
ASMCMD> cp +DATA2/orcl/tempfile/temp1.269.935535665 +DATA1/ORCL/DATAFILE/temp1_new
copying +DATA2/orcl/tempfile/temp1.269.935535665 -> +DATA1/ORCL/DATAFILE/temp1_new
ASMCMD>
ASMCMD>
ASMCMD> cd +DATA1/ORCL/DATAFILE/
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
                                            N    temp1_new => +DATA1/ASM/TEMPFILE/temp1_new.256.935624893

Step 6:  Rename file to new location  using below command 

SQL> alter database rename file '+DATA2/orcl/tempfile/temp1.269.935535665' to '+DATA1/ASM/TEMPFILE/temp1_new.256.935624893';

Database altered.

SQL>

Step 7: Make online file using below command 

SQL> alter database tempfile '+DATA1/asm/tempfile/temp1_new.256.935624893' online;

Database altered.

SQL>
SQL>  SELECT v.file#, t.file_name, v.status
   FROM dba_temp_files t, v$tempfile v
   WHERE t.file_id = v.file#
   and t.TABLESPACE_NAME='TEMP1';  2    3    4

     FILE# FILE_NAME                                                    STATUS
---------- ------------------------------------------------------------ -------
         2 +DATA1/asm/tempfile/temp1_new.256.935624893                  ONLINE

SQL>



=======
Make sure file is offline otherwise get below error
----------------------------------------------------------------
SQL> Alter database rename file '+DATA2/orcl/tempfile/temp1.269.935535665' to '+DATA1/ASM/TEMPFILE/temp1_new.256.935624893';
alter database rename file '+DATA2/orcl/tempfile/temp1.269.935535665' to '+DATA1/ASM/TEMPFILE/temp1_new.256.935624893';
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01121: cannot rename database file 202 - file is in use or recovery
ORA-01110: data file 202: '+DATA2/orcl/tempfile/temp1.269.935535665'



ASMCMD cp command fails with ASMCMD-8016 / ORA-15046 / ORA-06512/ ORA-15056

ASMCMD cp command fails with ORA-15046 ======================================

ASMCMD> cp +DATA2/orcl/tempfile/temp1.269.935535665 +DATA1/ORCL/DATAFILE/temp1.269.935535665
copying +DATA2/orcl/tempfile/temp1.269.935535665 -> +DATA1/ORCL/DATAFILE/temp1.269.935535665
ASMCMD-8016: copy source '+DATA2/orcl/tempfile/temp1.269.935535665' and target '+DATA1/ORCL/DATAFILE/temp1.269.935535665' failed
ORA-15056: additional error message
ORA-15046: ASM file name '+DATA1/ORCL/DATAFILE/temp1.269.935535665' is not in single-file creation form
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 415
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>
ASMCMD>



* The target file name specified is not a valid file name.
* The cp command failed because the ASM file name was not in a form that can be used to create an single file.
* The file name should not contain the file number/incarnation.

The cp command failed because the ASM file name was not in a form that can be used to create an single file.File name should not contain the file number/incarnation

       
ASMCMD>
ASMCMD> cp +DATA2/orcl/tempfile/temp1.269.935535665 +DATA1/ORCL/DATAFILE/temp1_new
copying +DATA2/orcl/tempfile/temp1.269.935535665 -> +DATA1/ORCL/DATAFILE/temp1_new
ASMCMD>
ASMCMD>

ASMCMD> cd +DATA1/ORCL/DATAFILE/
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
                                            N    temp1_new => +DATA1/ASM/TEMPFILE/temp1_new.256.935624893
ASMCMD>
Ref:
=====
ASMCMD cp command fails with ORA-15046 (Doc ID 452158.1)

Sunday, February 5, 2017

Applying PSU patch(April 2015) 11.2.0.4.2 Two Node RAC

Grid patch : p18139609_112040_Linux-x86-64.zip

Oracle Grid Infrastructure Patch Set Update 11.2.0.4.2 (Includes Database PSU 11.2.0.4.2) - 18139609

The GI PSU patch includes updates for both the Clusterware home and Database home that can be applied in a rolling fashion.

Step 1 :Take Backup of Grid Home on Both home(using tar command)
Step 2 : Download latest Opatch-6880880
Step 3 : Create OCM (Oracle Configuration Manager) response file
Step 4 : Validation of Oracle Inventory
Step 5 : Download PSU patch Oracle Grid Infrastructure Patch Set Update 11.2.0.4.2 (Includes Database PSU 11.2.0.4.2) - 18139609
(Read carefully README.html file )
Step 6 : One-off Patch Conflict Detection and Resolution
Step 7 : Stop EM Agent Processes Prior to Patching and Prior to Rolling Back the Patch
Step 8 : Patch Installation
Step 9 : Repeat the same steps on second node
Step 10: Patch Post-Installation
Step 11 : Loading Modified SQL Files into the Database


Grid & Database patch:
=================

[root@rac1 OPatch]# ./opatch version
OPatch Version: 11.2.0.3.4

OPatch succeeded.
[root@rac1 OPatch]#


Now we download new OPatch

[root@rac1 OPatch]# ./opatch version
OPatch Version: 11.2.0.3.15

OPatch succeeded.
[root@rac1 OPatch]#






*first check optach version
* create OCM (oracle configuration manager) file

 export ORACLE_HOME=<my_oracle_home_path>
 $ORACLE_HOME/OPatch/ocm/bin/emocmrsp  -no_banner -output <specify_the_location>/file.rsp


 How to Create an OCM Response file to Apply a Patch in Silent Mode - opatch silent (Doc ID 966023.1)


opatch lsinventory -detail -oh <ORACLE_HOME>

opatch lsinventory -detail -oh /u01/app/11.2.0/grid_1



[grid@rac1 OPatch]$ ./opatch lsinventory -detail -oh /u01/app/11.2.0/grid_1
Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2017, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/11.2.0/grid_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0/grid_1/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid_1/cfgtoollogs/opatch/opatch2017-02-04_17-54-41PM_1.log

Lsinventory Output file location : /u01/app/11.2.0/grid_1/cfgtoollogs/opatch/lsinv/lsinventory2017-02-04_17-54-41PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac1.localdomain.com
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

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


Installed Products (89):

Agent Required Support Files                                         10.2.0.4.5
Assistant Common Files                                               11.2.0.4.0
Automatic Storage Management Assistant                               11.2.0.4.0
Bali Share                                                           1.1.18.0.0
Buildtools Common Files                                              11.2.0.4.0
Character Set Migration Utility                                      11.2.0.4.0
Cluster Ready Services Files                                         11.2.0.4.0
Cluster Verification Utility Common Files                            11.2.0.4.0
Cluster Verification Utility Files                                   11.2.0.4.0
Database SQL Scripts                                                 11.2.0.4.0
Deinstallation Tool                                                  11.2.0.4.0
Enterprise Manager Common Core Files                                 10.2.0.4.5
Enterprise Manager Common Files                                      10.2.0.4.5
Enterprise Manager plugin Common Files                               11.2.0.4.0
Expat libraries                                                       2.0.1.0.1
HAS Common Files                                                     11.2.0.4.0
HAS Files for DB                                                     11.2.0.4.0
Installation Common Files                                            11.2.0.4.0
Installation Plugin Files                                            11.2.0.4.0
Installer SDK Component                                              11.2.0.4.0
Java Development Kit                                                1.5.0.51.10
LDAP Required Support Files                                          11.2.0.4.0
OLAP SQL Scripts                                                     11.2.0.4.0
Oracle Advanced Security                                             11.2.0.4.0
Oracle Clusterware RDBMS Files                                       11.2.0.4.0
Oracle Configuration Manager Deconfiguration                         10.3.1.0.0
Oracle Containers for Java                                           11.2.0.4.0
Oracle Core Required Support Files                                   11.2.0.4.0
Oracle Database 11g                                                  11.2.0.4.0
Oracle Database 11g Multimedia Files                                 11.2.0.4.0
Oracle Database Deconfiguration                                      11.2.0.4.0
Oracle Database User Interface                                       2.2.13.0.0
Oracle Database Utilities                                            11.2.0.4.0
Oracle DBCA Deconfiguration                                          11.2.0.4.0
Oracle Extended Windowing Toolkit                                    3.4.47.0.0
Oracle Globalization Support                                         11.2.0.4.0
Oracle Globalization Support                                         11.2.0.4.0
Oracle Grid Infrastructure 11g                                       11.2.0.4.0
Oracle Help For Java                                                  4.2.9.0.0
Oracle Ice Browser                                                    5.2.3.6.0
Oracle Internet Directory Client                                     11.2.0.4.0
Oracle Java Client                                                   11.2.0.4.0
Oracle JDBC/OCI Instant Client                                       11.2.0.4.0
Oracle JDBC/THIN Interfaces                                          11.2.0.4.0
Oracle JFC Extended Windowing Toolkit                                4.2.36.0.0
Oracle JVM                                                           11.2.0.4.0
Oracle LDAP administration                                           11.2.0.4.0
Oracle Locale Builder                                                11.2.0.4.0
Oracle Multimedia                                                    11.2.0.4.0
Oracle Multimedia Client Option                                      11.2.0.4.0
Oracle Multimedia Java Advanced Imaging                              11.2.0.4.0
Oracle Multimedia Locator                                            11.2.0.4.0
Oracle Multimedia Locator RDBMS Files                                11.2.0.4.0
Oracle Net                                                           11.2.0.4.0
Oracle Net Listener                                                  11.2.0.4.0
Oracle Net Required Support Files                                    11.2.0.4.0
Oracle Netca Client                                                  11.2.0.4.0
Oracle Notification Service                                          11.2.0.3.0
Oracle Notification Service (eONS)                                   11.2.0.4.0
Oracle One-Off Patch Installer                                       11.2.0.3.4
Oracle Quality of Service Management (Client)                        11.2.0.4.0
Oracle Quality of Service Management (Server)                        11.2.0.4.0
Oracle RAC Deconfiguration                                           11.2.0.4.0
Oracle RAC Required Support Files-HAS                                11.2.0.4.0
Oracle Recovery Manager                                              11.2.0.4.0
Oracle Security Developer Tools                                      11.2.0.4.0
Oracle Text Required Support Files                                   11.2.0.4.0
Oracle Universal Installer                                           11.2.0.4.0
Oracle USM Deconfiguration                                           11.2.0.4.0
Oracle Wallet Manager                                                11.2.0.4.0
Parser Generator Required Support Files                              11.2.0.4.0
Perl Interpreter                                                     5.10.0.0.2
Perl Modules                                                         5.10.0.0.1
PL/SQL                                                               11.2.0.4.0
PL/SQL Embedded Gateway                                              11.2.0.4.0
Platform Required Support Files                                      11.2.0.4.0
Precompiler Required Support Files                                   11.2.0.4.0
RDBMS Required Support Files                                         11.2.0.4.0
RDBMS Required Support Files for Instant Client                      11.2.0.4.0
RDBMS Required Support Files Runtime                                 11.2.0.4.0
Required Support Files                                               11.2.0.4.0
Secure Socket Layer                                                  11.2.0.4.0
SQL*Plus                                                             11.2.0.4.0
SQL*Plus Files for Instant Client                                    11.2.0.4.0
SQL*Plus Required Support Files                                      11.2.0.4.0
SSL Required Support Files for InstantClient                         11.2.0.4.0
Universal Storage Manager Files                                      11.2.0.4.0
XDK Required Support Files                                           11.2.0.4.0
XML Parser for Java                                                  11.2.0.4.0
There are 89 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


Rac system comprising of multiple nodes
  Local node = rac1
  Remote node = rac2

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

OPatch succeeded.
[grid@rac1 OPatch]$



check patch conflicts


./opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./18139609



[grid@rac1 oracle_software]$ /u01/app/11.2.0/grid_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./18139609
Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2017, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/11.2.0/grid_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0/grid_1/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid_1/cfgtoollogs/opatch/opatch2017-02-04_18-28-00PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[grid@rac1 oracle_software]$



[oracle@rac1 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://rac1.localdomain.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is not running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/rac1_orcl/sysman/log
[oracle@rac1 ~]$

  
 example:
 ===========
 cd 12345
% opatch apply -silent -ocmrf <path_to_response_file>




[root@rac1 oracle_software]#
[root@rac1 oracle_software]#
[root@rac1 oracle_software]# echo $GRID_HOME
/u01/app/11.2.0/grid_1/
[root@rac1 oracle_software]#
[root@rac1 oracle_software]# echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1/
[root@rac1 oracle_software]#
[root@rac1 oracle_software]#
[[root@rac1 oracle_software]#
[root@rac1 oracle_software]#
[root@rac1 oracle_software]# chmod -R 775 /u01/app/11.2.0/grid_1/
[root@rac1 oracle_software]#
[root@rac1 oracle_software]#
[root@rac1 oracle_software]# /u01/app/11.2.0/grid_1/OPatch/opatch auto /u01/oracle_software/18139609 -ocmrf /u01/oracle_software/orcl_grid.rsp
Executing /u01/app/11.2.0/grid_1/perl/bin/perl /u01/app/11.2.0/grid_1/OPatch/crs/patch11203.pl -patchdir /u01/oracle_software -patchn 18139609 -ocmrf /u01/oracle_software/orcl_grid.rsp -paramfile /u01/app/11.2.0/grid_1/crs/install/crsconfig_params

This is the main log file: /u01/app/11.2.0/grid_1/cfgtoollogs/opatchauto2017-02-04_19-26-58.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0/grid_1/cfgtoollogs/opatchauto2017-02-04_19-26-58.report.log

2017-02-04 19:26:58: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid_1/crs/install/crsconfig_params


Stopping RAC /u01/app/oracle/product/11.2.0/dbhome_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully

patch /u01/oracle_software/18139609/18031668  apply successful for home  /u01/app/oracle/product/11.2.0/dbhome_1
patch /u01/oracle_software/18139609/18031740/custom/server/18031740  apply successful for home  /u01/app/oracle/product/11.2.0/dbhome_1

Stopping CRS...
Stopped CRS successfully

patch /u01/oracle_software/18139609/18031668  apply successful for home  /u01/app/11.2.0/grid_1
patch /u01/oracle_software/18139609/18031740  apply successful for home  /u01/app/11.2.0/grid_1
patch /u01/oracle_software/18139609/18031731  apply successful for home  /u01/app/11.2.0/grid_1

Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.

Starting RAC /u01/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully

opatch auto succeeded.
[root@rac1 oracle_software]#
[root@rac1 oracle_software]#






SQL>  select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STARTUP_TIME,STATUS from gv$instance;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME                                                        STARTUP_TIME         STATUS
--------------- ---------------- ---------------------------------------------------------------- -------------------- ------------
              2 orcl2            rac2.localdomain.com                                             04-FEB-2017 04:08:10 OPEN
              1 orcl1            rac1.localdomain.com                                             04-FEB-2017 19:54:25 OPEN

SQL>







On Node2=============



[root@rac2 oracle_software]# cp -r OPatch/ /u01/app/11.2.0/grid_1/
[root@rac2 oracle_software]#
[root@rac2 oracle_software]#
[root@rac2 oracle_software]# cd /u01/app/11.2.0/grid_1/
[root@rac2 grid_1]#
[root@rac2 grid_1]# chmod -R 777 OPatch
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]# chmod -R 777 /u01/oracle_software/
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]# export GRID_HOME=/u01/app/11.2.0/grid_1/
[root@rac2 grid_1]#
[root@rac2 grid_1]# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]# echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1/
[root@rac2 grid_1]#
[root@rac2 grid_1]# echo $GRID_HOME
/u01/app/11.2.0/grid_1/
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 grid_1]# chmod -R 775 /u01/app/11.2.0/grid_1/
[root@rac2 grid_1]#
[root@rac2 grid_1]#
[root@rac2 oracle_software]# chmod -R 777 orcl_grid.rsp
[root@rac2 oracle_software]#
[root@rac2 oracle_software]# ls -lrt
total 615524
-rwxrwxrwx  1 grid oinstall  98352086 Feb  4 21:21 p6880880_112000_Linux-x86-64.zip
-rwxrwxrwx  1 grid oinstall     23977 Feb  4 21:21 PatchSearch.xml
-rwxrwxrwx  1 grid oinstall 531900097 Feb  4 21:22 p18139609_112040_Linux-x86-64.zip
drwxrwxrwx 15 grid oinstall      4096 Feb  4 21:22 OPatch
drwxrwxrwx  5 grid oinstall      4096 Feb  4 21:24 18139609
-rwxrwxrwx  1 grid oinstall      1067 Feb  4 21:27 orcl_grid.rsp
[root@rac2 oracle_software]#
[root@rac2 oracle_software]# /u01/app/11.2.0/grid_1/OPatch/opatch auto /u01/oracle_software/18139609 -ocmrf /u01/oracle_software/orcl_grid.rsp
Executing /u01/app/11.2.0/grid_1/perl/bin/perl /u01/app/11.2.0/grid_1/OPatch/crs/patch11203.pl -patchdir /u01/oracle_software -patchn 18139609 -ocmrf /u01/oracle_software/orcl_grid.rsp -paramfile /u01/app/11.2.0/grid_1/crs/install/crsconfig_params

This is the main log file: /u01/app/11.2.0/grid_1/cfgtoollogs/opatchauto2017-02-04_22-00-46.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0/grid_1/cfgtoollogs/opatchauto2017-02-04_22-00-46.report.log

2017-02-04 22:00:46: Starting Clusterware Patch Setup
Using configuration parameter file: /u01/app/11.2.0/grid_1/crs/install/crsconfig_params

Stopping RAC /u01/app/oracle/product/11.2.0/dbhome_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully

patch /u01/oracle_software/18139609/18031668  apply successful for home  /u01/app/oracle/product/11.2.0/dbhome_1
patch /u01/oracle_software/18139609/18031740/custom/server/18031740  apply successful for home  /u01/app/oracle/product/11.2.0/dbhome_1

Stopping CRS...
Stopped CRS successfully

patch /u01/oracle_software/18139609/18031668  apply successful for home  /u01/app/11.2.0/grid_1
patch /u01/oracle_software/18139609/18031740  apply successful for home  /u01/app/11.2.0/grid_1
patch /u01/oracle_software/18139609/18031731  apply successful for home  /u01/app/11.2.0/grid_1

Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.

Starting RAC /u01/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /u01/app/oracle/product/11.2.0/dbhome_1 successfully

opatch auto succeeded.
[root@rac2 oracle_software]#


select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STARTUP_TIME,STATUS from gv$instance;

INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME                                                        STARTUP_TIME         STATUS
--------------- ---------------- ---------------------------------------------------------------- -------------------- ------------
              1 orcl1            rac1.localdomain.com                                             04-FEB-2017 19:54:25 OPEN
              2 orcl2            rac2.localdomain.com                                             04-FEB-2017 22:29:58 OPEN


 cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @catbundle.sql psu apply
SQL> QUIT



cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

 SQL> select * from dba_registry_history;

ACTION_TIME         ACTION                NAMESPACE  VERSION          ID BUNDLE_SERIES            COMMENTS
-------------------- ------------------------------ ---------- ---------- ---------- ------------------------------ --------------------
24-AUG-13 12.03.45.1 APPLY                SERVER     11.2.0.4        0 PSU                Patchset 11.2.0.2.0
19862 PM

20-SEP-16 01.55.30.3 APPLY                SERVER     11.2.0.4        0 PSU                Patchset 11.2.0.2.0
72018 PM

05-FEB-17 01.34.14.8 APPLY                SERVER     11.2.0.4        2 PSU                PSU 11.2.0.4.2
86008 AM


SQL>



Error face during patching
=======================


2017-02-04 18:35:47: Oracle Interim Patch Installer version 11.2.0.3.15
 Copyright (c) 2017, Oracle Corporation.  All rights reserved.


 Oracle Home       : /u01/app/11.2.0/grid_1
 Central Inventory : /u01/app/oraInventory
    from           : /u01/app/11.2.0/grid_1/oraInst.loc
 OPatch version    : 11.2.0.3.15
 OUI version       : 11.2.0.4.0
 Log file location : /u01/app/11.2.0/grid_1/cfgtoollogs/opatch/opatch2017-02-04_18-35-46PM_1.log

 OPatch failed to lock and get an Inventory Session for the given Oracle Home /u01/app/11.2.0/grid_1
 Possible causes are:
    No read or write permission to $ORACLE_HOME, cannot create $ORACLE_HOME/.patch_storage
    No read or write permission to $ORACLE_HOME/.patch_storage
    OPatch cannot proceed further because system will not be able to backup files, or read the backup area for rollback/restore.
 OPatchSession cannot load inventory for the given Oracle Home /u01/app/11.2.0/grid_1. Possible causes are:
    No read or write permission to ORACLE_HOME/.patch_storage
    Central Inventory is locked by another OUI instance
    No read permission to Central Inventory
    The lock file exists in ORACLE_HOME/.patch_storage
    The Oracle Home does not exist in Central Inventory

 UtilSession failed: IPMRWServices::verifyPatchStorageDirectory() cannot read or write to /u01/app/11.2.0/grid_1/.patch_storage

 OPatch failed with error code 73

2017-02-04 18:35:47: Status of opatch version check  for /u01/app/11.2.0/grid_1 is 0
2017-02-04 18:35:47: Opatch version check failed for oracle home  /u01/app/11.2.0/grid_1
2017-02-04 18:35:47: Opatch version  check failed
2017-02-04 18:35:47: ERROR: update the opatch version for the failed homes and retry

solution : give permission to grid home



[root@rac1 oracle_software]#
[root@rac1 oracle_software]# chmod -R 775 /u01/app/11.2.0/grid_1/
[root@rac1 oracle_software]#

===================================================

[oracle@rac1 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/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/dbhome_1/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/dbhome_1/cfgtoollogs/opatch/opatch2017-02-05_02-31-06AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2017-02-05_02-31-06AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac1.localdomain.com
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.


Interim patches (2) :

Patch  18031740     : applied on Sat Feb 04 19:35:58 IST 2017
Unique Patch ID:  17253722
Patch description:  "OCW Patch Set Update : 11.2.0.4.2 (18031740)"
   Created on 19 Mar 2014, 09:06:31 hrs PST8PDT
   Bugs fixed:
     18328800, 16613232, 14525998, 14693336, 17273020, 17238586, 12928658
     17391726, 17750548, 17387214, 18229842, 17172091, 17001914, 16346413
     17155238, 17551223, 15832129, 17305100, 17483479, 17039197, 16317771
     17292250, 17500165, 16206997, 17481314, 16876500, 17405302, 17065496
     18343490, 13991403

Patch  18031668     : applied on Sat Feb 04 19:32:54 IST 2017
Unique Patch ID:  17255543
Patch description:  "Database Patch Set Update : 11.2.0.4.2 (18031668)"
   Created on 20 Feb 2014, 05:15:58 hrs PST8PDT
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
   Bugs fixed:
     17332800, 17284817, 17811456, 17752121, 14338435, 13944971, 18031668
     17394950, 17437634, 16943711, 17186905, 17080436, 16731148, 17027426
     18094246, 13866822, 16863422, 16043574, 17783588, 17811429, 17082359
     17385178, 17443671, 17610798, 17390431, 16875449, 16069901, 17478514
     17296856, 17811447, 16613964, 14010183, 18180390, 16850630, 16785708
     17865671, 17612828, 10136473, 17088068, 17016369, 17325413, 17323222
     16180763, 17811438, 16912439, 17040764, 13364795, 16228604, 17545847
     17346671, 16472716, 16285691, 17726838, 17614227, 17393683, 17551709
     17341326, 17546973, 17050888, 17344412, 17721717, 17546761, 17375354
     16618694, 18203835, 17446237, 18203838, 18203837, 17313525, 12905058
     14852021, 17288409, 16956380, 18139690, 16399083, 17716305, 16837842
     17622427, 14133975, 17501491, 17761775, 17389192, 17468141, 16450169
     17265217, 17441661, 17071721, 17465741, 17235750, 16721594, 17205719
     16220077, 17602269, 16929165, 17239687



Rac system comprising of multiple nodes
  Local node = rac1
  Remote node = rac2

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

OPatch succeeded.
[oracle@rac1 OPatch]$





[grid@rac1 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/11.2.0/grid_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0/grid_1/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid_1/cfgtoollogs/opatch/opatch2017-02-05_02-32-34AM_1.log

Lsinventory Output file location : /u01/app/11.2.0/grid_1/cfgtoollogs/opatch/lsinv/lsinventory2017-02-05_02-32-34AM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rac1.localdomain.com
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

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


Interim patches (3) :

Patch  18031731     : applied on Sat Feb 04 19:50:43 IST 2017
Unique Patch ID:  17253722
Patch description:  "ACFS Patch Set Update : 11.2.0.4.2 (18031731)"
   Created on 17 Mar 2014, 06:35:22 hrs PST8PDT
   Bugs fixed:
     17172303, 17203009, 17376318, 17363999, 17721778, 17611362, 17164243
     17428148, 17070158, 17699423, 17475946

Patch  18031740     : applied on Sat Feb 04 19:47:12 IST 2017
Unique Patch ID:  17253722
Patch description:  "OCW Patch Set Update : 11.2.0.4.2 (18031740)"
   Created on 19 Mar 2014, 09:06:37 hrs PST8PDT
   Bugs fixed:
     18328800, 16613232, 14525998, 14693336, 17273020, 17238586, 12928658
     17391726, 17750548, 17387214, 18229842, 17172091, 17001914, 16346413
     17155238, 17551223, 15832129, 17305100, 17483479, 17039197, 16317771
     17292250, 17500165, 16206997, 17481314, 16876500, 17405302, 17065496
     18343490, 13991403

Patch  18031668     : applied on Sat Feb 04 19:44:09 IST 2017
Unique Patch ID:  17255543
Patch description:  "Database Patch Set Update : 11.2.0.4.2 (18031668)"
   Created on 20 Feb 2014, 05:15:58 hrs PST8PDT
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
   Bugs fixed:
     17332800, 17284817, 17811456, 17752121, 14338435, 13944971, 18031668
     17394950, 17437634, 16943711, 17186905, 17080436, 16731148, 17027426
     18094246, 13866822, 16863422, 16043574, 17783588, 17811429, 17082359
     17385178, 17443671, 17610798, 17390431, 16875449, 16069901, 17478514
     17296856, 17811447, 16613964, 14010183, 18180390, 16850630, 16785708
     17865671, 17612828, 10136473, 17088068, 17016369, 17325413, 17323222
     16180763, 17811438, 16912439, 17040764, 13364795, 16228604, 17545847
     17346671, 16472716, 16285691, 17726838, 17614227, 17393683, 17551709
     17341326, 17546973, 17050888, 17344412, 17721717, 17546761, 17375354
     16618694, 18203835, 17446237, 18203838, 18203837, 17313525, 12905058
     14852021, 17288409, 16956380, 18139690, 16399083, 17716305, 16837842
     17622427, 14133975, 17501491, 17761775, 17389192, 17468141, 16450169
     17265217, 17441661, 17071721, 17465741, 17235750, 16721594, 17205719
     16220077, 17602269, 16929165, 17239687



Rac system comprising of multiple nodes
  Local node = rac1
  Remote node = rac2

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

OPatch succeeded.
[grid@rac1 OPatch]$