How To Apply Oracle Patch On Windows Platform
How To Apply Oracle Patch On Windows Platform
Windows Platform
Step by Step Commands and Scripts
Asfaw Gedamu
1. Prerequisites:
2. Shutdown Services:
o opatch apply
4. Post-Installation Steps:
o After applying the patch, execute any required post-installation scripts (such
as datapatch).
5. Verification:
Purpose: This guide outlines the steps for applying an Oracle patch on a Windows platform.
Scope: This applies to database administrators responsible for patching Oracle databases on
Windows servers.
Assumptions:
• You have downloaded the appropriate patch for your Oracle version and platform.
• You have reviewed the patch readme for specific instructions and prerequisites.
Remember:
• Before applying any patch, it's important to create a backup of your system.
• Carefully review the readme file associated with the patch for specific instructions and
known issues.
• It's recommended to test the patch in a non-production environment before applying it to
your production system.
• If you're not comfortable applying the patch yourself, you can contact Oracle Support or
a qualified DBA for assistance.
Procedure:
1. Set oracle_home,patch_home, PATH and ORACLE_SID
SET ORACLE_HOME=E:\oracle\11.2.0\dbhome_1
SET PATH=E:\oracle\11.2.0\dbhome_1\bin;E:\oracle\11.2.0\dbhome_1\opatch;%PATH%
SET ORACLE_SID=ORCL
SET PATH=%ORACLE_HOME%\perl\bin;%PATH%
cd E:\patch
opatch prereq CheckConflictAgainstOHWithDetail -ph ./20233168
4. Check the opatch version and check the README of the patch you downloaded.
— Check that your opatch version is greater or same as mentioned in README.
opatch version
run {
allocate channel ch00 type disk;
allocate channel ch01 type disk;
allocate channel ch02 type disk;
backup format 'F:\rman\full_db_%t_%sp%p' filesperset 10 database plus archivelog;
release channel ch00;
release channel ch01;
release channel ch02;
allocate channel ch00 type disk;
backup format 'F:\rman\cntrl_%s_%p_%t' CURRENT CONTROLFILE;
backup format 'F:\rman\spfile_%s_%p_%t' spfile;
release channel ch00;
}
10. Check the registry$history table for check already patching history.
shutdown immediate;
17. Check the opatch log file generated at %ORACLE_HOME%\cfgtoollogs\opatch for error
18. Start the Oracle database Service for Post installation steps mentioned in readme.
19. Execute the Post steps for bundle patch:
-- In 11g readme steps need to follow for each patch have different steps:
cd %ORACLE_HOME%\Bundle\Patch36
STARTUP
SQL> @catwinbundle.sql
SQL> QUIT
-- In 12c readme steps need to follow:
cd %ORACLE_HOME%\opatch
datapatch -verbose
$ORACLE_BASE/cfgtoollogs/catbundle
catbundle_WINBUNDLE__APPLY_.log
catbundle_WINBUNDLE__GENERATE_.log
21. Compile the invalid objects and verify with before patching count:
cd %ORACLE_HOME%\rdbms\admin
sqlplus /nolog
CONNECT / AS SYSDBA
@utlrp.sql
select count(*) from dba_objects where status='INVALID';
22. Check the db_registry:
Rollback plan:
- Use a reliable file transfer tool to copy the entire old Oracle home directory to the new location.
- Ensure all permissions and ownership are preserved during the copy process.
2. Restore the database backup
run{
allocate channel t1 type DISK;
set until time "to_date('2015/02/27 12:52:00','yyyy/mm/dd HH24:MI:SS')";
restore controlfile from 'F:\rman\cntr_18_1';
release channel t1;
}alter database mount;
run {
allocate channel t1 type DISK;
set until time "to_date('2015/02/27 12:52:00','yyyy/mm/dd HH24:MI:SS')";
restore database;
release channel t1;
}
run {
allocate channel t1 type DISK;
set until time "to_date('2015/02/27 12:52:00','yyyy/mm/dd HH24:MI:SS')";
recover database;
release channel t1;
}
alter database open resetlogs;
Notes:
• This guide is a general guideline and may need adjustments based on your specific
environment and patch requirements.
• Always consult the patch readme for detailed instructions and potential variations.
• Document the entire patching process and maintain rollback plans for potential issues.
By following these steps and adapting it to your specific needs, you can ensure a smooth and
successful Oracle patch application on your Windows platform. Remember to prioritize data
integrity and maintain rollback plans throughout the process.
References:
Here are some resources on how to apply Oracle patches on Windows platforms:
Additional Resources: