ORACLE GRID AND DATABASE PATCHING
Dependency:
1)
sudo su – root permission is required
2) Sometime Server reboot required during clusterware/Grid patching therefore UNIX/AIX
team support is required
3) Minimum 40 GB free space is required on GRID AND ORACLE HOME
Patch Information And Enviroment Details
Current Environment
-----------------------
Primary Database with 4 Node RAC
Standby database with 4 Node RAC
Current Grid And DB Patch Version = 19.17.0.0.221018
Note: Grid and DB Patch will be performed on Standby database (DR side) first. it requires approx. 12 hours maintenance window on 4 node RAC no downtime required. Once Patch is completed on Standby database, DB Team will switchover and perform patching Grid and DB on Current standby Database.
We are going to apply July 2023
patch on 4 node environments.
Patch Information
Patch 35319490 - GI Release Update
19.20.0.0.230718
To apply patch Patch 35319490 - GI Release Update
19.20.0.0.230718
on Grid Home and Oracle Home , Grid Home And
Oracle Home must have Oracle Database release 19c installed.
Patch will apply in two phase in Rolling
Fashion(one by one) on Standby Database
· On
Grid Home
· On
Database Home And database
Pre-requisites
1) Check clusterware and database component status.
2)
Check opatch version
and recommended to have latest opatch and download it from oracle support
(6880880) and unzip it in Grid and Database home after renaming Old Opatch
folder
It
is recommended to have OPatch utility version 12.2.0.1.37 or
later to apply this patch.
$ORACLE_HOME/OPatch/opatch
version
$ORACLE_HOME/OPatch/opatch
lsinventory
$ORACLE_HOME/OPatch/opatch
lspatches
3) Check Free Space in Cluster Home And
Database Home(approx free space
40 GB )
Run OPatch
System Space Check
----------------------------------------
For Grid Infrastructure home, as
home user:
Create file /tmp/patch_list_gihome.txt with the following content:
cat /tmp/patch_list_gihome.txt
/asm_grid/19cpatch/35319490/35320081
/asm_grid/19cpatch/35319490/35320149
/asm_grid/19cpatch/35319490/35332537
/asm_grid/19cpatch/35319490/35553096
/asm_grid/19cpatch/35319490/33575402
Run the OPatch command to check if
enough free space is available in the Grid Infrastructure home:
$ORACLE_HOME/OPatch/opatch
prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
For Oracle home, as home user:
Create file /tmp/patch_list_dbhome.txt with the following content:
cat /tmp/patch_list_dbhome.txt
/asm_grid/19cpatch/35319490/35320081
/asm_grid/19cpatch/35319490/35320149
Run OPatch command to check if
enough free space is available in the Oracle home:
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
4) run opatch
lsinventory to check consistency and corruption of inventory on Grid and Oracle
Home
Eg
Validation of Grid Inventory
<GRID_HOME>/OPatch/opatch lsinventory -detail -oh <GRID_HOME>
Validation of Oracle Inventory
<ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh
<ORACLE_HOME>
Run OPatch Conflict Check for Grid and Oracle Home
-------------------------------------------------
As the Grid home user:
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/35320081
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/35320149
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/35332537
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/35553096
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/33575402
For Oracle home, as home user:
/oracle/app/product/19.0.0/dbhome_1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/35320081
/oracle/app/product/19.0.0/dbhome_1/OPatch/opatch prereq
CheckConflictAgainstOHWithDetail -phBaseDir
/asm_grid/19cpatch/35319490/35320149
5) run analyze command using opatchauto from root user after setting proper path for grid home And Oracle Home
Pre Check at database Level
1)
PATCH confilct
check ON Oracle Home
2)
Oracle suggested to run below command as par of pre-check in
advance .It will help during troubleshooting as well
select
action,action_time,patch_id,status,description from dba_registry_sqlpatch order
by 2;
/
select * from dba_registry_sqlpatch;
$ORACLE_HOME/OPatch/opatch version
$ORACLE_HOME/OPatch/opatch lsinventory
$ORACLE_HOME/OPatch/opatch lspatches
Patch Apply on Grid Home
PATCH
confilct check ON Grid Home
Implementation Step (maintenance window Start)
1) Take backup of the Grid And
Oracle_Home before applying patches
From Root user
Stop crs and database instance on one node
eg
Cd /asm_grid/grid/app/19.3/gridhome1
tar -cvf /oracle/software/grid_home.tar
.
du -hP
/oracle/softwares/grid_home.tar
cd /asm_grid/grid/oraInventory
tar -cvf
/oracle/software/grid_home_inventory.tar .
du -hP
/oracle/softwares/grid_home_inventory.tar
Oracle home backup
cd /oracle/app/product/19.0.0/dbhome_1
tar -cvf /oracle/app/product/19.0.0/dbhome_1
df -g /oracle/softwares/oracle home _home.tar
and
start crs after grid and database home backup (don’t start database instance)
1
applying Patch On
GRID
Run analyze and apply patch
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatchauto apply
/asm_grid/ASM_PATCH/35319490 -analyze -oh /asm_grid/grid/app/19.3/gridhome1
nohup /asm_grid/grid/app/19.3/gridhome1/OPatch/opatchauto apply
/asm_grid/19cpatch/35319490 -oh /asm_grid/grid/app/19.3/gridhome1 &
3 Post
Implementation And Validation
check status of crs
./crsctl check crs
ps -ef|grep d.bin
$GRID_HOME/OPatch/opatch lspatches
$GRID_HOME/OPatch/opatch lsinventory
Patch Apply on Oracle Home
And Database
1
PATCH confilct
check ON Oracle Home
From root user
/asm_grid/grid/app/19.3/gridhome1/OPatch/opatchauto
apply /asm_grid/ASM_PATCH/35319490 -analyze -oh
/asm_grid/grid/app/19.3/gridhome1
2 applying Patch On GRID
From root user
/oracle/app/product/19.0.0/dbhome_1/OPatch/opatchauto apply
/asm_grid/19cpatch/35319490 -oh /oracle/app/product/19.0.0/dbhome_1
Post Implementation And Validation
1) Validate PSU using Opatch Lsinventory from oracle user
Ps -ef|grep pmon
Ps -ef|grep tns
$ORACLE_HOME/OPatch/opatch lspatches
$ORACLE/OPatch/opatch lsinventory
set feedback
on
set lines 200
pages 200
col owner for
a10
col
object_name for a30
col
oracle_maintained for a5
SELECT
owner,object_name,object_type,oracle_maintained FROM dba_objects WHERE
status='INVALID' and owner in
('SYS','SYSTEM')
ORDER BY
owner,object_type;
set feedback
off
select owner,
object_name, object_type,status from dba_objects where status like 'INVALID'
/
select
count(1) from dba_objects where status like 'INVALID'
/
set lines 200
pages 200
col
action_time format a40
col action
format a30
col namespace
format a10
col comments
format a30
col version
format a13
set lin 200
head on feed on pagesize 100
/
select
i.instance_name,r.* from v$instance i, registry$history r
/
set lines 200
pages 200
col
action_time format a40
col
DESCRIPTION format a60
column
comp_name format a50
select
comp_id, comp_name,version, status from dba_registry;
select
PATCH_ID,ACTION_TIME,STATUS,ACTION,DESCRIPTION from dba_registry_sqlpatch
select
action,action_time,patch_id,status,description from dba_registry_sqlpatch order
by 2;
/
select * from
dba_registry_sqlpatch;
No comments:
Post a Comment