Oracle Grid patch 19.27 19.27 Release Update ls -ltr /home/grid total 4000140 -rwxrwxrwx 1 root root 394 Nov 28 2024 asmdisk.sh -rwxr-xr-x 1 root root 33333 Nov 28 2024 sshUserSetup.sh -rw-r--r-- 1 grid oinstall 36664 Nov 29 2024 grid.rsp drwxr-x--- 15 grid oinstall 4096 Dec 23 2024 OPatch drwxr-x--- 8 grid oinstall 159 Apr 15 2025 37641958 -rw-rw-r-- 1 grid oinstall 2816591 Apr 16 2025 PatchSearch.xml -rw-r--r-- 1 grid oinstall 131979857 Dec 29 10:26 p6880880_190000_Linux-x86-64.zip -rw-r--r-- 1 grid oinstall 3961245851 Dec 30 09:13 p37641958_190000_Linux-x86-64.zip ---- patch No ###################################################################################################### $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37654975 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37643161 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37762426 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/36758186 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37642901 [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /home/grid/patch_list_gihome1.txt Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_10-58-09AM_1.log Invoking prereq "checksystemspace" Prereq "checkSystemSpace" passed. OPatch succeeded. [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37654975 Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_11-04-01AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [grid@ora-rac1 ~]$ cat /home/grid/patch_list_gihome1.txt /home/grid/37641958/37654975 /home/grid/37641958/37643161 /home/grid/37641958/37762426 /home/grid/37641958/36758186 /home/grid/37641958/37642901 [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37654975 Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_11-05-18AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37643161 Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_11-06-01AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37762426 Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_11-06-46AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/36758186 Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_11-07-29AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded. [grid@ora-rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/grid/37641958/37642901 Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_11-08-12AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. ============ [grid@ora-rac1 ~]$ cat /home/grid/patch_list_gihome1.txt /home/grid/37641958/37654975 /home/grid/37641958/37643161 /home/grid/37641958/37762426 /home/grid/37641958/36758186 /home/grid/37641958/37642901 $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /home/grid/patch_list_gihome1.txt Oracle Interim Patch Installer version 12.2.0.1.45 Copyright (c) 2025, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/19.0.0/grid Central Inventory : /u01/app/oraInventory from : /u01/app/19.0.0/grid/oraInst.loc OPatch version : 12.2.0.1.45 OUI version : 12.2.0.7.0 Log file location : /u01/app/19.0.0/grid/cfgtoollogs/opatch/opatch2025-12-30_10-58-09AM_1.log Invoking prereq "checksystemspace" Prereq "checkSystemSpace" passed. OPatch succeeded. ========= analyze [root@ora-rac1 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze OPatchauto session is initiated at Tue Dec 30 11:31:01 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_11-31-22AM.log. Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2025-12-30_11-32-10AM.log The id for this session is 421F Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid Patch applicability verified successfully on home /u01/app/19.0.0/grid Executing patch validation checks on home /u01/app/19.0.0/grid Patch validation checks successfully completed on home /u01/app/19.0.0/grid OPatchAuto successful. --------------------------------Summary-------------------------------- Analysis for applying patches has completed successfully: Host:ora-rac1 CRS Home:/u01/app/19.0.0/grid Version:19.0.0.0.0 ==Following patches were SKIPPED: Patch: /home/grid/37641958/36758186 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Reason: /home/grid/37641958/36758186 is not required to be applied to oracle home /u01/app/19.0.0/grid ==Following patches were SUCCESSFULLY analyzed to be applied: Patch: /home/grid/37641958/37654975 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Patch: /home/grid/37641958/37643161 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Patch: /home/grid/37641958/37762426 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Patch: /home/grid/37641958/37642901 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log ============== as root export ORACLE_HOME=/u01/app/19.0.0/grid export GRID_HOME=/u01/app/19.0.0/grid export PATH=$ORACLE_HOME/OPatch:$PATH [root@ora-rac1 grid]# pwd /home/grid [root@ora-rac1 grid]# cd 37641958 [root@ora-rac1 37641958]# ls -ltr total 164 drwxr-x--- 5 grid oinstall 62 Apr 15 2025 37654975 drwxr-x--- 5 grid oinstall 62 Apr 15 2025 37643161 drwxr-x--- 4 grid oinstall 48 Apr 15 2025 37762426 drwxr-x--- 4 grid oinstall 48 Apr 15 2025 36758186 drwxr-x--- 4 grid oinstall 67 Apr 15 2025 37642901 -rw-r--r-- 1 grid oinstall 0 Apr 15 2025 README.txt drwxr-x--- 2 grid oinstall 4096 Apr 15 2025 automation -rw-r--r-- 1 grid oinstall 152522 Apr 15 2025 README.html -rw-rw-r-- 1 grid oinstall 5824 Apr 15 2025 bundle.xml [root@ora-rac1 37641958]# echo $GRID_HOME [root@ora-rac1 37641958]# ls -ltr $GRID_HOME/OPatch/opatchauto -rwxr-x--- 1 grid oinstall 1763 Dec 23 2024 /u01/app/19.0.0/grid/OPatch/opatchauto [root@ora-rac1 37641958]# pwd /home/grid/37641958 [root@ora-rac1 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze [root@ora-rac1 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze OPatchauto session is initiated at Tue Dec 30 11:31:01 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_11-31-22AM.log. Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2025-12-30_11-32-10AM.log The id for this session is 421F Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid Patch applicability verified successfully on home /u01/app/19.0.0/grid Executing patch validation checks on home /u01/app/19.0.0/grid Patch validation checks successfully completed on home /u01/app/19.0.0/grid OPatchAuto successful. --------------------------------Summary-------------------------------- Analysis for applying patches has completed successfully: Host:ora-rac1 CRS Home:/u01/app/19.0.0/grid Version:19.0.0.0.0 ==Following patches were SKIPPED: Patch: /home/grid/37641958/36758186 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Reason: /home/grid/37641958/36758186 is not required to be applied to oracle home /u01/app/19.0.0/grid ==Following patches were SUCCESSFULLY analyzed to be applied: Patch: /home/grid/37641958/37654975 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Patch: /home/grid/37641958/37643161 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Patch: /home/grid/37641958/37762426 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log Patch: /home/grid/37641958/37642901 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-33-42AM_1.log OPatchauto session completed at Tue Dec 30 11:40:06 2025 Time taken to complete the session 8 minutes, 46 seconds [root@ora-rac1 37641958]# [root@ora-rac1 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ OPatchauto session is initiated at Tue Dec 30 11:53:42 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_11-54-05AM.log. Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2025-12-30_11-54-42AM.log The id for this session is IZ5I Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid Patch applicability verified successfully on home /u01/app/19.0.0/grid Executing patch validation checks on home /u01/app/19.0.0/grid Patch validation checks successfully completed on home /u01/app/19.0.0/grid Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/19.0.0/grid Prepatch operation log file location: /u01/app/grid/crsdata/ora-rac1/crsconfig/crs_prepatch_apply_inplace_ora-rac1_2025-12-30_12-04-45AM.log CRS service brought down successfully on home /u01/app/19.0.0/grid Start applying binary patch on home /u01/app/19.0.0/grid Binary patch applied successfully on home /u01/app/19.0.0/grid Running rootadd_rdbms.sh on home /u01/app/19.0.0/grid Successfully executed rootadd_rdbms.sh on home /u01/app/19.0.0/grid Performing postpatch operations on CRS - starting CRS service on home /u01/app/19.0.0/grid Postpatch operation log file location: /u01/app/grid/crsdata/ora-rac1/crsconfig/crs_postpatch_apply_inplace_ora-rac1_2025-12-30_12-30-58AM.log CRS service started successfully on home /u01/app/19.0.0/grid OPatchAuto successful. --------------------------------Summary-------------------------------- Patching is completed successfully. Please find the summary as follows: Host:ora-rac1 CRS Home:/u01/app/19.0.0/grid Version:19.0.0.0.0 Summary: ==Following patches were SKIPPED: Patch: /home/grid/37641958/36758186 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_11-57-11AM_1.log Reason: /home/grid/37641958/36758186 is not required to be applied to oracle home /u01/app/19.0.0/grid ==Following patches were SUCCESSFULLY applied: Patch: /home/grid/37641958/37642901 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-08-20PM_1.log Patch: /home/grid/37641958/37643161 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-08-20PM_1.log Patch: /home/grid/37641958/37654975 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-08-20PM_1.log Patch: /home/grid/37641958/37762426 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-08-20PM_1.log OPatchauto session completed at Tue Dec 30 12:41:46 2025 Time taken to complete the session 47 minutes, 43 seconds export ORACLE_HOME=/u01/app/19.0.0/grid export GRID_HOME=/u01/app/19.0.0/grid export PATH=$ORACLE_HOME/OPatch:$PATH opatch lspatches [grid@ora-rac1 ~]$ [grid@ora-rac1 ~]$ opatch lspatches [grid@ora-rac1 ~]$ opatch lspatches 37762426;TOMCAT RELEASE UPDATE 19.0.0.0.0 (37762426) 37654975;OCW RELEASE UPDATE 19.27.0.0.0 (37654975) 37643161;ACFS RELEASE UPDATE 19.27.0.0.0 (37643161) 37642901;Database Release Update : 19.27.0.0.250415 (37642901) 36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186) ============================================================================================ as grid [grid@ora-rac1 ~]$ scp p37641958_190000_Linux-x86-64.zip ora-rac2:~ p37641958_190000_Linux-x86-64.zip [grid@ora-rac2 ~]$ df -Ph Filesystem Size Used Avail Use% Mounted on devtmpfs 3.8G 0 3.8G 0% /dev tmpfs 3.8G 1.1G 2.7G 30% /dev/shm tmpfs 3.8G 9.4M 3.8G 1% /run tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup /dev/sda2 19G 7.0G 12G 38% / /dev/mapper/centos-tmp 4.7G 80M 4.6G 2% /tmp /dev/mapper/centos-home 75G 3.9G 71G 6% /home /dev/mapper/centos-u01 43G 13G 31G 30% /u01 tmpfs 768M 12K 768M 1% /run/user/42 tmpfs 768M 0 768M 0% /run/user/54323 [grid@ora-rac2 ~]$ still old --- [grid@ora-rac2 ~]$ opatch lspatches 37461387;TOMCAT RELEASE UPDATE 19.0.0.0.0 (37461387) 37268031;OCW RELEASE UPDATE 19.26.0.0.0 (37268031) 37266638;ACFS RELEASE UPDATE 19.26.0.0.0 (37266638) 37260974;Database Release Update : 19.26.0.0.250121 (37260974) 36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186) OPatch succeeded. ************************************************************************************************************************************************ now on node 2 as grid [grid@ora-rac1 ~]$ scp p37641958_190000_Linux-x86-64.zip ora-rac2:~ p37641958_190000_Linux-x86-64.zip [root@ora-rac2 grid]# export ORACLE_HOME=/u01/app/19.0.0/grid [root@ora-rac2 grid]# export GRID_HOME=/u01/app/19.0.0/grid [root@ora-rac2 grid]# export PATH=$ORACLE_HOME/OPatch:$PATH [root@ora-rac2 grid]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze^C [root@ora-rac2 grid]# cd /home/grid/37641958/ [root@ora-rac2 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze OPatchauto session is initiated at Tue Dec 30 12:54:42 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_12-55-23PM.log. [root@ora-rac2 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze OPatchauto session is initiated at Tue Dec 30 12:54:42 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_12-55-23PM.log. Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2025-12-30_12-56-28PM.log The id for this session is MICW Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid Patch applicability verified successfully on home /u01/app/19.0.0/grid Executing patch validation checks on home /u01/app/19.0.0/grid Patch validation checks successfully completed on home /u01/app/19.0.0/grid OPatchAuto successful. --------------------------------Summary-------------------------------- Analysis for applying patches has completed successfully: Host:ora-rac2 CRS Home:/u01/app/19.0.0/grid Version:19.0.0.0.0 ==Following patches were SKIPPED: Patch: /home/grid/37641958/36758186 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Reason: /home/grid/37641958/36758186 is not required to be applied to oracle home /u01/app/19.0.0/grid ==Following patches were SUCCESSFULLY analyzed to be applied: Patch: /home/grid/37641958/37654975 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Patch: /home/grid/37641958/37643161 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Patch: /home/grid/37641958/37762426 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Patch: /home/grid/37641958/37642901 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log OPatchauto session completed at Tue Dec 30 13:04:09 2025 Time taken to complete the session 8 minutes, 49 seconds === [root@ora-rac2 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ OPatchauto session is initiated at Tue Dec 30 13:04:23 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_01-04-43PM.log. [grid@ora-rac1 ~]$ [grid@ora-rac1 ~]$ export ORACLE_HOME=/u01/app/19.0.0/grid [grid@ora-rac1 ~]$ export GRID_HOME=/u01/app/19.0.0/grid [grid@ora-rac1 ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH [grid@ora-rac1 ~]$ opatch lspatches 37762426;TOMCAT RELEASE UPDATE 19.0.0.0.0 (37762426) 37654975;OCW RELEASE UPDATE 19.27.0.0.0 (37654975) 37643161;ACFS RELEASE UPDATE 19.27.0.0.0 (37643161) 37642901;Database Release Update : 19.27.0.0.250415 (37642901) 36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186) OPatch succeeded. [grid@ora-rac1 ~]$ [grid@ora-rac1 ~]$ [grid@ora-rac1 ~]$ ssh ora-rac2 Last login: Tue Dec 30 12:45:53 2025 [grid@ora-rac2 ~]$ [grid@ora-rac2 ~]$ export ORACLE_HOME=/u01/app/19.0.0/grid [grid@ora-rac2 ~]$ export GRID_HOME=/u01/app/19.0.0/grid [grid@ora-rac2 ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH [grid@ora-rac2 ~]$ opatch lspatches 37461387;TOMCAT RELEASE UPDATE 19.0.0.0.0 (37461387) 37268031;OCW RELEASE UPDATE 19.26.0.0.0 (37268031) 37266638;ACFS RELEASE UPDATE 19.26.0.0.0 (37266638) 37260974;Database Release Update : 19.26.0.0.250121 (37260974) 36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186) OPatch succeeded. [grid@ora-rac2 ~]$ [grid@ora-rac2 ~]$ [grid@ora-rac2 ~]$ su Password: [root@ora-rac2 grid]# export ORACLE_HOME=/u01/app/19.0.0/grid [root@ora-rac2 grid]# export GRID_HOME=/u01/app/19.0.0/grid [root@ora-rac2 grid]# export PATH=$ORACLE_HOME/OPatch:$PATH [root@ora-rac2 grid]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze^C [root@ora-rac2 grid]# cd /home/grid/37641958/ [root@ora-rac2 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ -analyze OPatchauto session is initiated at Tue Dec 30 12:54:42 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_12-55-23PM.log. Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2025-12-30_12-56-28PM.log The id for this session is MICW Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid Patch applicability verified successfully on home /u01/app/19.0.0/grid Executing patch validation checks on home /u01/app/19.0.0/grid Patch validation checks successfully completed on home /u01/app/19.0.0/grid OPatchAuto successful. --------------------------------Summary-------------------------------- Analysis for applying patches has completed successfully: Host:ora-rac2 CRS Home:/u01/app/19.0.0/grid Version:19.0.0.0.0 ==Following patches were SKIPPED: Patch: /home/grid/37641958/36758186 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Reason: /home/grid/37641958/36758186 is not required to be applied to oracle home /u01/app/19.0.0/grid ==Following patches were SUCCESSFULLY analyzed to be applied: Patch: /home/grid/37641958/37654975 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Patch: /home/grid/37641958/37643161 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Patch: /home/grid/37641958/37762426 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log Patch: /home/grid/37641958/37642901 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_12-57-56PM_1.log OPatchauto session completed at Tue Dec 30 13:04:09 2025 Time taken to complete the session 8 minutes, 49 seconds [root@ora-rac2 37641958]# $GRID_HOME/OPatch/opatchauto apply /home/grid/37641958/ OPatchauto session is initiated at Tue Dec 30 13:04:23 2025 System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2025-12-30_01-04-43PM.log. Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2025-12-30_01-05-34PM.log The id for this session is 75RQ Executing OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid Patch applicability verified successfully on home /u01/app/19.0.0/grid Executing patch validation checks on home /u01/app/19.0.0/grid Patch validation checks successfully completed on home /u01/app/19.0.0/grid Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/19.0.0/grid Prepatch operation log file location: /u01/app/grid/crsdata/ora-rac2/crsconfig/crs_prepatch_apply_inplace_ora-rac2_2025-12-30_01-13-38PM.log CRS service brought down successfully on home /u01/app/19.0.0/grid Start applying binary patch on home /u01/app/19.0.0/grid Binary patch applied successfully on home /u01/app/19.0.0/grid Running rootadd_rdbms.sh on home /u01/app/19.0.0/grid Successfully executed rootadd_rdbms.sh on home /u01/app/19.0.0/grid Performing postpatch operations on CRS - starting CRS service on home /u01/app/19.0.0/grid Postpatch operation log file location: /u01/app/grid/crsdata/ora-rac2/crsconfig/crs_postpatch_apply_inplace_ora-rac2_2025-12-30_01-34-58PM.log CRS service started successfully on home /u01/app/19.0.0/grid OPatchAuto successful. --------------------------------Summary-------------------------------- Patching is completed successfully. Please find the summary as follows: Host:ora-rac2 CRS Home:/u01/app/19.0.0/grid Version:19.0.0.0.0 Summary: ==Following patches were SKIPPED: Patch: /home/grid/37641958/36758186 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_13-07-04PM_1.log Reason: /home/grid/37641958/36758186 is not required to be applied to oracle home /u01/app/19.0.0/grid ==Following patches were SUCCESSFULLY applied: Patch: /home/grid/37641958/37642901 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_13-17-02PM_1.log Patch: /home/grid/37641958/37643161 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_13-17-02PM_1.log Patch: /home/grid/37641958/37654975 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_13-17-02PM_1.log Patch: /home/grid/37641958/37762426 Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2025-12-30_13-17-02PM_1.log OPatchauto session completed at Tue Dec 30 13:45:03 2025 Time taken to complete the session 40 minutes, 22 seconds ========================================================== Last login: Tue Dec 30 14:48:40 2025 from 192.168.1.182 [oracle@ora-rac1 ~]$ su - grid Password: Last login: Tue Dec 30 14:51:18 GMT 2025 [grid@ora-rac1 ~]$ export ORACLE_HOME=/u01/app/19.0.0/grid [grid@ora-rac1 ~]$ export GRID_HOME=/u01/app/19.0.0/grid [grid@ora-rac1 ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH [grid@ora-rac1 ~]$ opatch lspatches 37762426;TOMCAT RELEASE UPDATE 19.0.0.0.0 (37762426) 37654975;OCW RELEASE UPDATE 19.27.0.0.0 (37654975) 37643161;ACFS RELEASE UPDATE 19.27.0.0.0 (37643161) 37642901;Database Release Update : 19.27.0.0.250415 (37642901) 36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186) OPatch succeeded. [grid@ora-rac1 ~]$ ssh ora-rac2 Last login: Tue Dec 30 14:41:45 2025 [grid@ora-rac2 ~]$ export ORACLE_HOME=/u01/app/19.0.0/grid [grid@ora-rac2 ~]$ export GRID_HOME=/u01/app/19.0.0/grid [grid@ora-rac2 ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH [grid@ora-rac2 ~]$ opatch lspatches 37762426;TOMCAT RELEASE UPDATE 19.0.0.0.0 (37762426) 37654975;OCW RELEASE UPDATE 19.27.0.0.0 (37654975) 37643161;ACFS RELEASE UPDATE 19.27.0.0.0 (37643161) 37642901;Database Release Update : 19.27.0.0.250415 (37642901) 36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186) OPatch succeeded. [grid@ora-rac2 ~]$ ====== As root: # cd Grid_home/crs/install # perl rootcrs.pl -unlock As the Oracle Grid Infrastructure for a Cluster owner: $ export ORACLE_HOME=Grid_home $ Grid_home/bin/relink As root again: # cd Grid_home/crs/install
Search This Blog
Total Pageviews
Wednesday, 31 December 2025
Oracle Grid patch 19.27
Sunday, 28 December 2025
Oracle Grid Infrastructure Upgrading Oracle Restart, 19c for Linux and Unix-Based Operating Systems
Oracle Grid Infrastructure Upgrading Oracle Restart, 19c for Linux and Unix-Based Operating Systems 1 Preparing to Upgrade Oracle Restart Before you upgrade Oracle Restart, determine the best upgrade path, and run the procedures that are described here to prepare for the upgrade. Oracle recommends that you test the upgrade process and prepare a backup strategy. • Options and Restrictions for Oracle Restart Upgrades Review these upgrade options and restrictions when you upgrade to Oracle Grid Infrastructure for a standalone server (Oracle Restart) 19c. • Checks to Complete Before Upgrading Oracle Restart Complete these preupgrade checks to avoid issues during the Oracle Restart upgrade process. • Installing the Oracle Database Preinstallation RPM Using ULN Use this procedure to subscribe to Unbreakable Linux Network (ULN) Oracle Linux channels for your Oracle software. • Creating a Copy of the Preinstallation Configuration File for the grid User Create a copy of the preinstallation configuration file for the grid user to set hard and soft limits for the operating system parameters. • Shutting Down the Database If your Oracle Database uses Oracle Automatic Storage Management (Oracle ASM) for storage, then shut down the database before upgrading Oracle Restart. • Upgrading Operating System for an Oracle Restart Server Complete this procedure on your Oracle Restart server to upgrade the operating system. Options and Restrictions for Oracle Restart Upgrades Review these upgrade options and restrictions when you upgrade to Oracle Grid Infrastructure for a standalone server (Oracle Restart) 19c. Supported upgrade paths for Oracle Restart for this release are: • Oracle Restart upgrade from 11g Release 2 (11.2.0.4) to Oracle Restart 19c. • Oracle Restart upgrade from 12c Release 1 (12.1.0.2) to Oracle Restart 19c. • Oracle Restart upgrade from 12c Release 2 (12.2) to Oracle Restart 19c. • Oracle Restart upgrade from 18c to Oracle Restart 19c. Restrictions for Oracle Restart Upgrades • Oracle Restart upgrades are always out-of-place upgrades. You cannot perform an inplace upgrade of Oracle Restart to an existing Grid home. • The same user that owned the earlier release of the Oracle Restart software must perform the Oracle Restart 19c upgrade. • Do not delete directories in the Grid home. For example, do not delete the directory Grid_home/OPatch. If you delete the directory, then the Oracle Restart installation owner 1-1 cannot use the OPatch utility to patch the Grid home, and OPatch displays the error message "'checkdir' error: cannot create Grid_home/OPatch". • The software in the 19c Oracle Restart home is not fully functional until the upgrade is complete. Running srvctl, crsctl, and other commands from the new Grid home are not supported until the rootupgrade.sh script is run and the upgrade is complete. • To manage databases in an existing earlier release database home during the Oracle Restart upgrade, use the srvctl utility from the existing database home. Checks to Complete Before Upgrading Oracle Restart Complete these preupgrade checks to avoid issues during the Oracle Restart upgrade process. 1. Review the new features for the Oracle Restart release to which you want to upgrade. 2. Ensure that you have all of the information you need for the upgrade. For example: • An Oracle base location for Oracle Restart. • An Oracle Restart home location that is different from your existing Oracle Restart home. • Privileged user operating system groups. • root user access, to run scripts as the root user during the upgrade. 3. Unset the $ORACLE_HOME, $ORACLE_BASE, and $ORACLE_SID environment variables because these environment variables are used during the upgrade. For example, as the grid user, run the following commands: For bash shell: $ unset ORACLE_HOME $ unset ORACLE_BASE $ unset ORACLE_SID For C shell: $ unsetenv ORACLE_HOME $ unsetenv ORACLE_BASE $ unsetenv ORACLE_SID 4. Ensure that the installation owner user profile, such as .profile or .cshrc, does not set any of these environment variables. 5. Unset any environment variables, such as ORA_NLS10 and TNS_ADMIN, set for the installation owner user that is connected with the Oracle software homes. 6. Ensure that the $ORACLE_HOME/bin path is removed from your PATH environment variable. Related Topics • Oracle Database New Features Guide Chapter 1 Checks to Complete Before Upgrading Oracle Restart 1-2 Installing the Oracle Database Preinstallation RPM Using ULN Use this procedure to subscribe to Unbreakable Linux Network (ULN) Oracle Linux channels for your Oracle software. To obtain Unbreakable Linux Network (ULN) support, subscribe to Oracle Linux channels, and to add the Oracle Linux channel that distributes the Oracle Database Preinstallation RPM: 1. Download the Oracle Linux ISO from one of the following websites: • Oracle yum https://yum.oracle.com/oracle-linux-isos.html • Oracle Software Delivery Cloud website: https://edelivery.oracle.com/linux Note: Ensure that you use the latest available update release for Oracle Linux. 2. Register your server with Unbreakable Linux Network (ULN). By default, you are registered for the Oracle Linux Latest channel for your operating system and hardware. • Oracle Linux 7 https://docs.oracle.com/en/operating-systems/oracle-linux/uln-user/ • Oracle Linux 8 and Oracle Linux 9 https://docs.oracle.com/en/operating-systems/oracle-linux/software-management/ 3. Log in to Unbreakable Linux Network: https://linux.oracle.com 4. Start a terminal session and enter the following command as root, depending on your platform. For example: • Oracle Linux 7 # yum install oracle-database-preinstall-19c Note: Use the -y option if you want yum to skip the package confirmation prompt. • Oracle Linux 8 and Oracle Linux 9 # dnf install oracle-database-preinstall-19c You should see output indicating that you have subscribed to the Oracle Linux channel, and that packages are being installed. Chapter 1 Installing the Oracle Database Preinstallation RPM Using ULN 1-3 The Oracle Database Preinstallation RPM automatically creates a standard (not roleallocated) Oracle installation owner and groups, and sets up other kernel configuration settings as required for Oracle installations. 5. Check the RPM log file to review the system configuration changes. For example: /var/log/oracle-database-preinstall-19c/backup/timestamp/orakernel.log 6. Repeat steps 1 through 4 on all other servers in your cluster. If you have a premier support subscription, you can enable Ksplice to provide zero downtime patching. Refer to the Ksplice User's Guide for installation instructions: https://docs.oracle.com/en/operating-systems/oracle-linux/ksplice-user/ Creating a Copy of the Preinstallation Configuration File for the grid User Create a copy of the preinstallation configuration file for the grid user to set hard and soft limits for the operating system parameters. 1. As the root user, go to the /etc/security/limits.d directory. # cd /etc/security/limits.d 2. Create a copy of the preinstallation configuration file for the grid user by replacing the oracle user with the grid user. # cat oracle-database-preinstall-19c.conf | sed 's/oracle /grid /g' > oracle-grid-user-preinstall-19c.conf 3. Delete the preinstallation configuration files for the earlier release. # rm -r -f oracle-database-preinstall-18c.conf oracle-grid-userpreinstall- 18c.conf Shutting Down the Database If your Oracle Database uses Oracle Automatic Storage Management (Oracle ASM) for storage, then shut down the database before upgrading Oracle Restart. 1. Log in as the oracle user. 2. Shut down the Oracle Database instance. $ Grid_home/bin/srvctl stop database –d database_unique_name 3. Ensure that your Oracle Database instance is shut down. $ Grid_home/bin/srvctl status database –d database_unique_name Database is not running. Chapter 1 Creating a Copy of the Preinstallation Configuration File for the grid User 1-4 Upgrading Operating System for an Oracle Restart Server Complete this procedure on your Oracle Restart server to upgrade the operating system. 1. As the root user, disable the automatic startup of Oracle High Availability Services, when the server reboots. # cd Grid_home/bin # ./crsctl disable has 2. Shut down the Oracle Restart stack on the server. # ./crsctl stop has 3. Verify all services are stopped before the operating system upgrade. # ./crsctl check has 4. Upgrade the operating system to a version that is supported for your Oracle Restart release. Refer to your operating system documentation for more information about upgrading the operating system. 5. Reboot your Oracle Restart server after the operating system upgrade is complete. 6. As the root user, add the Oracle Database libraries and lock the Oracle Restart installation. # cd Grid_home/rdbms/install/ # ./rootadd_rdbms.sh # cd Grid_home/crs/install # roothas.sh -lock 7. As the root user, enable the automatic startup of Oracle High Availability Services, when the server reboots. # cd Grid_home/bin # ./crsctl enable has 8. Start the Oracle Restart stack on the server. # ./crsctl start has 9. Connect to an SQL*Plus session and open the Pluggable Database (PDB). SQL> CONNECT / AS SYSDBA SQL> ALTER PLUGGABLE DATABASE pdb_name OPEN; 10. As the grid user, list all registered resources on your Oracle Restart server. $ Grid_home/bin/crsctl stat res -t Chapter 1 Upgrading Operating System for an Oracle Restart Server 1-5 2 Upgrading and Patching Oracle Restart Learn how to upgrade Oracle Restart to a later release using the out-of-place upgrade mode and install the patches. • Steps to Upgrade Oracle Restart Complete this procedure to upgrade Oracle Grid Infrastructure for a standalone server (Oracle Restart) from an earlier release. • Verifying the Oracle Restart Software Version After Upgrade Check the software release version of Oracle Restart after the upgrade. • Downloading Release Update Patches Download and install Release Updates (RU) and Monthly Recommended Patches (MRPs) patches for your Oracle software after you complete installation. • Patching Oracle Restart After you have upgraded to Oracle Grid Infrastructure for a standalone server (Oracle Restart) 19c, you can install individual software patches by downloading them from My Oracle Support. • Patching and Switching Oracle Grid Infrastructure Homes Perform an out-of-place Oracle Restart patching by switching from the current Oracle Grid Infrastructure home to a patched Oracle Grid Infrastructure home. • Unlocking and Deinstalling the Previous Release Grid Home After upgrading from previous releases, if you want to deinstall the previous release Grid home, then you must first change the permission and ownership of the previous release Grid home. Steps to Upgrade Oracle Restart Complete this procedure to upgrade Oracle Grid Infrastructure for a standalone server (Oracle Restart) from an earlier release. Be prepared to run root scripts before you start the upgrade. 1. As the grid user, download the Oracle Grid Infrastructure image files and extract the files to the Grid home. For example: mkdir -p /u01/app/grid/product/19.0.0/grid chown grid:oinstall /u01/app/grid/product/19.0.0/grid cd /u01/app/grid/product/19.0.0/grid unzip -q download_location/grid_home.zip download_location/grid_home.zip is the path of the downloaded Oracle Grid Infrastructure image file. 2-1 Note: • You must extract the image software into the directory where you want your new Grid home to be located. 2. Start the Oracle Grid Infrastructure wizard: $ /u01/app/grid/product/19.0.0/grid/gridSetup.sh 3. Select the Upgrade Oracle Grid Infrastructure option to upgrade Oracle Grid Infrastructure for a standalone server. 4. Select the installation options as prompted. 5. You can run root scripts, either automatically or manually. Oracle recommends that you configure root script automation, so that the rootupgrade.sh script can run automatically during the upgrade. At any time during the upgrade, if you have a question about what you are being asked to do, or what input you are required to provide during the upgrade, then click the Help button on the installer window. Verifying the Oracle Restart Software Version After Upgrade Check the software release version of Oracle Restart after the upgrade. 1. Log in as the grid user. 2. Verify that Oracle Restart 19c is in use after the upgrade. $ Grid_home/bin/crsctl query has releaseversion Oracle High Availability Services version on the local node is [19.0.0.0.0] Downloading Release Update Patches Download and install Release Updates (RU) and Monthly Recommended Patches (MRPs) patches for your Oracle software after you complete installation. Oracle provides quarterly updates in the form of Release Updates (RU) and Monthly Recommended Patches (MRPs). Oracle no longer releases patch sets. For more information, see My Oracle Support Note 2285040.1. Check the My Oracle Support website for required updates for your installation. 1. Use a web browser to view the My Oracle Support website: https://support.oracle.com 2. Log in to My Oracle Support website. Note: If you are not a My Oracle Support registered user, then click Register for My Oracle Support and register. Chapter 2 Verifying the Oracle Restart Software Version After Upgrade 2-2 3. On the main My Oracle Support page, click Patches & Updates. 4. In the Patch Search region, select Product or Family (Advanced). 5. On the Product or Family (Advanced) display, provide information about the product, release, and platform for which you want to obtain patches, and click Search. The Patch Search pane opens, displaying the results of your search. 6. Select the patch number and click ReadMe. The README page is displayed. It contains information about the patch and how to apply the patches to your installation. 7. Uncompress the Oracle patch updates that you downloaded from My Oracle Support. Related Topics • My Oracle Support note 888.1 • Patch Delivery Methods for Oracle Database Patching Oracle Restart After you have upgraded to Oracle Grid Infrastructure for a standalone server (Oracle Restart) 19c, you can install individual software patches by downloading them from My Oracle Support. 1. Download the patches that you want to apply from My Oracle Support: https://support.oracle.com Select the Patches and Updates tab to locate the patch. Oracle recommends that you select Recommended Patch Advisor, and enter the product group, release, and platform for your software. Place the patches in a shared directory that is accessible to all users. 2. Review the README file for the patch that you want to apply, and complete all of the required steps before installing the patch. 3. As the root user, go to the /OPatch directory in the Grid home. # cd /u01/app/grid/product/19.0.0/grid/OPatch 4. Install the version of the OPatch utility that is recommended in the README file for the patch. 5. Follow the instructions in the README file for the patch to apply the patch. # opatchauto apply patch_directory_location/patch_ID 6. As the grid user, verify the release patch number for your Oracle Restart. $ Grid_home/bin/crsctl query has releasepatch The release patch number changes only for Release Update (RU) and Release Update Revision (RUR) patches. Chapter 2 Patching Oracle Restart 2-3 Patching and Switching Oracle Grid Infrastructure Homes Perform an out-of-place Oracle Restart patching by switching from the current Oracle Grid Infrastructure home to a patched Oracle Grid Infrastructure home. 1. Download the 19.3 Oracle Grid Infrastructure base release image files. https://www.oracle.com/database/technologies/oracle-database-softwaredownloads. html#19c 2. As the grid user, extract the downloaded image files into a new Oracle Grid Infrastructure home directory. $ mkdir -p /u01/app/oracle/product/19.17.0/grid $ chown grid:oinstall /u01/app/oracle/product/19.17.0/grid $ cd /u01/app/oracle/product/19.17.0/grid $ unzip -q download_location/grid.zip Here: • /u01/app/oracle/product/19.17.0/grid is the new Grid home. • /u01/app/oracle/product/19.16.0/grid is the old Grid home. 3. As the grid user, download and install the latest version of the OPatch utility in the new Grid home. https://updates.oracle.com/download/6880880.html $ mv /u01/app/oracle/product/19.17.0/grid/OPatch /u01/app/oracle/product/ 19.17.0/grid/bak_OPatch $ unzip latest_Opatch.zip -d /u01/app/oracle/product/19.17.0/grid/ 4. Download the Oracle Database RU version that you want to apply from My Oracle Support. In this example, Oracle Database 19.17 RU. For more information, see, Downloading Release Update Patches 5. Start the Oracle Grid Infrastructure installer to perform a software-only Oracle Restart installation. You can apply the optional -applyRU or -applyOneOff flags to apply Release Updates (RUs) during the installation. $ /u01/app/oracle/product/19.17.0/grid/gridSetup.sh [-applyRU patch_directory_location] [-applyOneOffs comma_separated_list_of_patch_directory_locations] 6. Follow the steps in the configuration wizard to complete the Oracle Grid Infrastructure installation. 7. As the root user, run the following command to prepare the new home for the out-of-place patching: # /u01/app/oracle/product/19.17.0/grid/crs/install/roothas.sh -prepatch - dstcrshome /u01/app/oracle/product/19.17.0/grid This command does not shut down any services. Chapter 2 Patching and Switching Oracle Grid Infrastructure Homes 2-4 8. Run the following command to switch to the new Oracle Grid Infrastructure home and perform the out of place patching: # /u01/app/oracle/product/19.17.0/grid/crs/install/roothas.sh -postpatch - dstcrshome /u01/app/oracle/product/19.17.0/grid This command shuts down the old Oracle Grid Infrastructure home and starts resources from the new Oracle Grid Infrastructure home. All Oracle Grid Infrastructure services start running from the new Grid home. 9. Update the Oracle central inventory (oraInventory). $ /u01/app/oracle/product/19.17.0/grid/oui/bin/runInstaller - updateNodeList ORACLE_HOME=/u01/app/oracle/product/19.17.0/grid CRS=TRUE $ /u01/app/oracle/product/19.16.0/grid/oui/bin/runInstaller - updateNodeList ORACLE_HOME=/u01/app/oracle/product/19.16.0/grid CRS=FALSE 10. To switch back to the old Grid home: a. As the root user, run the prepatch script. # Old_GI_Home/crs/install/roothas.sh -prepatch -dstcrshome Old_GI_Home b. As the grid user, run the postpatch script. # Old_GI_Home/crs/install/roothas.sh -postpatch -dstcrshome Old_GI_Home c. Update the Oracle central inventory (oraInventory). $ /u01/app/oracle/product/19.16.0/grid/oui/bin/runInstaller - updateNodeList ORACLE_HOME=/u01/app/oracle/product/19.16.0/grid CRS=TRUE $ /u01/app/oracle/product/19.17.0/grid/oui/bin/runInstaller - updateNodeList ORACLE_HOME=/u01/app/oracle/product/19.17.0/grid CRS=FALSE Unlocking and Deinstalling the Previous Release Grid Home After upgrading from previous releases, if you want to deinstall the previous release Grid home, then you must first change the permission and ownership of the previous release Grid home. 1. As the root user, unlock the previous release Grid home. # /u01/app/oracle/product/18.0.0/grid/crs/install/roothas.sh -unlock - dstcrshome previous_release_Grid_home 2. After you change the permissions and ownership of the previous release Grid home, log in as the Oracle Grid Infrastructure installation owner (grid, in the preceding example), and use the deinstall command from the previous release Grid home $ORACLE_HOME/ deinstall directory. Chapter 2 Unlocking and Deinstalling the Previous Release Grid Home 2-5 Caution: You must use the deinstall command from the same release to remove Oracle software. Do not run the deinstall command from a later release to remove Oracle software from an earlier release. For example, do not run the deinstall command from the 19.0.0.0.0 Grid home to remove Oracle software from an existing 18.0.0.0.0 Grid home. Chapter 2 Unlocking and Deinstalling the Previous Release Grid Home 2-6 3 Downgrading Oracle Restart You can restore Oracle Grid Infrastructure for a standalone server (Oracle Restart) to the previous release after a successful or a failed upgrade. • Options and Restrictions for Oracle Restart Downgrades Review these downgrade options and restrictions when you downgrade Oracle Restart to an earlier release after a successful or a failed upgrade. • Downgrading Oracle Restart Use this procedure to deconfigure and downgrade Oracle Restart, or to troubleshoot Oracle Restart installation errors. Options and Restrictions for Oracle Restart Downgrades Review these downgrade options and restrictions when you downgrade Oracle Restart to an earlier release after a successful or a failed upgrade. Downgrade options include the following earlier releases: • Oracle Restart downgrade to Oracle Restart 18c. • Oracle Restart downgrade to Oracle Restart 12c Release 2 (12.2). • Oracle Restart downgrade to Oracle Restart 12c Release 1 (12.1.0.2). • Oracle Restart downgrade to Oracle Restart 11g Release 2 (11.2.0.4). Restrictions for Oracle Restart Downgrades • You can downgrade Oracle Restart to an earlier release only if you did not make any configuration changes after the upgrade. • You can only downgrade to the Oracle Restart release you upgraded from. For example, if you upgraded from Oracle Restart 18c to Oracle Restart 19c, then you can only downgrade to Oracle Restart 18c. Downgrading Oracle Restart Use this procedure to deconfigure and downgrade Oracle Restart, or to troubleshoot Oracle Restart installation errors. Running roothas.sh with the command flags -deconfig -force enables you to deconfigure Oracle Restart without removing the installed binaries. This feature is useful if you encounter an error during an Oracle Grid Infrastructure for a standalone server installation. For example, when you run the root.sh command, and find a missing operating system package. By running roothas.sh -deconfig -force, you can deconfigure Oracle Restart, correct the cause of the error, and then run root.sh again. 3-1 1. As the oracle user, create a backup of the SPFILE to a PFILE. CREATE PFILE='/u01/app/oracle/product/19.0.0/dbhome_1/dbs/test_init.ora' FROM SPFILE='/u01/oracle/dbs/test_spfile.ora'; 2. List all the Oracle Databases on the server with their version, unique name of the database, and Oracle home information. $ srvctl config database -home 3. Downgrade Oracle Database. Refer to Oracle Database Upgrade Guide for more information about required pre-downgrade tasks, downgrade tasks, post-downgrade tasks, and compatibility information. Note: Downgrade Oracle Database only if the Oracle Database version is higher than the Oracle Restart version to which you are downgrading Oracle Restart. 4. As the oracle user, downgrade the Oracle Restart resources corresponding to the Oracle Database, only if you have downgraded your Oracle Database. $ srvctl downgrade database -d db_unique_name -oraclehome $ORACLE_HOME -t to_version 5. Inspect the Oracle Restart configuration of each database, service, and listener. $ srvctl config database -db db_unique_name $ srvctl config service -db db_unique_name $ srvctl config listener -listener listener_name Make a note of the configuration information and use this information when adding the components back to Oracle Restart. 6. Stop all databases and listeners that are running before you deconfigure or downgrade Oracle Restart. $ srvctl stop database -db db_unique_name $ srvctl stop listener [-listener listener_name] 7. As the root user, run roothas.sh with the -deconfig -force flags to deconfigure Oracle Restart. # /u01/app/oracle/product/19.0.0/grid/crs/install/roothas.sh -deconfig - force 8. As the grid user, update the Oracle central inventory (oraInventory). $ /u01/app/oracle/product/19.0.0/grid/oui/bin/runInstaller -updateNodeList -silent ORACLE_HOME=upgraded_Grid_home -local CRS=false Chapter 3 Downgrading Oracle Restart 3-2 9. As the root user, run roothas.sh with the -unlock flag to unlock the previous release Oracle Restart home. # /u01/app/oracle/product/18.0.0/grid/crs/install/roothas.sh -unlock - dstcrshome previous_release_Grid_home 10. As the grid user, reconfigure the previous release Oracle Restart home using the gridSetup.sh command. $ /u01/app/oracle/product/18.0.0/grid/gridSetup.sh 11. As the oracle user, add the components back to Oracle Restart with the same attributes that you noted down before deconfiguring Oracle Restart. a. Add Oracle Database to the Oracle Restart configuration. $ srvctl add database -db db_unique_name -oraclehome Oracle_home b. Add the listener to the Oracle Restart configuration. $ srvctl add listener -listener listener_name -oraclehome Oracle_home For the -oraclehome parameter, provide the Oracle home path from which the listener was running before the downgrade. c. Add each service to the database, using the srvctl add service command. $ srvctl add service -db db_unique_name -service service_name_list Related Topics • Oracle Database Upgrade Guide Chapter 3 Downgrading Oracle Restart 3-3
Oracle grid upgrade from 19.3 to 21.3
mkdir -p /u01/app/21.0.0/grid
ls -ltr /u01/app/19.0.0/
pwd
ls -ltr /u01/app/21.0.0/grid
pwd
ls -ltr *.zip
unzip V1011504-01.zip -d /u01/app/21.0.0/grid/
pwd
ls -ltr /u01/app/21.0.0/grid/
pwd
cat /etc/oratab
ls -ltr /u01/app/21.0.0/grid/
cd /u01/app/21.0.0/grid/
[grid@oraasm grid]$ ./runcluvfy.sh stage -pre crsinst -upgrade -rolling -src_crshome /u01/app/19.0.0/grid -dest_crshome /u01/app/21.0.0/grid -dest_version 21.3.0.0.0 -fixup -verbose
[grid@oraasm grid]$ ./runcluvfy.sh stage -pre crsinst -upgrade -rolling -src_crshome /u01/app/19.0.0/grid -dest_crshome /u01/app/21.0.0/grid -dest_version 21.3.0.0.0 -fixup -verbose
This standalone version of CVU is "1634" days old. The latest release of standalone CVU can be obtained from the Oracle support site. Refer to MOS note 2731675.1 for more details.
Performing following verification checks ...
Physical Memory ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm 6.1113GB (6408208.0KB) 8GB (8388608.0KB) failed
Physical Memory ...FAILED (PRVF-7530)
Available Physical Memory ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm 5.0485GB (5293772.0KB) 50MB (51200.0KB) passed
Available Physical Memory ...PASSED
Swap Size ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm 5GB (5242876.0KB) 6.1113GB (6408208.0KB) failed
Swap Size ...FAILED (PRVF-7573)
Free Space: oraasm:/usr,oraasm:/var,oraasm:/etc,oraasm:/sbin,oraasm:/tmp ...
Path Node Name Mount point Available Required Status
---------------- ------------ ------------ ------------ ------------ ------------
/usr oraasm / 24.6545GB 25MB passed
/var oraasm / 24.6545GB 5MB passed
/etc oraasm / 24.6545GB 25MB passed
/sbin oraasm / 24.6545GB 10MB passed
/tmp oraasm / 24.6545GB 1GB passed
Free Space: oraasm:/usr,oraasm:/var,oraasm:/etc,oraasm:/sbin,oraasm:/tmp ...PASSED
User Existence: grid ...
Node Name Status Comment
------------ ------------------------ ------------------------
oraasm passed exists(54323)
Users With Same UID: 54323 ...PASSED
User Existence: grid ...PASSED
Group Existence: oinstall ...
Node Name Status Comment
------------ ------------------------ ------------------------
oraasm passed exists
Group Existence: oinstall ...PASSED
Group Membership: oinstall(Primary) ...
Node Name User Exists Group Exists User in Group Primary Status
---------------- ------------ ------------ ------------ ------------ ------------
oraasm yes yes yes yes passed
Group Membership: oinstall(Primary) ...PASSED
Run Level ...
Node Name run level Required Status
------------ ------------------------ ------------------------ ----------
oraasm 5 3,5 passed
Run Level ...PASSED
Upgrade suitability of source home "/u01/app/19.0.0/grid" to version "21.3.0.0.0". ...PASSED
Architecture ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm x86_64 x86_64 passed
Architecture ...PASSED
OS Kernel Version ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm 4.18.0-553.6.1.el8.x86_64 4.18.0 passed
OS Kernel Version ...PASSED
OS Kernel Parameter: semmsl ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 250 250 250 passed
OS Kernel Parameter: semmsl ...PASSED
OS Kernel Parameter: semmns ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 32000 32000 32000 passed
OS Kernel Parameter: semmns ...PASSED
OS Kernel Parameter: semopm ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 100 100 100 passed
OS Kernel Parameter: semopm ...PASSED
OS Kernel Parameter: semmni ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 128 128 128 passed
OS Kernel Parameter: semmni ...PASSED
OS Kernel Parameter: shmmax ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 4398046511104 4398046511104 3281002496 passed
OS Kernel Parameter: shmmax ...PASSED
OS Kernel Parameter: shmmni ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 4096 4096 4096 passed
OS Kernel Parameter: shmmni ...PASSED
OS Kernel Parameter: shmall ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 1073741824 1073741824 1073741824 passed
OS Kernel Parameter: shmall ...PASSED
OS Kernel Parameter: file-max ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 6815744 6815744 6815744 passed
OS Kernel Parameter: file-max ...PASSED
OS Kernel Parameter: ip_local_port_range ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm between 9000 & 65500 between 9000 & 65500 between 9000 & 65535 passed
OS Kernel Parameter: ip_local_port_range ...PASSED
OS Kernel Parameter: rmem_default ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 262144 262144 262144 passed
OS Kernel Parameter: rmem_default ...PASSED
OS Kernel Parameter: rmem_max ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 4194304 4194304 4194304 passed
OS Kernel Parameter: rmem_max ...PASSED
OS Kernel Parameter: wmem_default ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 262144 262144 262144 passed
OS Kernel Parameter: wmem_default ...PASSED
OS Kernel Parameter: wmem_max ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 1048576 1048576 1048576 passed
OS Kernel Parameter: wmem_max ...PASSED
OS Kernel Parameter: aio-max-nr ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 1048576 1048576 1048576 passed
OS Kernel Parameter: aio-max-nr ...PASSED
OS Kernel Parameter: panic_on_oops ...
Node Name Current Configured Required Status Comment
---------------- ------------ ------------ ------------ ------------ ------------
oraasm 1 1 1 passed
OS Kernel Parameter: panic_on_oops ...PASSED
Package: kmod-20-21 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm kmod(x86_64)-25-20.el8 kmod(x86_64)-20-21 passed
Package: kmod-20-21 (x86_64) ...PASSED
Package: kmod-libs-20-21 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm kmod-libs(x86_64)-25-20.el8 kmod-libs(x86_64)-20-21 passed
Package: kmod-libs-20-21 (x86_64) ...PASSED
Package: binutils-2.30-49.0.2 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm binutils-2.30-123.el8 binutils-2.30-49.0.2 passed
Package: binutils-2.30-49.0.2 ...PASSED
Package: libgcc-8.2.1 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm libgcc(x86_64)-8.5.0-22.el8 libgcc(x86_64)-8.2.1 passed
Package: libgcc-8.2.1 (x86_64) ...PASSED
Package: libstdc++-8.2.1 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm libstdc++(x86_64)-8.5.0-22.el8 libstdc++(x86_64)-8.2.1 passed
Package: libstdc++-8.2.1 (x86_64) ...PASSED
Package: sysstat-10.1.5 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm sysstat-11.7.3-12.el8 sysstat-10.1.5 passed
Package: sysstat-10.1.5 ...PASSED
Package: ksh ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm ksh ksh passed
Package: ksh ...PASSED
Package: make-4.2.1 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm make-4.2.1-11.el8 make-4.2.1 passed
Package: make-4.2.1 ...PASSED
Package: glibc-2.28 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm glibc(x86_64)-2.28-251.el8.2 glibc(x86_64)-2.28 passed
Package: glibc-2.28 (x86_64) ...PASSED
Package: glibc-devel-2.28 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm glibc-devel(x86_64)-2.28-251.el8.2 glibc-devel(x86_64)-2.28 passed
Package: glibc-devel-2.28 (x86_64) ...PASSED
Package: libaio-0.3.110 (x86_64) ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm libaio(x86_64)-0.3.112-1.el8 libaio(x86_64)-0.3.110 passed
Package: libaio-0.3.110 (x86_64) ...PASSED
Package: nfs-utils-2.3.3-14 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm nfs-utils-2.3.3-59.el8 nfs-utils-2.3.3-14 passed
Package: nfs-utils-2.3.3-14 ...PASSED
Package: smartmontools-6.6-3 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm smartmontools-7.1-3.el8 smartmontools-6.6-3 passed
Package: smartmontools-6.6-3 ...PASSED
Package: net-tools-2.0-0.51 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm net-tools-2.0-0.52.20160912git.el8 net-tools-2.0-0.51 passed
Package: net-tools-2.0-0.51 ...PASSED
Package: policycoreutils-2.9-3 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm policycoreutils-2.9-26.el8 policycoreutils-2.9-3 passed
Package: policycoreutils-2.9-3 ...PASSED
Package: policycoreutils-python-utils-2.9-3 ...
Node Name Available Required Status
------------ ------------------------ ------------------------ ----------
oraasm policycoreutils-python-utils-2.9-26.el8 policycoreutils-python-utils-2.9-3 passed
Package: policycoreutils-python-utils-2.9-3 ...PASSED
Users With Same UID: 0 ...PASSED
Current Group ID ...PASSED
Root user consistency ...
Node Name Status
------------------------------------ ------------------------
oraasm passed
Root user consistency ...PASSED
selectivity of ASM discovery string ...PASSED
ASM spare parameters ...PASSED
Disk group ASM compatibility setting ...FAILED
ASM client compatibility check ...PASSED
Oracle Restart Integrity ...PASSED
CRS user Consistency for upgrade ...PASSED
Check incorrectly sized ASM Disks ...PASSED
Domain Sockets ...PASSED
Path existence, ownership, permissions and attributes ...
Path "/var" ...PASSED
Path "/var/tmp/.oracle" ...FAILED (PRVH-0111, PRVH-0112, PRVH-0113, PRVH-0100)
Path "/dev/shm" ...PASSED
Path existence, ownership, permissions and attributes ...FAILED (PRVH-0111, PRVH-0112, PRVH-0113, PRVH-0100)
Pre-check for cluster services setup was unsuccessful.
Checks did not pass for the following nodes:
oraasm
Checks did not pass for the following ASM disk groups:
ASM
Failures were encountered during execution of CVU verification request "stage -pre crsinst".
Physical Memory ...FAILED
oraasm: PRVF-7530 : Sufficient physical memory is not available on node
"oraasm" [Required physical memory = 8GB (8388608.0KB)]
Swap Size ...FAILED
oraasm: PRVF-7573 : Sufficient swap size is not available on node "oraasm"
[Required = 6.1113GB (6408208.0KB) ; Found = 5GB (5242876.0KB)]
Disk group ASM compatibility setting ...FAILED
ASM: ASM compatibility for ASM disk group "{1}" is set to "{2}", which is less
than the minimum supported value "{3}".
Path existence, ownership, permissions and attributes ...FAILED
Path "/var/tmp/.oracle" ...FAILED
oraasm: PRVH-0111 : Path "/var/tmp/.oracle" with permissions "rwxrwx---" does
not have read permissions for others on node "oraasm".
oraasm: PRVH-0112 : Path "/var/tmp/.oracle" with permissions "rwxrwx---" does
not have write permissions for others on node "oraasm".
oraasm: PRVH-0113 : Path "/var/tmp/.oracle" with permissions "rwxrwx---" does
not have execute permissions for others on node "oraasm".
oraasm: PRVH-0100 : Restricted deletion flag is not set for path
"/var/tmp/.oracle" on node "oraasm".
CVU operation performed: stage -pre crsinst
Date: 27-Dec-2025 17:29:45
CVU home: /u01/app/21.0.0/grid
Grid home: /u01/app/19.0.0/grid
User: grid
Operating system: Linux4.18.0-553.6.1.el8.x86_64
[grid@oraasm grid]$
[grid@oraasm grid]$
#
ssh -X grid@192.168.1.222
grid@192.168.1.222's password:
Activate the web console with: systemctl enable --now cockpit.socket
Last login: Sat Dec 27 17:16:37 2025
[root@oraasm grid]# ./gridSetup.sh &
[1] 3603
[root@oraasm grid]#
ERROR: You must not be logged in as root to run this tool.
^C
[1]+ Exit 1 ./gridSetup.sh
[root@oraasm grid]# pwd
/u01/app/21.0.0/grid
[root@oraasm grid]# /u01/app/21.0.0/grid/rootupgrade.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/21.0.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/21.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/oraasm/crsconfig/roothas_2025-12-28_11-54-22AM.log
2025/12/28 11:54:23 CLSRSC-595: Executing upgrade step 1 of 12: 'UpgPrechecks'.
2025/12/28 11:54:25 CLSRSC-595: Executing upgrade step 2 of 12: 'GetOldConfig'.
2025/12/28 11:54:26 CLSRSC-595: Executing upgrade step 3 of 12: 'GenSiteGUIDs'.
2025/12/28 11:54:26 CLSRSC-595: Executing upgrade step 4 of 12: 'SetupOSD'.
Redirecting to /bin/systemctl restart rsyslog.service
2025/12/28 11:54:27 CLSRSC-595: Executing upgrade step 5 of 12: 'PreUpgrade'.
2025/12/28 11:54:53 CLSRSC-595: Executing upgrade step 6 of 12: 'UpgradeAFD'.
2025/12/28 11:54:53 CLSRSC-595: Executing upgrade step 7 of 12: 'UpgradeOLR'.
clscfg: EXISTING configuration version 0 detected.
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
2025/12/28 11:54:56 CLSRSC-595: Executing upgrade step 8 of 12: 'UpgradeOCR'.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node oraasm successfully pinned.
2025/12/28 11:54:58 CLSRSC-595: Executing upgrade step 9 of 12: 'CreateOHASD'.
2025/12/28 11:54:59 CLSRSC-595: Executing upgrade step 10 of 12: 'ConfigOHASD'.
2025/12/28 11:54:59 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
2025/12/28 11:55:12 CLSRSC-595: Executing upgrade step 11 of 12: 'UpgradeSIHA'.
oraasm 2025/12/28 11:55:59 /u01/app/grid/crsdata/oraasm/olr/backup_20251228_115559.olr 0
oraasm 2025/12/27 14:22:22 /u01/app/grid/crsdata/oraasm/olr/backup_20251227_142222.olr 724960844
2025/12/28 11:55:59 CLSRSC-595: Executing upgrade step 12 of 12: 'InstallACFS'.
2025/12/28 11:56:50 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
Sunday, 21 December 2025
Oracle secure listener
Oracle secure listener
https://anuj-singh.blogspot.com/2016/09/oracle-session-count-info-and-kill-and.html
$ srvctl add listener -listener SECURE_LISTENER -oraclehome /u01/app/19.3.0/grid -endpoints "TCPS:2488"
$ srvctl config listener -l SECURE_LISTENER
$ srvctl start listener -l SECURE_LISTENER
$ srvctl status listener -l SECURE_LISTENER
-Modify listener -
srvctl modify listener -l listener -endpoints TCP:1521/TCPS:2488
-Set below parameter in listener.ora
SSL_CLIENT_AUTHENTICATION=FALSE
-validate sqlnet.ora at DB HOME location
-update local listener
SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=tcp)(HOST=ORA)(PORT=1521))','(ADDRESS=(PROTOCOL=tcps)(HOST=ORA)(PORT=2488))';
System altered.
ps -ef|grep -i tns
root 572 2 0 Apr25 ? 00:00:00 [netns]
oracle 50290 1 0 03:32 ? 00:00:26 /u01/app/19.3.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle 86637 1 0 04:07 ? 00:00:17 /u01/app/oracle/product/19.0.0/db_1/bin/tnslsnr TCPS_LISTENER -inherit
ps -ef|grep -i tns
oracle 45866 1 0 Jun07 ? 1-16:12:34 /u01/app/19.3.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle 65750 1 0 04:09 ? 00:00:41 /u01/app/oracle/product/19.0.0/db_1/bin/tnslsnr TCPS_LISTENER -inherit
to test
sqlplus test/test123@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=ORA)(PORT=2488))(CONNECT_DATA=(SID=ora1)(SERVICE_NAME=XXXXX)))
srvctl config listener -l LISTENER
Name: LISTENER
Type: Database Listener
Home: /u01/app/19.3.0.0/grid
End points: TCP:1521
Listener is enabled.
srvctl config listener -l TCPS_LISTENER
Name: TCPS_LISTENER
Type: Database Listener
Home: /u01/app/oracle/product/19.0.0/db_1
End points: TCPS:2488
Listener is enabled.
srvctl stop listener -l LISTENER2
srvctl config listener -l LISTENER2
srvctl remove listener -l LISTENER2
srvctl config listener -l LISTENER2
srvctl status listener -l LISTENER2
locate listener.log
/u01/app/oracle/diag/tnslsnr/orcl/listener/trace/listener.log
/u01/app/oracle/diag/tnslsnr/orcl/tcps_listener/trace/tcps_listener.log
connection info !!!
---- Protocol for all Oracle connections.
col NETWORK_SERVICE_BANNER for a90
select
distinct NETWORK_SERVICE_BANNER
from
gv$session_connect_info
;
SELECT
sid,network_service_banner
FROM
v$session_connect_info
WHERE sid=(SELECT sid FROM v$mystat WHERE ROWNUM = 1)
AND NETWORK_SERVICE_BANNER like '%Encryption%';
alter session set nls_date_format='dd-mm-yyyy hh24:mi';
set linesize 400 pagesize 400
col kill for a17
col machine for a38
col event for a28
select ''''||s.sid ||','|| s.serial#||',@'||s.inst_id ||'''' kill,machine
,logon_time
--,program
,event
,sql_id
,prev_sql_id,
case when program not like 'ora___@% (P%)' then
(select max(case
when NETWORK_SERVICE_BANNER like '%TCP/IP%' then 'TCP'
when NETWORK_SERVICE_BANNER like '%Bequeath%' then 'BEQUEATH'
when NETWORK_SERVICE_BANNER like '%IPC%' then 'IPC'
when NETWORK_SERVICE_BANNER like '%SDP%' then 'SDP'
when NETWORK_SERVICE_BANNER like '%NAMED P%' then 'Named pipe'
when NETWORK_SERVICE_BANNER is null
then 'TCPS' end)
from gv$session_connect_info i
where 1=1
and i.sid=s.sid and i.inst_id = s.inst_id) end protocol
from
gv$session s
where 1=1
AND type != 'BACKGROUND'
-- and program not like '%ora%'
order by logon_time desc
;
Thursday, 4 December 2025
How to solve ORA-02291: integrity constraint violated - parent key not found
How to solve ORA-02291: integrity constraint violated - parent key not found .
=================================================================================
SQL> insert into emp values(7935,'XXX','XXXX',7782,'23-JAN-83',10000,null,50) ;
insert into emp values(7935,'XXX','XXXX',7782,'23-JAN-83',10000,null,50)
*
ERROR at line 1:
ORA-02291: integrity constraint (ANUJ1.FK_DEPTNO) violated - parent key not found
ALTER TABLE anuj1.dept DISABLE PRIMARY KEY;
ww
alter table anuj1.dept disable primary key cascade ;
inserted wrong row !!! in dept table
insert into emp values(7935,'XXX','XXXX',7782,'23-JAN-83',10000,null,50) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7900 JAMES CLERK 7698 03-DEC-81 950 30
7934 MILLER CLERK 7782 23-JAN-82 1300 10
7935 XXX XXXX 7782 23-JAN-83 10000 50 <<<<<
alter table anuj1.dept enable primary key cascade ;
SQL> alter table anuj1.dept enable primary key ; <<<< Primary Key enabled !!!
Table altered.
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7900 JAMES CLERK 7698 03-DEC-81 950 30
7934 MILLER CLERK 7782 23-JAN-82 1300 10
7935 XXX XXXX 7782 23-JAN-83 10000 50 <<<<<
set linesize 300
COLUMN owner FORMAT A25
COLUMN table_name FORMAT A25
COLUMN constraint_name FORMAT A25
COLUMN constraint_type FORMAT A25
COLUMN status FORMAT A25
COLUMN validated FORMAT A25
SELECT
owner,
table_name,
constraint_name,
constraint_type,
status,
validated
FROM
dba_constraints
WHERE 1=1
and status = 'DISABLED'
and owner='ANUJ1'
ORDER BY table_name, constraint_type;
OWNER TABLE_NAME CONSTRAINT_NAME CONSTRAINT_TYPE STATUS VALIDATED
------------------------- ------------------------- ------------------------- ------------------------- ------------------------- -------------------------
ANUJ1 BIN$RFG84ieDVBXgYyL1akC3x BIN$RFG84ieCVBXgYyL1akC3x P DISABLED NOT VALIDATED
A==$0 A==$0
ANUJ1 EMP FK_DEPTNO R DISABLED NOT VALIDATED
2 rows s
set linesize 300
COLUMN owner FORMAT A25
COLUMN table_name FORMAT A25
COLUMN constraint_name FORMAT A25
COLUMN constraint_type FORMAT A25
COLUMN status FORMAT A25
COLUMN validated FORMAT A25
SELECT
owner,
table_name,
constraint_name,
status,
validated
FROM
all_constraints
WHERE
status != 'ENABLED'
--AND validated = 'NOT VALIDATED'
and owner='ANUJ1'
ORDER BY owner, table_name;
set serveroutput on
define O='ANUJ1' -----<<<<<<<<<<<<
DECLARE
v_sql_stmt VARCHAR2(200);
BEGIN
DBMS_OUTPUT.PUT_LINE('-- Starting Constraint Enable Script --');
DBMS_OUTPUT.PUT_LINE('--');
FOR rec IN (
SELECT
owner,
table_name,
constraint_name
FROM
all_constraints -- Use ALL_CONSTRAINTS to cover all schemas you can see
WHERE
status = 'DISABLED'
-- Optional: Filter by specific schema if needed (e.g., AND owner = 'ANUJ1')
AND owner IN ('&O') -- Exclude system constraints
ORDER BY
owner, table_name, constraint_name
) LOOP
-- Generate the ENABLE statement, using VALIDATE (default) to check data integrity
v_sql_stmt := 'ALTER TABLE ' || rec.owner || '.' || rec.table_name || ' ENABLE CONSTRAINT ' || rec.constraint_name || ';';
-- Print the generated SQL statement
DBMS_OUTPUT.PUT_LINE(v_sql_stmt);
END LOOP;
DBMS_OUTPUT.PUT_LINE('--');
DBMS_OUTPUT.PUT_LINE('-- Constraint Enable Script Generated Successfully --');
END;
/
ALTER TABLE ANUJ1.EMP ENABLE CONSTRAINT FK_DEPTNO;
SQL> SQL> ALTER TABLE ANUJ1.EMP ENABLE CONSTRAINT FK_DEPTNO;
ALTER TABLE ANUJ1.EMP ENABLE CONSTRAINT FK_DEPTNO
*
ERROR at line 1:
ORA-02298: cannot validate (ANUJ1.FK_DEPTNO) - parent keys not found
COLUMN foreign_key_owner FORMAT A25
COLUMN foreign_key_name FORMAT A25
COLUMN child_table FORMAT A25
COLUMN foreign_key_columns FORMAT A25
COLUMN parent_owner FORMAT A25
COLUMN parent_table FORMAT A25
COLUMN parent_key_columns FORMAT A25
SELECT
c.owner AS foreign_key_owner,
c.constraint_name AS foreign_key_name,
cc.table_name AS child_table,
LISTAGG(cc.column_name, ', ') WITHIN GROUP (ORDER BY cc.position) AS foreign_key_columns,
r.owner AS parent_owner,
r.table_name AS parent_table,
LISTAGG(rc.column_name, ', ') WITHIN GROUP (ORDER BY rc.position) AS parent_key_columns
FROM all_constraints c
JOIN all_cons_columns cc ON c.owner = cc.owner AND c.constraint_name = cc.constraint_name
JOIN all_constraints r ON c.r_owner = r.owner AND c.r_constraint_name = r.constraint_name
JOIN all_cons_columns rc ON r.owner = rc.owner AND r.constraint_name = rc.constraint_name AND cc.position = rc.position
WHERE
c.owner = 'ANUJ1'
AND c.constraint_name = 'FK_DEPTNO'
AND c.constraint_type = 'R'
GROUP BY c.owner, c.constraint_name, cc.table_name, r.owner, r.table_name;
FOREIGN_KEY_OWNER FOREIGN_KEY_NAME CHILD_TABLE FOREIGN_KEY_COLUMNS PARENT_OWNER PARENT_TABLE PARENT_KEY_COLUMNS
------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- -------------------------
ANUJ1 FK_DEPTNO EMP DEPTNO ANUJ1 DEPT DEPTNO
SELECT DISTINCT e.DEPTNO AS offending_deptno
FROM ANUJ1.EMP e
WHERE
e.DEPTNO IS NOT NULL
MINUS ------<<<<<<
SELECT d.DEPTNO
FROM ANUJ1.DEPT d
;
DELETE FROM ANUJ1.EMP e
WHERE e.DEPTNO IS NOT NULL
AND e.DEPTNO IN (
SELECT e_bad.DEPTNO
FROM ANUJ1.EMP e_bad
MINUS
SELECT d.DEPTNO
FROM ANUJ1.DEPT d
);
1 row deleted.
SQL> ALTER TABLE ANUJ1.EMP ENABLE CONSTRAINT FK_DEPTNO;
Table altered.
COLUMN foreign_key_owner FORMAT A25
COLUMN foreign_key_name FORMAT A25
COLUMN child_table FORMAT A25
COLUMN foreign_key_columns FORMAT A25
COLUMN parent_owner FORMAT A25
COLUMN parent_table FORMAT A25
COLUMN parent_key_columns FORMAT A25
COLUMN status FORMAT A10
COLUMN validated FORMAT A15
SELECT
c.owner AS foreign_key_owner,
c.constraint_name AS foreign_key_name,
cc.table_name AS child_table,
LISTAGG(cc.column_name, ', ') WITHIN GROUP (ORDER BY cc.position) AS foreign_key_columns,
r.owner AS parent_owner,
r.table_name AS parent_table,
LISTAGG(rc.column_name, ', ') WITHIN GROUP (ORDER BY rc.position) AS parent_key_columns,
c.status AS status,
c.validated AS validated
FROM all_constraints c
JOIN all_cons_columns cc ON c.owner = cc.owner AND c.constraint_name = cc.constraint_name
JOIN all_constraints r ON c.r_owner = r.owner AND c.r_constraint_name = r.constraint_name
JOIN all_cons_columns rc ON r.owner = rc.owner AND r.constraint_name = rc.constraint_name AND cc.position = rc.position
WHERE 1=1
and c.owner = 'ANUJ1'
-- AND c.constraint_name = 'FK_DEPTNO'
-- AND c.constraint_type = 'R'
GROUP BY c.owner, c.constraint_name, cc.table_name, r.owner, r.table_name, c.status, c.validated;
FOREIGN_KEY_OWNER FOREIGN_KEY_NAME CHILD_TABLE FOREIGN_KEY_COLUMNS PARENT_OWNER PARENT_TABLE PARENT_KEY_COLUMNS STATUS VALIDATED
------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ---------- ---------------
ANUJ1 FK_DEPTNO EMP DEPTNO ANUJ1 DEPT DEPTNO ENABLED VALIDATED
ANUJ1 FK_INVITDEL T_INVOICE_ITEM_DELIVERY INVOICE_ID, PRODUCT_ID ANUJ1 T_INVOICE_ITEM INVOICE_ID, PRODUCT_ID ENABLED VALIDATED
ANUJ1 FK_PROD_PROD T_PRODUCT PRODUCT_EQUIVALENT ANUJ1 T_PRODUCT PRODUCT_ID ENABLED VALIDATED
ANUJ1 FK_PROD_PROV T_PRODUCT PROVIDER_ID ANUJ1 T_PROVIDER PROVIDER_ID ENABLED VALIDATED
ANUJ1 FK_INVITEM_INVOICE T_INVOICE_ITEM INVOICE_ID ANUJ1 T_INVOICE INVOICE_ID ENABLED VALIDATED
ANUJ1 FK_INVITEM_PRODUCT T_INVOICE_ITEM PRODUCT_ID ANUJ1 T_PRODUCT PRODUCT_ID ENABLED VALIDATED
ANUJ1 FK_PRODWARE_PRODUCT T_PRODUCT_WAREHOUSE PRODUCT_ID ANUJ1 T_PRODUCT PRODUCT_ID ENABLED VALIDATED
ANUJ1 FK_PRODWARE_WAREHOUSE T_PRODUCT_WAREHOUSE WAREHOUSE_ID ANUJ1 T_WAREHOUSE WAREHOUSE_ID ENABLED VALIDATED
8 rows selected.
SET SERVEROUTPUT ON SIZE UNLIMITED;
DECLARE
v_sql_stmt VARCHAR2(500);
v_target_owner CONSTANT VARCHAR2(128) := 'ANUJ1' -- or keep NULL to target all
BEGIN
DBMS_OUTPUT.PUT_LINE('-- START: Dynamic Primary Key DISABLE Script (DBA_CONSTRAINTS) --');
DBMS_OUTPUT.PUT_LINE('--');
FOR rec IN (
SELECT
owner,
table_name
FROM
dba_constraints
WHERE
constraint_type = 'P' -- 'P' for Primary Key
AND status = 'ENABLED'
-- Filter out system schemas
AND owner NOT IN ('SYS', 'SYSTEM', 'OUTLN', 'DBSNMP', 'CTXSYS')
-- Optional: Filter by specific owner if V_TARGET_OWNER is set
AND (v_target_owner IS NULL OR owner = v_target_owner)
ORDER BY owner, table_name
) LOOP
-- Generate the DISABLE command with CASCADE to handle foreign key dependencies
v_sql_stmt := 'ALTER TABLE ' || rec.owner || '.' || rec.table_name || ' DISABLE PRIMARY KEY CASCADE;';
-- Print the generated SQL statement
DBMS_OUTPUT.PUT_LINE(v_sql_stmt);
END LOOP;
DBMS_OUTPUT.PUT_LINE('--');
DBMS_OUTPUT.PUT_LINE('-- END: Primary Key DISABLE Script Generated. Copy and execute above statements. --');
END;
/
===
SET SERVEROUTPUT ON SIZE UNLIMITED;
DECLARE
v_sql_stmt VARCHAR2(500);
-- Define the schema owner you want to target, or NULL for all non-system schemas
v_target_owner CONSTANT VARCHAR2(128) := 'ANUJ1' -- or keep NULL to target all
BEGIN
DBMS_OUTPUT.PUT_LINE('-- START: Dynamic Primary Key ENABLE Script (DBA_CONSTRAINTS) --');
DBMS_OUTPUT.PUT_LINE('--');
FOR rec IN (
SELECT
owner,
table_name
FROM
dba_constraints
WHERE
constraint_type = 'P' -- 'P' for Primary Key
AND status = 'DISABLED'
-- Filter out system schemas
AND owner NOT IN ('SYS', 'SYSTEM', 'OUTLN', 'DBSNMP', 'CTXSYS')
-- Optional: Filter by specific owner if V_TARGET_OWNER is set
AND (v_target_owner IS NULL OR owner = v_target_owner)
ORDER BY
owner, table_name
) LOOP
-- Generate the ENABLE command (default is ENABLE VALIDATE)
v_sql_stmt := 'ALTER TABLE ' || rec.owner || '.' || rec.table_name || ' ENABLE PRIMARY KEY;';
-- Print the generated SQL statement
DBMS_OUTPUT.PUT_LINE(v_sql_stmt);
END LOOP;
DBMS_OUTPUT.PUT_LINE('--');
DBMS_OUTPUT.PUT_LINE('-- END: Primary Key ENABLE Script Generated. Copy and execute above statements. --');
END;
/
Wednesday, 26 November 2025
unix command for DBA
Basic File Navigation
The "pwd" command displays the current directory.
root> pwd
/u01/app/oracle/product/9.2.0.1.0
The "ls" command lists all files and directories in the specified directory. If no location is defined
it acts on the current directory.
root> ls
root> ls /u01
root> ls -al
The "-a" flag lists hidden "." files. The "-l" flag lists file details.
The "cd" command is used to change directories.
root> cd /u01/app/oracle
The "touch" command is used to create a new empty file with the default permissions.
root> touch my.log
The "rm" command is used to delete files and directories.
root> rm my.log
root> rm -R /archive
The "-R" flag tells the command to recurse through subdirectories.
The "mv" command is used to move or rename files and directories.
root> mv [from] [to]
root> mv my.log my1.log
root> mv * /archive
root> mv /archive/* .
The "." represents the current directory.
The "cp" command is used to copy files and directories.
root> cp [from] [to]
root> cp my.log my1.log
root> cp * /archive
root> cp /archive/* .
The "mkdir" command is used to create new directories.
root> mkdir archive
The "rmdir" command is used to delete directories.
root> rmdir archive
The "find" command can be used to find the location of specific files.
root> find / -name dbmspool.sql
root> find / -print | grep -i dbmspool.sql
The "/" flag represents the staring directory for the search. Wildcards such as "dbms*" can be
used for the filename.
The "which" command can be used to find the location of an executable you are using.
oracle> which sqlplus
The "which" command searches your PATH setting for occurrences of the specified executable.
File Permissions
See Linux Files, Directories and Permissions.
The "umask" command can be used to read or set default file permissions for the current user.
root> umask 022
The umask value is subtracted from the default permissions (666) to give the final permission.
666 : Default permission
022 : - umask value
644 : final permission
The "chmod" command is used to alter file permissions after the file has been created.
root> chmod 777 *.log
Owner Group World Permission
========= ========= ========= ======================
7 (u+rwx) 7 (g+rwx) 7 (o+rwx) read + write + execute
6 (u+rw) 6 (g+rw) 6 (o+rw) read + write
5 (u+rx) 5 (g+rx) 5 (o+rx) read + execute
4 (u+r) 4 (g+r) 4 (o+r) read only
2 (u+w) 2 (g+w) 2 (o+w) write only
1 (u+x) 1 (g+x) 1 (o+x) execute only
Character eqivalents can be used in the chmod command.
root> chmod o+rwx *.log
root> chmod g+r *.log
root> chmod -Rx *.log
The "chown" command is used to reset the ownership of files after creation.
root> chown -R oinstall.dba *
The "-R" flag causes the command ro recurse through any subdirectories.
OS Users Management
See Linux Groups and Users.
The "useradd" command is used to add OS users.
root> useradd -G oinstall -g dba -d /usr/users/my_user -m -s
/bin/ksh my_user
• The "-G" flag specifies the primary group.
• The "-g" flag specifies the secondary group.
• The "-d" flag specifies the default directory.
• The "-m" flag creates the default directory.
• The "-s" flag specifies the default shell.
The "usermod" command is used to modify the user settings after a user has been created.
root> usermod -s /bin/csh my_user
The "userdel" command is used to delete existing users.
root> userdel -r my_user
The "-r" flag removes the default directory.
The "passwd" command is used to set, or reset, the users login password.
root> passwd my_user
The "who" command can be used to list all users who have OS connections.
root> who
root> who | head -5
root> who | tail -5
root> who | grep -i ora
root> who | wc -l
• The "head -5" command restricts the output to the first 5 lines of the who command.
• The "tail -5" command restricts the output to the last 5 lines of the who command.
• The "grep -i ora" command restricts the output to lines containing "ora".
• The "wc -l" command returns the number of lines from "who", and hence the number of
connected users.
Process Management
See Linux Process Management (ps, top, renice, kill).
The "ps" command lists current process information.
# ps
# ps -ef | grep -i ora
# ps -ef | grep -i ora | grep -v grep # ps -ef | grep -i [o]ra
Specific processes can be killed by specifying the process id in the kill command.
# kill 12345
# kill -9 12345
You can kill multiple processes using a single command by combining "kill" with the "ps" and
"awk" commands.
# kill -9 `ps -ef | grep ora | awk '{print $2}'`
uname and hostname
The "uname" and "hostname" commands can be used to get information about the host.
root> uname -a
OSF1 oradb01.lynx.co.uk V5.1 2650 alpha
root> uname -a | awk '{ print $2 }' oradb01.lynx.co.uk
root> hostname oradb01.lynx.co.uk
Error Lines in Files
You can return the error lines in a file using.
root> cat alert_LIN1.log | grep -i ORA-
The "grep -i ORA-" command limits the output to lines containing "ORA-". The "-i" flag makes
the comparison case insensitive. A count of the error lines can be returned using the "wc"
command. This normally give a word count, but the "-l" flag alteres it to give a line count.
root> cat alert_LIN1.log | grep -i ORA- | wc -l
Remove Old Files
The find command can be used to supply a list of files to the rm command or the "-delete"
command can be used directly.
find /backup/logs/ -name daily_backup* -mtime +21 -exec rm -f {}
;
find /backup/logs/daily_backup* -mtime +5 -exec rm -f {} \;
find /backup/logs/daily_backup* -mtime +5 -delete;
File Exists Check
The Bash shell allows you to check for the presence of a file using the "[ -e filepath ]"
comparison. In the following script a backup log is renamed if it is present and files older than 30
days are deleted are deleted.
#!/bin/bash
if [ -e /tmp/backup.log ]; then
DATE_SUFFIX=`date +"%Y"-"%m"-"%d"` mv /tmp/backup.log
/tmp/backup-$DATE_SUFFIX.log fi
# Delete old log files. find /tmp/backup*.log -mtime +30 -
delete;
This is one example of a log rotation, where the most current log doesn't include the date in it's
name.
Rotate Log Files
See the previous section for another variant on log rotation.
The following script provides an example of how to manage a log rotation using the Bash shell.
The log file includes the date in the file name. Files older than 30 days are deleted.
#!/bin/bash
DATE_SUFFIX=`date +"%Y"-"%m"-"%d"`
LOG_FILE=/tmp/backup-$DATE_SUFFIX.log
# Do something that needs logging.
echo "Send this to log" >> $LOG_FILE 2>&1
# Delete old log files. find /tmp/backup*.log -mtime +30 -
delete; Find Big Files
Find Big Files
Find the top 20 biggest files recursively from this directory.
$ find . -type f -print0 | xargs -0 du -h | sort -hr | head -20
Perform Action for Every File in a Directory
The following scripts shows two methods for performing an action for each file in a directory.
#!/bin/bash
for FILE in `ls /tmp/`;
do echo $FILE; done
# Do something with the file name.
# Or this.
for FILE in $( ls /tmp/ );
do echo $FILE; done
Perform Action for Every Line in a File
The following scripts shows a method for performing an action for each line in a file.
#!/bin/bash
while read LINE; do
# Do something with the line.
echo $LINE; done < /tmp/myfile.txt
alias
An alias is a named shortcut for a longer command using the following format.
alias name='command'
For example, if you require sudo access for a specific command, you might want to include this
as an alias so you don't have to remember to type it.
alias myscript='sudo -u oracle /path/to/myscript'
Remove DOS CR/LFs (^M)
Remove DOS style CR/LF characters (^M) from UNIX files using.
sed -e 's/^M$//' filename > tempfile
The newly created tempfile should have the ^M character removed.
Where available, it is probably better to use the dos2unix and unix2dos commands.
Run Commands As Oracle User From Root
The following scripts shows how a number of commands can be run as the "oracle" user the
"root" user.
#!/bin/ksh
su - oracle < filename"
option to list the contents and pipe this to a file. Once you've editied the file you can then apply it
using the "crontab filename".
Login as root
crontab -l > newcron
Edit newcron file.
crontab newcron
Alternatively you can use the "crontab -e" option to edit the crontab file directly.
The entries have the following elements.
field allowed values ----- --------------
minute 0-59 hour 0-23 day of month 1-31
month 1-12
day of week 0-7 (both 0 and 7 are Sunday) user
Valid OS user command Valid command or script.
The first 5 fields can be specified using the following rules.
* - All available values or "first-last".
3-4 - A single range representing each possible from the
start to the end of the range inclusive.
1,2,5,6 - A specific list of values.
1-3,5-8 - A specific list of ranges.
0-23/2 - Every other value in the specified range.
The following entry runs a cleanup script a 01:00 each Sunday. Any output or errors from the
script are piped to /dev/null to prevent a buildup of mails to root.
0 1 * * 0 /u01/app/oracle/dba/weekly_cleanup > /dev/null 2>&1
To prevent a new job starting if the last run is still running, consider using flock. The job will
only run if a lock can be obtained on the specified lockfile.
From:
0 1 * * 0 /u01/app/oracle/dba/weekly_cleanup > /dev/null 2>&1
To:
0 1 * * 0 /usr/bin/flock -n /tmp/weekly_cleanup.lockfile
/u01/app/oracle/dba/weekly_cleanup > /dev/null 2>&1
Cluster Wide CRON Jobs On Tru64
On clustered systems cron is node-specific. If you need a job to fire once per cluster, rather than
once per node you need an alternative approach to the standard cron job. One approach is put
forward in the HP best practices document (Using cron in a TruCluster Server Cluster), but in my
opinion a more elegant solution is proposed by Jason Orendorf of HP Tru64 Unix Enterprise
Team (TruCluster Clustercron).
In his solution Jason creates a file called /bin/cronrun with the following contents.
#!/bin/ksh
set -- $(/usr/sbin/cfsmgr -F raw /) shift 12
[[ "$1" = "$(/bin/hostname -s)" ]] && exit 0 exit 1
This script returns TRUE (0) only on the node which is the CFS serving cluster_root.
All cluster wide jobs should have a crontab entry on each node of the cluster like.
5 * * * /bin/cronrun && /usr/local/bin/myjob
Although the cron jobs fire on all nodes, the "/bin/cronrun &&" part of the entry prevents the
script from running on all nodes except the current CFS serving cluster_root.
NFS Mount (Sun)
The following deamons must be running for the share to be seen by a PC.
/usr/lib/nfs/nfsd -a
/usr/lib/nfs/mountd
/opt/SUNWpcnfs/sbin/rpc.pcnfsd
To see a list of the nfs mounted drives already present type.
exportfs
First the mount point must be shared so it can be seen by remote machines.
share -F nfs -o ro /cdrom
Next the share can be mounted on a remote machine by root using.
mkdir /cdrom#1 mount -o ro myhost:/cdrom /cdrom#1
NFS Mount (Tru64)
On the server machine, if NFS is not currently setup do the following.
• Application Manager -> System Admin -> Configuration -> NFS
Select the "Configure system as an NFS server" option.
Accept all defaults.
Create mount point directory.
mkdir /u04/backup
Append the following entry to the "/etc/exports" file.
/u04/backup
Make sure the correct permissions are granted on the directory.
chmod -R 777 /u04/backup
On the client machine, if NFS is not currently setup do the following.
Application Manager -> System Admin -> Configuration -> NFS
Select the "Configure system as an NFS client" option.
Accept all defaults.
Create mount point directory.
mkdir /backup
Append an following entry to the "/etc/fstab" file.
nfs-server-name:/u04/backup /backup nfs rw,bg,intr 0
0
Finally, mount the fileset.
mount /backup
At this point you can start to use the mount point from your client machine. Thanks to Bryan
Mills for his help with Tru64.
Samba/CIFS Mount (Linux)
See Linux Samba Configuration.
Create a directory to use for the mount point.
# mkdir /host
Add the following line to the "/etc/fstab" file.
//192.168.0.4/public /host cifs
rw,credentials=/root/.smbcred,uid=500,guid=500 0 0
Create a file called "/root/.smbcred" with the following contents.
username=myuser password=mypassword
Change the permissions on the credentials file.
# chmod 600 /root/.smbcred
Mount the share.
# mount /host
PC XStation Configuration
Download the CygWin setup.exe from http://www.cygwin.com.
Install, making sure to select all the X11R6 (or XFree86 in older versions) optional packages.
If you need root access add the following entry into the /etc/securettys file on each server.
<:0
From the command promot on the PC do the following.
set PATH=PATH;c:cygwinbin;c:cygwinusrX11R6bin XWin.exe :0 -query
The X environment should start in a new window.
Many Linux distributions do not start XDMCP by default. To allow XDMCP access from
Cygwin edit the "/etc/X11/gdm/gdm.conf" file. Under the "[xdmcp]" section set "Enable=true".
If you are starting any X applications during the session you will need to set the DISPLAY
environment variable. Remember, you are acting as an XStation, not the server itself, so this
variable must be set as follows.
DISPLAY=:0.0; export DISPLAY
xauth (Magic Cookie)
Access to X servers can get broken when using su and sudo commands. The xauth command
provides a solution to this. The process involves the following stages:
• Check your current display number.
• Use xauth list to get a list of magic cookies. Switch to the new user.
• Use xauth add to set the magic cookie for your display number.
An example of this is shown below.
$ echo $DISPLAY localhost:12.0 $ xauth list
ol6.localdomain/unix:12 MIT-MAGIC-COOKIE-1
be64852468ca3c334720b10bb3c4d3cb
$ sudo su oracle
$ xauth add ol6.localdomain/unix:12 MIT-MAGIC-COOKIE-1
be64852468ca3c334720b10bb3c4d3cb
You will now be able to access the X server, just as you could before the user switch.
Useful Profile Settings
See Linux Groups and Users : Important Files.
The following ".profile" settings rely on the default shell for the user being set to the Korn shell
(/bin/ksh).
The backspace key can be configured by adding the following entry.
stty erase "^H"
The command line history can be accessed using the [Esc][k] by adding the following entry.
set -o vi
Auto completion of paths using a double strike of the [Esc] key can be configured by adding the
following entry.
set filec
Summary:
Navigation and File Management:
cd: Change directory. Example: cd /home/oracle/data
ls: List directory contents. Example: ls -l (long listing
format)
pwd: Print working directory. Example: pwd
mkdir: Create a new directory. Example: mkdir backup_dir
cp: Copy files and directories. Example: cp database.sql
backup_dir
mv: Move or rename files and directories. Example: mv
archive.log /archive_logs
rm: Remove files and directories. Example: rm -rf temp_files
(use with caution!)
Viewing and Editing Files:
cat: Display file contents. Example: cat table_schema.sql
more: View files page-by-page. Example: more log_file.txt
less: View files with more navigation options. Example: less
error_report
head: View the first few lines of a file. Example: head -n 10
config.ini
tail: View the last few lines of a file. Example: tail -f
transaction_log (follow updates)
nano: Simple text editor. Example: nano script.sh
vi: Powerful text editor (steeper learning curve). Example: vi
config.xml
Text Manipulation:
grep: Search for patterns in files. Example: grep "ERROR"
log_file.txt
awk: Extract specific data from files. Example: awk '{print $4}'
employee_data.csv
sed: Modify text in files. Example: sed
's/old_value/new_value/g' config.txt
Running Commands and Processes:
ps: List running processes. Example: ps aux | grep oracle
top: Monitor system resource usage. Example: top
kill: Terminate processes. Example: kill -9 12345 (process ID)
bg: Move a process to the background. Example: bg %1
fg: Bring a process to the foreground. Example: fg %2
DBA-Specific Commands:
sqlplus: Connect to an Oracle database. Example: sqlplus / as
sysdba
rman: Oracle Recovery Manager for backup and recovery. Example:
rman target /
lsnrctl: Manage Oracle listener processes. Example: lsnrctl
start
ps -ef | grep postgres: Check for running PostgreSQL processes.
mysql: Connect to a MySQL database. Example: mysql -u root -p
Useful Files
Here are some files that may be of use.
Path Contents
/etc/passwd User settings
/etc/shadow Where encrypted user passwords are stored
/etc/group Group settings for users.
/etc/hosts Hostname lookup information.
/etc/system
Kernel parameters for Solaris.
/etc/sysconfigtab Kernel parameters for Tru64.
/etc/sysctl.conf Kernel parameters for Linux.
Subscribe to:
Comments (Atom)
Oracle DBA
anuj blog Archive
- ► 2011 (362)





