PATCHING AN ORACLE DATABASE WITH OPATCH (Upgrade 19.3 to 19.13)

Telefonda veya pc de kullandığımız uygulamalara ve yazılımlara belirli aralıklarla nasıl güvenlik ve bug amaçlı update işlemleri gelmekte ise Oracle ürünlerinede bug ve güvenlik amaçlı yama (patch) gelmektedir.
https://www.oracle.com/security-alerts/ buradan takip edilebilir.

Bu dökümanlara erişmek için Oracle Support hesabına sahip olmalıyız.

Ben kaynak olarak aşağıdaki Oracle Support dökümanını referans alarak adımlarımı uygulayacağım.
Quick Reference to Patch Numbers for Database PSU, SPU(CPU), Bundle Patches and Patchsets (Doc ID 1454618.1)

Oracle veri tabanına Opatch aracını kullanarak patch geçeceğiz.

Patch adımlarına devam etmeden önce veri tabanı yedeğimizi almalıyız.

Uygulayacağımız adımlar özetle aşağıdaki gibidir.

  • Patch indirdik
  • Pre-install adımlarını kontrol ettik
  • Listener kapattık
  • Veri tabanı kapattık
  • Patch uyguladık
  • Veri tabanı açtık
  • Listener açtık
  • Patch Sonrası adımlarını yaptık (Post Patch Steps)
işlemlere başlamadan önceki versiyon durumu
Referans döküman
indirilmek istenilen paketi seçiyoruz
versiyon seçiyoruz
1 yılda 4 adet çıktığını görüyoruz.
işletim sistemine dikkat ederek seçim yapmalıyız.

Patch read me kısmına baktığımızda bize preinstall adımlarından bahsetmektedir.
Bu adımlardan biri Opatch versiyonudur. Eğer Opatch versiyonuna aşağıdaki gibi baktığımızda bu versiyon dökümanda belirtilenden eski ise öncelikli olarak “My Oracle Support patch 6880880 by selecting ‘Opatch 12.2.0.1.0’ release” ilgili dökümandan bunun versiyonunu en az belirtilen Opatch versiyon seviyesine getirmeliyiz.

[oracle@server OPatch]$ pwd
/orahome/app/oracle/product/19.3.0/dbhome_1/OPatch

[oracle@server OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.17

OPatch succeeded.

Benim versiyonum 12.2.0.1.17 ve bunu dökümanda belirtildiği gibi 12.2.0.1.27 yada sonrasına getirmeliyim.Burada açılan zip dosyasında Opatch dizini mevcut. Eski dizinin yedeğini alarak, güncel olan Opatch’i “/orahome/app/oracle/product/19.3.0/dbhome_1/” dizininde açıyoruz.

Release dikkat ederek indirmek gerekli. Release yanlış olursa işlemler yapılamaz
[root@server ~] chown oracle:oinstall p6880880_122010_Linux-x86-64.zip
[root@server ~] mv p6880880_122010_Linux-x86-64.zip /orahome/app/oracle/product/19.3.0/dbhome_1/
[root@server ~] su - oracle
[oracle@server dbhome_1]$ cd /orahome/app/oracle/product/19.3.0/dbhome_1
[oracle@server dbhome_1]$ mv OPatch OPatch_old
[oracle@server dbhome_1]$ unzip p6880880_122010_Linux-x86-64.zip 
[oracle@server dbhome_1]$ cd OPatch
[oracle@server OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.28

OPatch succeeded.
yedek alınan ve unzip edilen OPatch

Evet Opatch versiyonumuzu güncelledik.

Şimdi dökümandaki preinstall adımlarını takip ederek belirtilen adımları uyguluyoruz

[oracle@server 33248420]$ cd /tmp/33248420/33192694
[oracle@server 33192694]$ /orahome/app/oracle/product/19.3.0/dbhome_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.28
Copyright (c) 2022, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /orahome/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /orahome/app/oraInventory
   from           : /orahome/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.28
OUI version       : 12.2.0.7.0
Log file location : /orahome/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-01-13_14-13-20PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@server 33192694]$ cd /tmp/33248420/33192793
[oracle@server 33192793]$ /orahome/app/oracle/product/19.3.0/dbhome_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.28
Copyright (c) 2022, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /orahome/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /orahome/app/oraInventory
   from           : /orahome/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.28
OUI version       : 12.2.0.7.0
Log file location : /orahome/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-01-13_14-13-51PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@server 33192694]$ lsnrctl stop
[oracle@server 33192694]$ sqlplus / as sysdba
SQL> shutdown immediate;
[oracle@server 33192694]$ cd 33192694/
[oracle@server 33192694]$ /orahome/app/oracle/product/19.3.0/dbhome_1/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.28
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /orahome/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /orahome/app/oraInventory
   from           : /orahome/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.28
OUI version       : 12.2.0.7.0
Log file location : /orahome/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-01-13_14-28-15PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   33192694  

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/orahome/app/oracle/product/19.3.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '33192694' to OH '/orahome/app/oracle/product/19.3.0/dbhome_1'

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.javavm.server.core, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...
Patch 33192694 successfully applied.
Log file location: /orahome/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-01-13_14-28-15PM_1.log

OPatch succeeded.
[oracle@server 33192694]$ cd ..
[oracle@server 33248420]$ cd 33192793/
[oracle@server 33192793]$ /orahome/app/oracle/product/19.3.0/dbhome_1/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.28
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /orahome/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /orahome/app/oraInventory
   from           : /orahome/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.28
OUI version       : 12.2.0.7.0
Log file location : /orahome/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-01-13_14-35-15PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   33192793  

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/orahome/app/oracle/product/19.3.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '33192793' to OH '/orahome/app/oracle/product/19.3.0/dbhome_1'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.perlint, 5.28.1.0.0...

Patching component oracle.rdbms.locator, 19.0.0.0.0...

Patching component oracle.perlint.expat, 2.0.1.0.4...

Patching component oracle.rdbms.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.util, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.assistants.acf, 19.0.0.0.0...

Patching component oracle.assistants.deconfig, 19.0.0.0.0...

Patching component oracle.assistants.server, 19.0.0.0.0...

Patching component oracle.buildtools.rsf, 19.0.0.0.0...

Patching component oracle.ctx, 19.0.0.0.0...

Patching component oracle.dbjava.ic, 19.0.0.0.0...

Patching component oracle.dbjava.jdbc, 19.0.0.0.0...

Patching component oracle.dbjava.ucp, 19.0.0.0.0...

Patching component oracle.duma, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...

Patching component oracle.ldap.owm, 19.0.0.0.0...

Patching component oracle.ldap.rsf, 19.0.0.0.0...

Patching component oracle.marvel, 19.0.0.0.0...

Patching component oracle.network.rsf, 19.0.0.0.0...

Patching component oracle.odbc.ic, 19.0.0.0.0...

Patching component oracle.oracore.rsf, 19.0.0.0.0...

Patching component oracle.precomp.common.core, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms.deconfig, 19.0.0.0.0...

Patching component oracle.rdbms.oci, 19.0.0.0.0...

Patching component oracle.rhp.db, 19.0.0.0.0...

Patching component oracle.sdo, 19.0.0.0.0...

Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...

Patching component oracle.sqlplus, 19.0.0.0.0...

Patching component oracle.sqlplus.ic, 19.0.0.0.0...

Patching component oracle.wwg.plsql, 19.0.0.0.0...

Patching component oracle.rdbms.crs, 19.0.0.0.0...

Patching component oracle.network.listener, 19.0.0.0.0...

Patching component oracle.network.client, 19.0.0.0.0...

Patching component oracle.ctx.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.scheduler, 19.0.0.0.0...

Patching component oracle.rdbms.hs_common, 19.0.0.0.0...

Patching component oracle.xdk, 19.0.0.0.0...

Patching component oracle.ons.ic, 19.0.0.0.0...

Patching component oracle.xdk.xquery, 19.0.0.0.0...

Patching component oracle.rdbms.drdaas, 19.0.0.0.0...

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.ovm, 19.0.0.0.0...

Patching component oracle.dbdev, 19.0.0.0.0...

Patching component oracle.rdbms.dv, 19.0.0.0.0...

Patching component oracle.precomp.rsf, 19.0.0.0.0...

Patching component oracle.ctx.atg, 19.0.0.0.0...

Patching component oracle.ldap.security.osdt, 19.0.0.0.0...

Patching component oracle.ldap.client, 19.0.0.0.0...

Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...

Patching component oracle.xdk.parser.java, 19.0.0.0.0...

Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...

Patching component oracle.odbc, 19.0.0.0.0...

Patching component oracle.sdo.locator, 19.0.0.0.0...

Patching component oracle.dbtoolslistener, 19.0.0.0.0...

Patching component oracle.ons, 19.0.0.0.0...

Patching component oracle.oraolap.api, 19.0.0.0.0...

Patching component oracle.rdbms.hsodbc, 19.0.0.0.0...

Patching component oracle.rdbms.rman, 19.0.0.0.0...

Patching component oracle.rdbms.install.common, 19.0.0.0.0...

Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...

Patching component oracle.rdbms.lbac, 19.0.0.0.0...

Patching component oracle.mgw.common, 19.0.0.0.0...

Patching component oracle.xdk.rsf, 19.0.0.0.0...

Patching component oracle.oraolap, 19.0.0.0.0...

Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...

Patching component oracle.precomp.common, 19.0.0.0.0...

Patching component oracle.precomp.lang, 19.0.0.0.0...

Patching component oracle.jdk, 1.8.0.201.0...
Patch 33192793 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [33192793].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /orahome/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-01-13_14-35-15PM_1.log

OPatch succeeded.

Listener açalım ,sonrasında veri tabanımızı açalım.

[oracle@server 33192694]$ lsnrctl start
[oracle@server 33192694]$ sqlplus / as sysdba
SQL> startup;
[oracle@server OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.13.0.0.0 Production on Thu Jan 13 14:55:17 2022
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /orahome/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_5476_2022_01_13_14_55_17/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 33192694 (OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)):
  Binary registry: Installed
  SQL registry: Not installed

Current state of release update SQL patches:
  Binary registry:
    19.13.0.0.0 Release_Update 211004165050: Installed
  SQL registry:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 04-JAN-22 04.56.54.483423 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  Patch 33192793 (Database Release Update : 19.13.0.0.211019 (33192793)):
    Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.13.0.0.0 Release_Update 211004165050
  The following interim patches will be applied:
    33192694 (OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694))

Installing patches...
Patch installation complete.  Total patches installed: 2

Validating logfiles...done
Patch 33192793 apply: SUCCESS
  logfile: /orahome/app/oracle/cfgtoollogs/sqlpatch/33192793/24462514/33192793_apply_TEST_2022Jan13_14_56_52.log (no errors)
Patch 33192694 apply: SUCCESS
  logfile: /orahome/app/oracle/cfgtoollogs/sqlpatch/33192694/24421575/33192694_apply_TEST_2022Jan13_14_55_38.log (no errors)
SQL Patching tool complete on Thu Jan 13 15:04:17 2022

Patch işlemleri başarı ile tamamlandı.
Kontrol edelim hangi patchi geçtik, bu patch hangi tarihte çıkmıştı.

[oracle@server OPatch]$ ./opatch lsinventory|grep "Patch description"
Patch description:  "Database Release Update : 19.13.0.0.211019 (33192793)"
Patch description:  "OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)"
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"

Böylede kontrol edebiliriz. Yukarıdaki komutta görmek istediğimiz yerleri grepledik.

[oracle@server OPatch]$ ./opatch lsinventory

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir