Tuesday 13 October 2015

Oracle 11gR2 - Patching Oracle using oPatch

The following steps uses the patch set 10094017 as an example. This patch set fixes issues in both Oracle home and Grid home.

 

The following Environment variables are assumed  –

 

CRS_HOME = /app/oracle/grid/11.2/grid

RDBMS_HOME = /app/oracle/oracle/11.2/db

 

 

Prerequisites 

 

1.                   Make sure you have access as oracle,grid and root user.

2.                   Make sure you have the right amount of free space.

            Free space required is 5.1GB. To free up space on grid home and oracle home, two places to look at are

 

Ø                /app/oracle/grid/11.2/grid/.patch_storage.

This directory contains files created as backup everytime a patch is installed.

 

To free up space in this directory, issue the following command –

$opatch util cleanup <patch number with timestamp>

              that command will usually free up more than 2GB of space.

 

 

Ø  Log directories for the grid background processes.

 

Some of the files locations are -

              /app/oracle/grid/11.2/grid/log/diag/tnslsnr/node1/listener_scan/alert

              /app/oracle/grid/11.2/grid/log/thehostnamehere/cssd

              /app/oracle/grid/11.2/grid/log/ thehostnamehere /crsd

 

3.                   Check if you have the latest version of the opatch.

            It is recommended for the patch to be atleast the same version as Oracle currently installed.

           Current version of Oracle is 11.2.0.1.0. So the opatch is recommended to be atleast 11.2.0.1.0

 

       4.         Check if patch inventory is accessible

 

        Issue the following commands –

 

        $opatch lsinventory -detail -oh /app/oracle/grid/11.2/grid

        $opatch lsinventory -detail -oh /app/oracle/oracle/11.2/db

 

     5.         Check if the patch being installed does not conflict with a previously installed patch.

      $ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./

 

Installation steps

 

 Important first step : Read the README.TXT file that is included in the oPatch zip file.

 

      Place opatch in all the oracle and grid homes in all nodes.

      To achieve that, perform the following steps -

1.           Download zipped opatch file from oracle website.

2.           Copy the zipped opatch file to the following locations on all nodes where you plan to execute opatch –

/app/oracle/grid/11.2/grid

/app/oracle/oracle/11.2/db

3.           Unzip the zipped opatch file in the above directories.

This will result in the following new directories

/app/oracle/grid/11.2/grid/OPatch

/app/oracle/oracle/11.2/db/OPatch

This is the final installed opatch . You do not have to do anything more.

 

This specific patch should be applied as a rolling upgrade. All of the following steps should be followed for each node. Do not patch two nodes at once.

 

      1. Verify that the Oracle Inventory is properly configured.

         $ opatch lsinventory -detail -oh <CRS_HOME>

         $ opatch lsinventory -detail -oh <RDBMS_HOME>

         This command completes instantly

 

      2.relocate service for inst1 instance. relocated the services service1, service2 and service3

         This command takes about 30 seconds to complete.

 

       3.shut down the CRS managed resources running from DB home

          Issue the following command -

         $ <RDBMS_HOME>/bin/srvctl stop home -o <RDBMS_HOME> -s <status file location> -n  

             <node_name>#

         note the status file is created by the process

         This command completes in 4 minutes.

   

     4.Execute the following command as root to unlock protected files.

        $ <CRS_HOME>/crs/install/rootcrs.pl –unlock

        This command completes in 3 minutes.

 

       5. Save the RDBMS home configuration settings

        To achieve that,execute the following command –

        $ custom/server/10094017/custom/scripts/prepatch.sh -dbhome <RDBMS_HOME>

        This command completes instantly.

 

       6. Patch the CRS home files

       As the Oracle Clusterware (CRS) software owner, from the directory where the patch was unzipped;

       $ opatch napply -local -oh <CRS_HOME> -id 10094017

       This command finishes in ~17-20 minutes.

 

       7. Configure the CRS HOME

 

       After opatch completes, some configuration settings need to be applied to the patched files.

      To change owner and permissions as root execute the following;

      $ chmod +w <CRS_HOME>/log/<nodename>/agent

      $ chmod +w <CRS_HOME>/log/<nodename>/agent/crsd

      This command finishes instantly.

 

      8. Configure the RDBMS HOME

      After opatch completes, some configuration settings need to be applied to the patched files.

      As the  RDBMS software owner execute the following –

     $ server/10094017/custom/scripts/postpatch.sh -dbhome <RDBMS_HOME>

     This command finishes instantly.

 

     9. Security settings need to be restored on the CRS Home. This script will also restart the CRS daemons. Invoke this script as root.

     $ <CRS_HOME>/crs/install/rootcrs.pl -patch

     This command finishes in 3 minutes.

 

     $ <DB_HOME>/bin/srvctl start home -o <DB_HOME> -s <status file location> -n <node name>

     This command finishes in 4 minutes.

 

    10. On success you can determine whether the patch has been installed by using the following command -

     $ opatch lsinventory -detail -oh <CRS_HOME>

     $ opatch lsinventory -detail -oh <RDBMS_HOME>

 

 

This completes the patching of Oracle version 11.2.0.1

 

What can I learn right now in one minute that will be useful for the rest of my life?



For windows user only-

Use Window Button + Down Key to minimize the currently active window
Use Window Button + Up Key to maximize the currently active window
Use Window Button + Left Key to align the currently active window on the left and Right key to align on the right
Use Window Button + M to minimize all open windows.
'Windows key + D' to return directly to the desktop, minimizing all the open windows.(Credit Abhishek Naik)
Use CTRL+SHIFT+ESC to open task manager
Use Window key + L to lock the system.
Use Window key + # to open the application pinned on the taskbar, where # is the position of the icon Starting from 1.
Use Shift + Right click and then select open command prompt here to open the command prompt with the current directory set
Use Shift + Right click on any item to see extra options.



Download Video Without Signups

Some sites don't allow to download their video content without signing in or do not have facility to download at all.

So without using any extension or downloader, here is how to do this..

Goto that page.
Press ctrl+shift+i or right click and select Inspect Element.
Select the Network tab and refresh the page & play the video to get content status.
You can sort the content by TYPE (tab), to easily get the video link at the bottom under the NAME(tab).
Double click the video link. Voila, your download will start.
Works fine with many sites. Enjoy :)

Edit #1: For those who don't know, to download YouTube videos just add "ss" before 'y' in www.youtube.com.
Example: To download www.youtube.com/watch?v=ONi**mhDvRo
do, www.ssyoutube.com/watch?v=ONi**mhDvRo and go..

Edit #2:
"ssyoutube" redirects you to a third party website "savefromnet" that might serve malware/virus (very rare cases).  I have used this method and have not experienced any trouble so far. Take precautions!