How do I install Oracle patch on Windows database

I am trying to apply a CPU patch on my windows Oracle Database. I keep getting opatch errors related to Java:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>opatch lsinventory
File Not Found
Java could not be located. OPatch cannot proceed!

OPatch failed with error code = 1

C:\>opatch version
File Not Found
Java could not be located. OPatch cannot proceed!

OPatch failed with error code = 1

I found Java in the following directory: C:\oracle\product\10.2.0\db_1\jdk\jre\bin
So I added it to the PATH variable. But that didn't fix it. Could someone please help me? I know how to apply patches on Unix but not Windows.
sikyalaSenior Database AdministratorAsked:
Who is Participating?
MikeOM_DBAConnect With a Mentor Commented:

Did you set the ORACLE_HOME and ORACLE_SID environment variables?

And add C:\oracle\product\10.2.0\db_1\bin to the PATH.
joebednarzConnect With a Mentor Commented:
You might also have to add ORACLE_BASE to the environment.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

sikyalaSenior Database AdministratorAuthor Commented:
what is the proper procedure for adding those variables?

I right clicked on my computer and selected properties
clicked on the advanced tab
clicked on environment variables
under system variables I clicked on new
typed ORACLE_HOME next to variable name
typed C:\oracle\product\10.2.0 next to variable value
clicked ok
after doing this I couldn't start the listener or the database. I kept getting errors.

> add C:\oracle\product\10.2.0\db_1\bin to the PATH
This value is in my PATH variable
I also added C:\oracle\product\10.2.0\db_1\bin\OPatch to my PATH variable

I didn't set the ORACLE_BASE variable. I am not sure what the value should be. What should I do?
Open up a command prompt.  Type in:

SET ORACLE_HOME=C:\oracle\product\10.2.0\db_1

Then you should be able to run opatch:

opatch lsinventory
LindaCConnect With a Mentor Commented:
Start control panel - system
Advance - Environment variables

TNS_ADMIN = C:\oracle\product\10.2.0\db_1\network\admin
PATH----> Add this to the value:   C:\oracle\product\10.2.0\db_1\bin\OPatch, Notice that your path variable must have other values here.
Hi. you need to assign the points to your favorite answer.   it is about time.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.