Oracle Patching: Difference between revisions

From AquaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 5: Line 5:


Download the latest version of the Oracle Instant Client
Download the latest version of the Oracle Instant Client
     https://www.oracle.com/database/technologies/instant-client/downloads.html
     https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
     You'll want to download both the basic and sdk packages for your system arch.
     You'll want to download both the basic and sdk packages for your system arch.


Line 12: Line 12:


Copy the instantclient directory to
Copy the instantclient directory to
     D:/oracle/instantclient_XX_X
     D:/Oracle/oracle/instantclient_XX_X


Update Env Vars  
Update Env Vars  
Line 21: Line 21:
     Under the System Variables, click New...
     Under the System Variables, click New...
     Enter the variable name OCI_LIB64
     Enter the variable name OCI_LIB64
     And the value: D:/oracle/instantclient_XX_X
     And the value: D:/Oracle/oracle/instantclient_XX_X
     Click OK, close those windows.
     Click OK, close those windows.


Line 48: Line 48:
     If OPatch is already installed rename the existing one to _old or _yyyymmdd
     If OPatch is already installed rename the existing one to _old or _yyyymmdd
     Unzip the file and place in $ORACLE_HOME
     Unzip the file and place in $ORACLE_HOME
     ex: D:\oracle\product\X.X.X.X\dbhome_1
     ex: D:\Oracle\oracle\product\X.X.X.X\dbhome_1
     Opatch can be run from this path.
     Opatch can be run from this path.


Line 55: Line 55:


== Obtain Patches ==
== Obtain Patches ==
Here's a horrific link to search results for Oracle DB 19, Windows:
    https://support.oracle.com/epmos/faces/PatchSearchResults?searchdata=%3Ccontext+type%3D%22ADVANCED%22+search%3D%22%26lt%3BSearch%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bproduct%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3B1-97KLC%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bproduct_family%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3Bfalse%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Brelease%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3B600000000101150%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bplatform%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3B233%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Blife_cycle%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3Bfalse%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bexclude_superseded%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3Bfalse%26quot%3B%2F%26gt%3B%26lt%3B%2FSearch%26gt%3B%22%2F%3E


== Shutdown Services ==
== Shutdown Services ==
Stop Apache Services
    Open the Services window and stop Tomcat and httpd
Stop Oracle Services
    Open the Services window and stop
    OracleOraDB19Home1TNSListener19C_LISTENER
    OracleServiceCARDS
    OracleVssWriterCARDS
Gracefully shutdown the DB:
     $ sqlpus
     $ sqlpus
     SQL> CONNECT SYS@CARDS AS SYSDBA
     SQL> CONNECT SYS@CARDS AS SYSDBA
Line 62: Line 75:
     SQL> SHUTDOWN IMMEDIATE
     SQL> SHUTDOWN IMMEDIATE


msdtc
     net stop msdtc
     net stop msdtc
If there are errors you may need to rename .dll that it says are still running
    I appended _old.dll to the ones that it gave errors on.


== Patch Dry Run ==
== Patch Dry Run ==
https://orahow.com/backup-oracle-home-and-inventory/


== Run Patch ==
== Run Patch ==
     navigate to where the patch is then run
     navigate to where the patch is then run
     opatch apply
     opatch apply
== Turn on Services ==
Start Apache Services
    Open the Services window and start Tomcat and httpd
Start Oracle Services
    Open the Services window and start
    OracleOraDB19Home1TNSListener19C_LISTENER
    OracleServiceCARDS
    OracleVssWriterCARDS

Latest revision as of 15:40, 14 August 2023

Install Oracle Instant Client[edit]

Install the current Microsoft VS Redistributable

   https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Download the latest version of the Oracle Instant Client

   https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
   You'll want to download both the basic and sdk packages for your system arch.

Extract both packages

   Copy the SDK directory from the SDK package and paste it into the other instantclient_XX_X directory

Copy the instantclient directory to

   D:/Oracle/oracle/instantclient_XX_X

Update Env Vars

   Click on the Windows Icon and type environment variables.
   click on "Edit the system environment variables".

Add Variable

   Under the System Variables, click New...
   Enter the variable name OCI_LIB64
   And the value: D:/Oracle/oracle/instantclient_XX_X
   Click OK, close those windows.

Install SQLplus Utility[edit]

Download the latest SQL*Plus Package

   https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html

Unzip and Install

   Unzip the package, copy the contents of the zipped folder and place them in D:/oracle/instantclient_XX_X.
   Why Oracle has these all separate instead of just one package that you need is beyond me.

Connect to the Database[edit]

Pop open a terminal (I've been using as Admin) and type

   sqlplus user/password@CARDS
   EX: sqlplus cwf/password@CARDS
   I assume if no password is provided it'll prompt, which is safer. 
   We'll need sqlplus later to turn off the database. Opatch won't apply the patch otherwise.

Download the latest Opatch[edit]

Use the below link to log onto oracle support and download the Opatch file.

   https://support.oracle.com/knowledge/Oracle%20Database%20Products/274526_1.html
   follow instructions provided on the page. You'll need a oracle account linked to a product to view.

Install Opatch

   If OPatch is already installed rename the existing one to _old or _yyyymmdd
   Unzip the file and place in $ORACLE_HOME
   ex: D:\Oracle\oracle\product\X.X.X.X\dbhome_1
   Opatch can be run from this path.

Determine current patch level[edit]

   opatch lsinventory -patch -detail

Obtain Patches[edit]

Here's a horrific link to search results for Oracle DB 19, Windows:

   https://support.oracle.com/epmos/faces/PatchSearchResults?searchdata=%3Ccontext+type%3D%22ADVANCED%22+search%3D%22%26lt%3BSearch%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bproduct%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3B1-97KLC%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bproduct_family%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3Bfalse%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Brelease%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3B600000000101150%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bplatform%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3B233%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Blife_cycle%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3Bfalse%26quot%3B%2F%26gt%3B%26lt%3BFilter+name%3D%26quot%3Bexclude_superseded%26quot%3B+op%3D%26quot%3Bis%26quot%3B+value%3D%26quot%3Bfalse%26quot%3B%2F%26gt%3B%26lt%3B%2FSearch%26gt%3B%22%2F%3E

Shutdown Services[edit]

Stop Apache Services

   Open the Services window and stop Tomcat and httpd

Stop Oracle Services

   Open the Services window and stop
   OracleOraDB19Home1TNSListener19C_LISTENER
   OracleServiceCARDS
   OracleVssWriterCARDS

Gracefully shutdown the DB:

   $ sqlpus
   SQL> CONNECT SYS@CARDS AS SYSDBA
   Enter password: <password>
   SQL> SHUTDOWN IMMEDIATE
msdtc
   net stop msdtc

If there are errors you may need to rename .dll that it says are still running

   I appended _old.dll to the ones that it gave errors on. 

Patch Dry Run[edit]

https://orahow.com/backup-oracle-home-and-inventory/

Run Patch[edit]

   navigate to where the patch is then run
   opatch apply

Turn on Services[edit]

Start Apache Services

   Open the Services window and start Tomcat and httpd

Start Oracle Services

   Open the Services window and start
   OracleOraDB19Home1TNSListener19C_LISTENER
   OracleServiceCARDS
   OracleVssWriterCARDS