Oracle 19c Grid/clusterware patching commands
To Relocate Database from One RAC to Another RAC Node
srvctl relocate database -d esr1pcdb -node Easyserver2 -verbose
srvctl relocate database -d esr1pcdb -node Easyserver1 -verbose
srvctl relocate database -d esr2pcdb -node Easyserver2 -verbose
/oracle/esrgrid/19.0.0/crs/install/rootcrs.sh -prepatch
To Rollback patch in RAC Environment Manually
--cd /oracle/software/jdk/
FROM GRID HOME
opatch rollback -id 33197296
FROM RDBMS HOME
opatch rollback -id 33197296 -- rdbms
opatch rollback -id 33197296 -- rdbms (2nd home)
/oracle/esrgrid/19.0.0/rdbms/install/rootadd_rdbms.sh
/oracle/esrgrid/19.0.0/crs/install/rootcrs.sh -postpatch
To Apply patch in RAC Environment using opatchauto
/oracle/esrgrid/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 -analyze
nohup /oracle/esrgrid/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 &
eg
/oracle/esrgrid/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 -analyze
/oracle/esr1pcdb/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 -oh /oracle/esr1pcdb/19.0.0 -analyze
/oracle/esr2pcdb/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 -oh /oracle/esr2pcdb/19.0.0 -analyze
nohup /oracle/esrgrid/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 &
nohup /oracle/esr1pcdb/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 -oh /oracle/esr1pcdb/19.0.0 &
nohup /oracle/esr2pcdb/19.0.0/OPatch/opatchauto apply /oracle/software/JUL_PSU_GRID/32895426 -oh /oracle/esr2pcdb/19.0.0 &
----------------------------------------------------------------------
To Apply patch in RAC Environment Manually
/oracle/esrgrid/19.0.0/crs/install/rootcrs.sh -prepatch
FROM GRID
cd /oracle/software/OCT_JDK/33197296
opatch apply
FROM RDBMS HOME
cd /oracle/software/OCT_JDK/33197296
opatch apply
opatch apply (2nd home)
From Root
/oracle/esrgrid/19.0.0/crs/rdbms/install/rootadd_rdbms.sh
/oracle/esrgrid/19.0.0/crs/install/rootcrs.sh -postpatch
----------------------------------------------------------------------------------------------
==================Details commands========================
---user equivalance-------------
1) https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=463749886522740&parent=DOCUMENT&sourceId=2464376.1&id=300548.1&_afrWindowMode=0&_adf.ctrl-state=kihwsaqpi_4
2) https://docs.oracle.com/en/database/oracle/oracle-database/18/cwaix/add-all-keys-to-common-authorized-keys-file.html#GUID-6187332B-691C-4221-8B50-E8B46364AD2F
3) https://www.oracle.com/webfolder/community/oracle_database/4318763.html
==Solaris oratab entry==================
cat /var/opt/oracle/oratab
======================================
cd
cd .ssh
ls -ltr
[sppa005:root:/home/root:] ps -ef|grep pmon
oragrid 15204854 1 0 Oct 20 - 4:18 asm_pmon_+ASM1
oradbs 16580982 1 0 Nov 30 - 8:14 ora_pmon_sblprep1
[sppa005:root:/home/root:] ssh
[sppa005:root:/home/root:] su - oragrid
$ cd
$ cd .ssh
$ ls -ltr
total 32
-rw------- 1 oragrid oinstall 397 Aug 05 2019 id_rsa.pub
-rw------- 1 oragrid oinstall 1679 Aug 05 2019 id_rsa
-rw------- 1 oragrid oinstall 795 Aug 08 2019 authorized_keys
-rw-r--r-- 1 oragrid oinstall 1070 Dec 09 10:34 known_hosts
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxPgMZfAsieBn5VVD6Jd6NDTdrV9CWGsldBm6LOyng6So4gVlcaQyw8dyf7o5OUcl+Tk/IyoVjMRafyTzKQZNMoa4jMEAdfhOG9ZMDRkhHGwpHTC69f1OMVg+GHVn7uzMkoA4a62puf53hLSph2HP8gn45Xs8ZdXEsAUlWdnJfDyjrzefZqL6qxFQ2qmyYpnklYa2IL2kaA62tORn3Jm/ljTilQs+0N0xrhFcM++CBJea5dy60dFqMFy0lnRuFTmtBc0jZAHjdZm15G87egByBE3K0TuaaVMLtmZ/f9l5f//ZxCkSBZtj0XBX4Q7RZ+nINlUgOc/guHO3ZP8ONILKx oragrid@sppa005
$ exit
[sppa005:root:/home/root:] su - oradbs
[YOU HAVE NEW MAIL]
$ cd ..
$ cd
$ cd .ssh
$ exit
[sppa005:root:/home/root:] su - oradbs
[YOU HAVE NEW MAIL]
$ cd
$
$ cd .ssh
$ ls -ltr
total 32
-rw------- 1 oradbs oinstall 396 Aug 05 2019 id_rsa.pub
-rw------- 1 oradbs oinstall 1679 Aug 05 2019 id_rsa
-rw------- 1 oradbs oinstall 1600 Sep 04 2020 authorized_keys
-rw-r--r-- 1 oradbs oinstall 1255 Jan 18 13:35 known_hosts
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYLu1ECJJ0TfdYQDamY9wC6rELBSUM7E7tWxTJYuINoFe2BPr6pOIuk4eZs/WKRYIFWc3TDIE0k+xVwffpBXNQJRax/G7MqRXfYB756HfaG+Oh50m1M4R3Cojp/n5smXoheYmGqqkoLk5qBsCFlLYgMkmllpo00oRJ7OSN2gglldof5/ivB/KR5salHOeyeSCDbTN09T/3YIp7+gAhgq8MQR9azKr3RlaTcYTj5WQwvOqmp1c3RzNOb3PfZLS7gAs42wPMEgyMO3CV9PCDrh4TMPpZxiHF4boD/AvvkWhK2Aa2Rpcnn/OCOumydGbqy1Xu1sHBJSIv2PVWc1tFmVxp oradbs@sppa005
$
If multiple database running one one server . We need to set profile for particular standby Database as below
. ./.profile_esr2pcdb
sqlplus / as sysdba
sql> startup
alter database recover managed standby database disconnect using current logfile;
To Verify port
telnet <server name> 22
To clean patch related log files
opatch util cleanup
To check free space on server
du -sh*
if we have bug on database ,we can apply patch as below
You need to apply the patch as in below sequence.
a) Apply July PSU
b) Apply bug fix patch
The bug fix patch link is available in SR à https://updates.oracle.com/Orion/Services/download/p29930457_12102210720_AIX64-5L.zip?aru=24516785&patch_file=p29930457_12102210720_AIX64-5L.zip
==================
To search profile on server
ls -la .prof*
./.profile_arsdcdb
. ./.profile_esr1pcdb_1
Environment setting
export ORACLE_BASE=/oracle/cmrprod
export ORACLE_HOME=/oracle/cmrprod/12.1.0.2
export ORACLE_SID=cmrprod1
export OPATCH=/oracle/cmrprod/12.1.0.2/OPatch
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH:/usr/ccs/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr
or
export ORACLE_BASE=/oracle/oragrid
export ORACLE_HOME=/oracle/dbugrid/12.1.0.2
export ORACLE_SID=+ASM1
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export ORACLE_BASE=/oracle/dbutest
export ORACLE_HOME=/oracle/dbutest/12.1.0.2
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
To Transfer files from one server to another server , We need to use scp os command
scp p6880880_122010_AIX64-5L.zip cpyuser@stsa003:<location>
scp p6880880_122010_AIX64-5L.zip cpyuser@stsa004:<location>
scp /oracle/oracle-patches/19.12.0.0.210720/p32895426_190000_SOLARIS64.zip cpyuser@spps019:/oracle/softwares/
To Take Backup for inventory
cd /oracle/oraInventory
tar -cvf /oracle/softwares/grid_home_inventory.tar .
du -hP /oracle/softwares/grid_home_inventory.tar
To stop/start instance on one Node
srvctl stop instance -d sblprep -i sblprep1 -o immediate
srvctl start instance -d dbutest -i dbutest1
To stop/start instance on other Node
srvctl stop instance -d dbutest -i dbutest2 -o immediate
srvctl start instance -d dbutest -i dbutest2
srvctl stop instance -d dspscdb -i dspscdb2 -o immediate
srvctl start instance -d dspscdb -i dspscdb2
To Check Database status in RAC Environment
$ srvctl status database -d dbutest
Instance dbutest1 is running on node stsa003
Instance dbutest2 is running on node stsa004
Apply patch in RAC Environment
To validate inventory and update new opatch version
oragrid@spps018:/oracle/dspsgrid/19.0.0/OPatch$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2022, Oracle Corporation. All rights reserved.
Oracle Home : /oracle/dspsgrid/19.0.0
Central Inventory : /oracle/oraInventory
from : /oracle/dspsgrid/19.0.0/oraInst.loc
cd /oracle/sblppgrid/12.1.0.2/
mv OPatch OPatch_old_jan
cp /oracle/software/octru/p6880880_122010_AIX64-5L.zip /oracle/sblppgrid/12.1.0.2/
cp /oracle/software/octru/p6880880_122010_AIX64-5L.zip /oracle/sblprep/12.1.0.2/
unzip 6880880_122010_AIX64-5L.zip
rm 6880880_122010_AIX64-5L.zip
chown -R oragrid:oinstall OPatch
chown -R oradbs:oinstall OPatch
chmod -R 775 OPatch
chown -R oragrid:oinstall softwares
chown oragrid:oinstall software
or
chown -R oradbs:oinstall OPatch
chmod 775 OPatch
chmod -R 775 32895426
chmod -R 775 32917447
chmod -R 775 32928749
chmod -R 775 octru
chown -R oragrid:oinstall octru
chmod -R 775 octru
-------------
from root user
ps -ef|grep pmon
cd /oracle/dspsgrid/19.0.0/bin
./crsctl stop crs
or
./crsctl stop has
cd /oracle/oraInventory
cd /oracle/oraInventory
tar -cvf /oracle/software/grid_home_inventory.tar .
du -hP /oracle/softwares/grid_home_inventory.tar
./crsctl start crs
or
./crsctl start has
export PATH=$PATH:/oracle/dspsgrid/19.0.0/OPatch
cd /oracle/dspsgrid/19.0.0/OPatch
df -hk /oracle/dspsgrid/19.0.0/OPatch
df -hk /tmp
cd /oracle/softwares/32895426
./opatch version
id
ps -ef|grep pmon
/oracle/dspsgrid/19.0.0/OPatch/opatchauto apply /oracle/softwares/32895426 -analyze -oh /oracle/dspsgrid/19.0.0
implementation
nohup /oracle/dspsgrid/19.0.0/OPatch/opatchauto apply /oracle/softwares/32895426 -oh /oracle/dspsgrid/19.0.0 &
=====Database patch=============================
export PATH=$PATH:/oracle/dspscdb/12.2.0.1/OPatch
cd /oracle/dspscdb/12.2.0.1/OPatch
df -hP /oracle/dspscdb/12.2.0.1/OPatch
df -hP /tmp
cd /oracle/softwares/32928749
./opatch version
id
ps -ef|grep pmon
/oracle/dspscdb/12.2.0.1/OPatch/opatchauto apply /oracle/softwares/32928749 -analyze -oh /oracle/dspscdb/12.2.0.1
-------implementation---------
nohup /oracle/dspscdb/12.2.0.1/OPatch/opatchauto apply /oracle/softwares/32928749 -oh /oracle/dspscdb/12.2.0.1 &
-------post patch---
./opatch lsinv|grep applied
Patch 33112931 : applied on Wed Jan 12 07:33:21 GMT+03:00 2022
Patch 32768233 : applied on Wed Jan 12 07:32:14 GMT+03:00 2022
Patch 32758932 : applied on Wed Jan 12 07:30:39 GMT+03:00 2022
Patch 26983807 : applied on Fri Apr 02 20:26:22 GMT+03:00 2021
$ ./opatch lspatches
33112931;ACFS PATCH SET UPDATE 12.1.0.2.210720 (33112931)
32768233;Database Patch Set Update : 12.1.0.2.210720 (32768233)
32758932;OCW PATCH SET UPDATE 12.1.0.2.210720 (32758932)
26983807;WLM Patch Set Update: 12.1.0.2.180116 (26983807)
oragrid@spps019:~$
oragrid@spps019:~$ $ORACLE_HOME/jdk/jre/bin/java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
===========JDK=====================
p33197296_190000_Linux-x86-64.zip --19c JDK patch -oct 2021
p33197448_122010_SOLARIS64.zip ---12.2 JDK Patch - oct 2021
Patch 33497160: JDK BUNDLE PATCH 19.0.0.0.220118 -- jan2022
p33497187_122010_SOLARIS64.zip -- jan2022
Patch 33497195: JDK BUNDLE PATCH 12.1.0.2.220118 -- Jan2022
To find file uisng OS command
find . -name 33497195.* 2>/dev/null
/oracle/JDK_Patches/JDK_Patches_Jan2022
[oracle@mprl500 JDK_Patches_Jan2022]$ ls -lrt
total 555584
-rwxrwxr-x 1 oracle dba 127073150 Jan 18 12:53 p33497160_190000_Linux-x86-64.zip
-rwxrwxr-x 1 oracle dba 79653082 Jan 21 16:27 p33497160_190000_SOLARIS64.zip
-rwxrwxr-x 1 oracle dba 79620448 Jan 21 19:45 p33497187_122010_SOLARIS64.zip
-rwxrwxr-x 1 oracle dba 97008076 Jan 21 21:32 p33497195_121020_SOLARIS64.zip
-rwxrwxr-x 1 oracle dba 58513219 Jan 21 21:54 p33497195_121020_Linux-x86-64.zip
-rwxrwxr-x 1 oracle dba 127038899 Jan 22 15:46 p33497187_122010_Linux-x86-64.zip
[oracle@mprl500 JDK_Patches_Jan2022]$
-----------grid----------------
oragrid@spps019:~$
oragrid@spps019:~$ $ORACLE_HOME/jdk/jre/bin/java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode)
oragrid@spps019:~$
-----------oracle home--------
oradbs@spps019:~$
oradbs@spps019:~$ $ORACLE_HOME/jdk/jre/bin/java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b09, mixed mode)
oradbs@spps019:~$
$ORACLE_HOME/jdk/jre/bin/java -version
cd /oracle/software/oct_jdk/33197296
opatch apply
$ORACLE_HOME/jdk/jre/bin/java -version
Apply JDK patch Manually on Grid and Oracle RAC Home
jdk patch-- p33197296_190000_SOLARIS64.zip -- 19c
jdk patch -- p33197448_122010_SOLARIS64.zip -- 12.d
stop database instance
/oracle/esrgrid/19.0.0/crs/install/rootcrs.sh -prepatch
From grid
Cd /oracle/softwares/33197296
Opatch apply
From rdbms home
Cd /oracle/softwares/33197448
Opatch apply
Opatch apply (2nd home)
From root
/oracle/esrgrid/19.0.0/rdbms/install/rootadd_rdbms.sh
/oracle/esrgrid/19.0.0/rdbms/install/rootcrs.sh -postpatch
==========clusterware details============
export ORACLE_BASE=/oracle/oragrid
export ORACLE_HOME=/oracle/frdgrid/19.0.0
export ORACLE_SID=+ASM
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:/usr/ccs/bin
root@spps019:/oracle# export PATH=$PATH:/oracle/dspsgrid/19.0.0/OPatch
root@spps019:/oracle# cd /oracle/dspsgrid/19.0.0/OPatch
root@spps019:/oracle/dspsgrid/19.0.0/OPatch# df -hk /oracle/dspsgrid/19.0.0/OPatch
Filesystem Size Used Available Capacity Mounted on
orabinpool/orabin 147G 117G 29.5G 80% /oracle
root@spps019:/oracle/dspsgrid/19.0.0/OPatch# df -hk /tmp
Filesystem Size Used Available Capacity Mounted on
swap 95.7G 39.9M 95.7G 1% /tmp
root@spps019:/oracle/dspsgrid/19.0.0/OPatch# cd /oracle/softwares/32895426
root@spps019:/oracle/softwares/32895426# ./opatch version
-bash: ./opatch: No such file or directory
root@spps019:/oracle/softwares/32895426# opatch version
OPatch Version: 12.2.0.1.27
OPatch succeeded.
root@spps019:/oracle/softwares/32895426# id
uid=0(root) gid=0(root)
root@spps019:/oracle/softwares/32895426# /oracle/dspsgrid/19.0.0/OPatch/opatchauto apply /oracle/softwares/32895426 -analyze -oh /oracle/dspsgrid/19.0.0
OPatchauto session is initiated at Wed Jan 12 12:24:09 2022
System initialization log file is /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchautodb/systemconfig2022-01-12_12-24-16PM.log.
Session log file is /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchauto/opatchauto2022-01-12_12-24-35PM.log
The id for this session is IJIS
Executing OPatch prereq operations to verify patch applicability on home /oracle/dspsgrid/19.0.0
Patch applicability verified successfully on home /oracle/dspsgrid/19.0.0
Executing patch validation checks on home /oracle/dspsgrid/19.0.0
Patch validation checks successfully completed on home /oracle/dspsgrid/19.0.0
OPatchAuto successful.
--------------------------------Summary--------------------------------
Analysis for applying patches has completed successfully:
Host:spps019
CRS Home:/oracle/dspsgrid/19.0.0
Version:19.0.0.0.0
==Following patches were SKIPPED:
Patch: /oracle/softwares/32895426/32585572
Log: /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-25-08PM_1.log
Reason: /oracle/softwares/32895426/32585572 is not required to be applied to oracle home /oracle/dspsgrid/19.0.0
==Following patches were SUCCESSFULLY analyzed to be applied:
Patch: /oracle/softwares/32895426/32916816
Log: /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-25-08PM_1.log
Patch: /oracle/softwares/32895426/32915586
Log: /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-25-08PM_1.log
Patch: /oracle/softwares/32895426/32918050
Log: /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-25-08PM_1.log
Patch: /oracle/softwares/32895426/32904851
Log: /oracle/dspsgrid/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-25-08PM_1.log
OPatchauto session completed at Wed Jan 12 12:27:53 2022
Time taken to complete the session 3 minutes, 45 seco
================Database =========
root@spps019:/oracle/softwares/32928749# ps -ef|grep pmon
oragrid 5260 1 0 Dec 02 ? 2:52 asm_pmon_+ASM2
oragrid 7491 1 0 Dec 02 ? 2:54 mdb_pmon_-MGMTDB
oradbs 8720 1 0 Dec 02 ? 6:32 ora_pmon_dspscdb2
root 16203 9049 0 12:37:38 pts/1 0:00 grep pmon
root@spps019:/oracle/softwares/32928749# /oracle/dspscdb/12.2.0.1/OPatch/opatchauto apply /oracle/softwares/32928749 -analyze -oh /oracle/dspscdb/12.2.0.1
OPatchauto session is initiated at Wed Jan 12 12:38:05 2022
System initialization log file is /oracle/dspscdb/12.2.0.1/cfgtoollogs/opatchautodb/systemconfig2022-01-12_12-38-39PM.log.
Session log file is /oracle/dspscdb/12.2.0.1/cfgtoollogs/opatchauto/opatchauto2022-01-12_12-39-32PM.log
The id for this session is 855M
Executing OPatch prereq operations to verify patch applicability on home /oracle/dspscdb/12.2.0.1
Patch applicability verified successfully on home /oracle/dspscdb/12.2.0.1
Executing patch validation checks on home /oracle/dspscdb/12.2.0.1
Patch validation checks successfully completed on home /oracle/dspscdb/12.2.0.1
Verifying SQL patch applicability on home /oracle/dspscdb/12.2.0.1
SQL patch applicability verified successfully on home /oracle/dspscdb/12.2.0.1
OPatchAuto successful.
--------------------------------Summary--------------------------------
Analysis for applying patches has completed successfully:
Host:spps019
RAC Home:/oracle/dspscdb/12.2.0.1
Version:12.2.0.1.0
==Following patches were SKIPPED:
Patch: /oracle/softwares/32928749/33116894
Reason: This patch is not applicable to this specified target type - "rac_database"
Patch: /oracle/softwares/32928749/26839277
Reason: This patch is not applicable to this specified target type - "rac_database"
Patch: /oracle/softwares/32928749/32918082
Reason: This patch is not applicable to this specified target type - "rac_database"
==Following patches were SUCCESSFULLY analyzed to be applied:
Patch: /oracle/softwares/32928749/31802727
Log: /oracle/dspscdb/12.2.0.1/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-39-57PM_1.log
Patch: /oracle/softwares/32928749/32916808
Log: /oracle/dspscdb/12.2.0.1/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-12_12-39-57PM_1.log
OPatchauto session completed at Wed Jan 12 12:43:31 2022
Time taken to complete the session 5 minutes, 28 seconds
root@spps019:/oracle/softwares/32928749#
============post implementation========
col action_time format a30;
col version format a13;
col description format a60;
set lin 200 head on feed on pagesize 100;
select patch_id, action_time, status, description from dba_registry_sqlpatch;
SQL> SQL> SQL> SQL>
PATCH_ID ACTION_TIME STATUS DESCRIPTION
---------- ------------------------------ ------------------------- ------------------------------------------------------------
30138470 13-JAN-20 04.02.13.478092 PM SUCCESS DATABASE OCT 2019 RELEASE UPDATE 12.2.0.1.191015
30886680 30-AUG-20 09.08.50.762806 PM SUCCESS DATABASE APR 2020 RELEASE UPDATE 12.2.0.1.200414
31741641 05-FEB-21 01.42.24.604744 AM SUCCESS DATABASE OCT 2020 RELEASE UPDATE 12.2.0.1.201020
32228578 03-MAY-21 06.39.13.225367 PM SUCCESS DATABASE JAN 2021 RELEASE UPDATE 12.2.0.1.210119
32507738 23-JUN-21 12.23.32.923495 AM SUCCESS DATABASE APR 2021 RELEASE UPDATE 12.2.0.1.210420
5 rows selected.
==================jkp patch log==============
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 33197448Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Backing up files...
Applying interim patch '33197448' to OH '/oracle/dspscdb/12.2.0.1'Patching component oracle.jdk, 1.8.0.91.0...
Patch 33197448 successfully applied.
Log file location: /oracle/dspscdb/12.2.0.1/cfgtoollogs/opatch/opatch2022-01-12_19-42-05PM_1.logOPatch succeeded.
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 33197296Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Backing up files...
Applying interim patch '33197296' to OH '/oracle/dspsgrid/19.0.0'
ApplySession: Optional component(s) [ oracle.jdk, 1.8.0.191.0 ] not present in the Oracle Home or a higher version is found.Patching component oracle.jdk, 1.8.0.201.0...
Patch 33197296 successfully applied.
Log file location: /oracle/dspsgrid/19.0.0/cfgtoollogs/opatch/opatch2022-01-12_19-35-38PM_1.logOPatch succeeded.
==================================
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /oracle/sgwtest/19.0.0/cfgtoollogs/opatch/opatch2022-01-22_12-23-53PM_1.log
OPatch failed with error code 73
oradbs@sdes028:…SU_JULY_2021/32895426/32904851$ fuser /oracle/sgwtest/19.0.0/lib/libclntsh.so.19.1
/oracle/sgwtest/19.0.0/lib/libclntsh.so.19.1: 8011m
oradbs@sdes028:…SU_JULY_2021/32895426/32904851$ fuserr
oradbs@sdes028:…SU_JULY_2021/32895426/32904851$ fuser /oracle/sgwtest/19.0.0/bin/rman
/oracle/sgwtest/19.0.0/bin/rman: 8011tm
oradbs@sdes028:…SU_JULY_2021/32895426/32904851$ ps -ef|grep -i 8011tm
oradbs 8822 6692 0 12:28:45 pts/6 0:00 grep -i 8011tm
oradbs@sdes028:…SU_JULY_2021/32895426/32904851$ ps -ef|grep -i 8011
To Rollback JDK patch in single instance
1) shutdown database
2)/oracle/software/PSU_JULY_2021/32895426/32904851
3) opatch rollback -id 32904851
4) start database and run
cd $ORACLE_HOME/OPatch
./datapatch -verbose
3)/oracle/software/PSU_JULY_2021/32895426/32916816
opatch rollback -id 32916816
start database
==================================
This is single node instance running on RAC, CRS is process is not running ,Only HA process is running
We need to apply RAC patch on Grid home and database . During GRID Home patch ,ASM should be up and running
And during database patch , database need to shutdown during auto patch apply and start database and apply sqlpatch manually
export ORACLE_SID=sgwtest
ORACLE_BASE=/oracle/sgwtest
ORACLE_HOME=/oracle/sgwtest/19.0.0
export ORACLE_BASE
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
OPATCH=/oracle/sgwtest/19.0.0/OPatch
PATH=$PATH:/oracle/sgwtest/19.0.0/OPatch
/oracle/sgwtest/19.0.0/OPatch/opatchauto apply /oracle/software/PSU_JULY_2021/32895426 -analyze -oh /oracle/sgwtest/19.0.0
nohup /oracle/sgwtest/19.0.0/OPatch/opatchauto apply /oracle/software/PSU_JULY_2021/32895426 -oh /oracle/sgwtest/19.0.0 &
=======January 2022 JDK patch=============
Patch 33518559
Simple Search Advanced Search Quick Links Saved Searches
Description Oracle SERVER JRE 8 Update 321
Product Java SE
Release
Oracle JDK 1.8.0_321
Platform or Language Click for more information about this option
Oracle Solaris on SPARC (64-bit)
Last Updated 18-JAN-2022
Size 64M (67582396 bytes)
Entitlement Class Click for more information about this option Software
Classification Click for more information about this option General
========================service stop============
srvctl stop instance -d cmrprod -i cmrprod1 -o immediate
$ ora_pmon_sblprep1
$ srvctl stop instance -d sblprep -i sblprep1 -o immediate
PRCD-1315 : failed to stop instances for database sblprep
PRCR-1014 : Failed to stop resource ora.sblprep.db
PRCR-1065 : Failed to stop resource ora.sblprep.db
CRS-2529: Unable to act on 'ora.sblprep.db' because that would require stopping or relocating 'ora.sblprep.sblsrvc_bms.svc', but the force option was not specified
$ crsctl
$ srvctl status database -d sblprep
Instance sblprep1 is running on node sppa005
Instance sblprep2 is running on node sppa006
$
$ srvctl status service -d sblprep
Service sblsrvc_bms is running on instance(s) sblprep1,sblprep2
Service sblsrvc_sbl is running on instance(s) sblprep1,sblprep2
Service sblugd is running on instance(s) sblprep1,sblprep2
srvctl stop service -db sblprep -service sblsrvc_bms -node sppa006
srvctl stop instance -d sblprep -i sblprep1
srvctl start instance -d sblprep -i sblprep2
srvctl stop instance -d sblprep -i sblprep2 -force
To list crontab job
$ crontab -l
=================relocate service==========
oragrid@mprs099:~$ srvctl status service -d rfmprod
Service rocfm_serv is running on instance(s) rfm1
Service rocfm_serv1 is running on instance(s) rfm1
oragrid@mprs099:~$
Now relocate service from orcl1 to orcl2
[oracle@rac1 ~]$ srvctl relocate service -d orcl -s myservice -i orcl1 -t orcl2
-i represents an old instance
-t represents a new instance
Service rocfm_serv is running on instance(s) rfm2
Service rocfm_serv1 is running on instance(s) rfm2
oradbs@mprs099:~$ srvctl status service -d rfmprod
Service rocfm_serv is running on instance(s) rfm1
Service rocfm_serv1 is running on instance(s) rfm2
srvctl relocate service -d rfmprod -s rocfm_serv1 -i rfmprod1 -t rfmprod2 -f
srvctl relocate service -d rfmprod -s rocfm_serv -i rfmprod1 -t rfmprod2 -f
srvctl relocate service -d rfmprod -s rocfm_serv1 -i rfmprod2 -t rfmprod1 -f
srvctl relocate service -d rfmprod -s rocfm_serv -i rfmprod2 -t rfmprod1 -f
oragrid@mprs099:~$ ps -ef|grep pmon
oradbs 7482 1 0 Feb 08 ? 27:54 ora_pmon_rfm1
oragrid 1642 1 0 Feb 08 ? 1:40 asm_pmon_+ASM1
oragrid 22678 22049 0 04:52:26 pts/3 0:00 grep pmon
oragrid@mprs099:~$ srvctl status service -d rfmprod
Service rocfm_serv is running on instance(s) rfm1
Service rocfm_serv1 is running on instance(s) rfm1
oragrid@mprs099:~$ srvctl relocate service -d rfmprod -s rocfm_serv1 -i rfmprod1 -t rfmprod2 -f
PRKO-2107 : Failed to find an instance rfmprod1 for database rfmprod
oragrid@mprs099:~$ srvctl relocate service -d rfmprod -s rocfm_serv1 -i rfm1 -t rfm2 -f
oragrid@mprs099:~$ srvctl status service -d rfmprod
Service rocfm_serv is running on instance(s) rfm1
Service rocfm_serv1 is running on instance(s) rfm2
oragrid@mprs099:~$
================12.1 manual DB patching==============
/oracle/software/JUL2021/32917447/32758932/custom/scripts/prepatch.sh -dbhome /oracle/sblprod/12.1.0.2
nohup /oracle/sblprod/12.1.0.2/OPatch/opatch apply -oh /oracle/sblprod/12.1.0.2 -local /oracle/software/JUL2021/32917447/32758932 -silent &
nohup /oracle/sblprod/12.1.0.2/OPatch/opatch apply -oh /oracle/sblprod/12.1.0.2 -local /oracle/software/JUL2021/32917447/32768233 -silent &
/oracle/software/JUL2021/32917447/32758932/custom/scripts/postpatch.sh -dbhome /oracle/sblprod/12.1.0.2
========================
afddriverstate version
afddriverstate supported
afdroot install
afdload start
asmcmd afd_lsdsk
afddriverstate version
afddriverstate supported
/oracle/ctlgrid/19.0.0/bin/afdroot install
/oracle/ctlgrid/19.0.0/bin/afdload start
asmcmd afd_lsdsk
======================
oradbs@mprs104:~$ cd .
oradbs@mprs104:~$ cd
oradbs@mprs104:~$ ls -ltr .prof*
-rw-r--r-- 1 oradbs oinstall 568 Apr 23 2020 .profile
-rw-r--r-- 1 oradbs oinstall 841 Oct 21 2020 .profile_lpprod_1
-rw-r--r-- 1 oradbs oinstall 847 Oct 30 2020 .profile_lpprod_1_11
-rw-r--r-- 1 oradbs oinstall 841 Oct 30 2020 .profile_lpprod_2
-rw-r--r-- 1 oradbs oinstall 846 Nov 10 2020 .profile_repprod_1_19
-rw-r--r-- 1 oradbs oinstall 846 Nov 28 2020 .profile_repprod_1
-rw-r--r-- 1 oradbs oinstall 846 Nov 28 2020 .profile_repprod_2
-rw-r--r-- 1 oradbs oinstall 841 Dec 12 2020 .profile_lpprod
-rw-r--r-- 1 oradbs oinstall 846 Jan 9 2021 .profile_repprod
-rw-r--r-- 1 oradbs oinstall 657 Dec 14 13:04 .profile_Agent13
oradbs@mprs104:~$ ./.profile_repprod_2^C
oradbs@mprs104:~$
oradbs@mprs104:~$ ./. .profile_repprod_2
-bash: ./.: Is a directory
oradbs@mprs104:~$ ./^C
oradbs@mprs104:~$
oradbs@mprs104:~$ . ./.profile_repprod_2
oradbs@mprs104:~$
oradbs@mprs104:~$ srvctl relocate database -d repprodn -node mprs105 -verbose
Configuration updated to two instances
srvctl relocate database -d repprodn -node mprs104 -verbose
oradbs@mprs104:~$ . ./.profile_lpprod_1
oradbs@mprs104:~$
oradbs@mprs104:~$ srvctl relocate database -d lpprodn -node mprs105 -verbose
Configuration updated to two instances
Instance lpprod_2 started
Services relocated
Waiting for up to 30 minutes for instance lpprod_1 to stop ...
Instance lpprod_1 stopped
Configuration updated to one instance
You have new mail in /var/mail/oradbs
srvctl relocate database -d lpprodn -node mprs104 -verbose
oradbs@mprs104:~$ ./. .profile_repprod_2
-bash: ./.: Is a directory
oradbs@mprs104:~$
oradbs@mprs104:~$ . ./.profile_repprod_2
oradbs@mprs104:~$ srvctl relocate database -d repprodn -node mprs104 -verbose
Configuration updated to two instances
Instance repprod_2 started
Services relocated
Waiting for up to 30 minutes for instance repprod_1 to stop ...
Instance repprod_1 stopped
Configuration updated to one instance
oradbs@mprs104:~$
oradbs@mprs104:~$
oradbs@mprs104:~$ . ./.profile_lpprod_1
oradbs@mprs104:~$
oradbs@mprs104:~$
oradbs@mprs104:~$ srvctl relocate database -d lpprodn -node mprs104 -verbose
Configuration updated to two instances
Instance lpprod_1 started
Services relocated
Waiting for up to 30 minutes for instance lpprod_2 to stop ...
Instance lpprod_2 stopped
Configuration updated to one instance
oradbs@mprs104:~$
oradbs@mprs104:~$
oradbs@mprs104:~$
===============
==Following patches were SUCCESSFULLY applied:
Patch: /tmp/octru/32895426/32904851
Log: /oracle/lpprod/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-02-13_06-21-17AM_1.log
Patch: /tmp/octru/32895426/32916816
Log: /oracle/lpprod/19.0.0/cfgtoollogs/opatchauto/core/opatch/opatch2022-02-13_06-21-17AM_1.log
Patching session reported following warning(s):
_________________________________________________
[WARNING] This is a RACOne Database. After completing patching on all the nodes, apply the datapatch step manually on the node where database instance is running. Please refer to the log file for more details.
To find out the node where database instance is running, execute the following command,
$ORACLE_HOME/bin/srvctl status database -d LPPRODN
OPatchauto session completed at Sun Feb 13 06:31:59 2022
Time taken to complete the session 12 minutes, 41 seconds
=====################=============
Jan JDK in single instance
[oracle@eecsaruh2hor002:/tmp/jdkjan] cd
[oracle@eecsaruh2hor002:/tmp/jdkjan] ls -ltr
total 243484
drwxrwxr-x 4 oracle oinstall 67 Dec 22 21:34 33497160
-rw-rw-r-- 1 oracle oinstall 2475 Jan 18 12:52 PatchSearch.xml
-rwxr-x--- 1 oracle oinstall 127073150 Feb 15 17:39 p33497160_190000_Linux-x86-64.zip
-rwxr-x--- 1 oracle oinstall 122247289 Feb 15 17:40 p6880880_122010_Linux-x86-64.zip
[oracle@eecsaruh2hor002:/tmp/jdkjan] cd 33497160
[oracle@eecsaruh2hor002:/tmp/jdkjan/33497160] /dbfiles/app/oracle/product/19.0.0/OPatch/opatch version
OPatch Version: 12.2.0.1.28
OPatch succeeded.
[oracle@eecsaruh2hor002:/tmp/jdkjan/33497160] /dbfiles/app/oracle/product/19.0.0/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.28
Copyright (c) 2022, Oracle Corporation. All rights reserved.
Oracle Home : /dbfiles/app/oracle/product/19.0.0
Central Inventory : /dbfiles/app/product/oraInventory
from : /dbfiles/app/oracle/product/19.0.0/oraInst.loc
OPatch version : 12.2.0.1.28
OUI version : 12.2.0.7.0
Log file location : /dbfiles/app/oracle/product/19.0.0/cfgtoollogs/opatch/opatch2022-02-15_19-40-02PM_1.log
Verifying environment and performing prerequisite checks...
=========JDK patch apply==single instance========
33497195
./opatch lsinv|grep applied|grep -i 33497195
1) check opatch version
/product/oracle/19.0.0/OPatch/opatch version
$ORACLE_HOME/OPatch/opatch version
2) conflict patch
oradbs@mprs106:…e/software/JULYPSU/db/32904851$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.28
3) apply patch
/product/oracle/19.0.0/OPatch/opatch apply
4) jdk version
oragrid@spps019:~$
[oracle@eecsaruh2hor022:/var/tmp/janjdk/33497160] $ORACLE_HOME/jdk/jre/bin/java -version
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)
[oracle@eecsaruh2hor022:/var/tmp/janjdk/33497160]
To relocate Database in Oracle Restart Enviroment
oradbs@sprs029:~$
oradbs@sprs029:~$ echo $ORACLE_HOME
oradbs@sprs029:~$ ps -ef|grep pmon
oragrid 16227 1 0 Feb 12 ? 0:50 asm_pmon_+ASM1
oradbs 12325 1 0 Feb 12 ? 2:08 ora_pmon_inprod_2
oragrid 18848 1 0 Feb 12 ? 0:49 mdb_pmon_-MGMTDB
oradbs 25123 23854 0 05:49:30 pts/5 0:00 grep pmon
oradbs@sprs029:~$ source .profile_
-ksh: .: .profile_: cannot open [No such file or directory]
oradbs@sprs029:~$ ls -ltr .pr
^C.pr: No such file or directory
oradbs@sprs029:~$ bash
oradbs@sprs029:~$ source .profile_
.profile_Agent13c .profile_inprod_1 .profile_inprod_2 .profile_ocsprod_1_11 .profile_ocsprod_11204 .profile_ocsprod_2_11
.profile_inprod .profile_inprod_1_19 .profile_ocsprod_1 .profile_ocsprod_11203 .profile_ocsprod_2
oradbs@sprs029:~$ source .profile_inprod_1
oradbs@sprs029:~$ echo $ORACLE_HOME
/oracle/inprod/19.0.0
oradbs@sprs029:~$ srvctl status database -d inprod
PRCD-1120 : The resource for database inprod could not be found.
PRCR-1001 : Resource ora.inprod.db does not exist
oradbs@sprs029:~$ srvctl status database -d inprodn
Instance inprod_2 is running on node sprs029
Online relocation: INACTIVE
oradbs@sprs029:~$ srvctl relocate database -d inprodn -v -n sprs030
Configuration updated to two instances
Instance inprod_1 started
Services relocated
Waiting for up to 30 minutes for instance inprod_2 to stop ...
Instance inprod_2 stopped
Configuration updated to one instance
You have new mail in /var/mail/oradbs
oradbs@sprs029:~$
oradbs@sprs029:~$
=====================jdk for agent==AHF##############################
Once you apply the VA fix patch (ex: OCT 33197296) the JDK will be updated with latest one
[oradbs@mprl219 bin]$ /oracle/eoc1pcdb/19.0.0/jdk/jre/bin/java -version
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)
After apply Java Patch now fix the Java version for Agent13c and AHF
1. for Agent13c
Replace below directory with DB ORACLE_HOME jdk directory
cd /oracle/Agent13c/agent_13.4.0.0.0/oracle_common
rm -rf jdk
cp -r /oracle/eoc1pcdb/19.0.0/jdk .
cp -r /oracle1/mwfparch/19.0.0/jdk .
cp -r /oracle1/mwfpgis/19.0.0/jdk .
----------------------------------------
2. For AHF
cd /opt/oracle.ahf
rm -rf jre
cp -r /oracle/eoc1pcdb/19.0.0/jdk .
---------------------------------------------
You can follow the same for OPatch if the version is not up to date.
/opt/oracle.ahf/jre/bin/java -version
cp /tmp/AHF-SOLARIS.SPARC64_v21.4.1.zip /oracle/software/ahf/
unzip AHF-SOLARIS.SPARC64_v21.4.1.zip
chmod -R 775 ahf
cd ahf
./ahf_setup -ahf_loc /opt/oracle.ahf
No comments:
Post a Comment