1. 패치 사전 준비
A) 환경 변수 설정
root 유저 경로 환경 변수 설정
export ORACLE_BASE=/u01/app/oracle export GRID_HOME=/u01/app/19c/grid export DB_HOME=$ORACLE_BASE/product/19c/db_1 export ORACLE_HOME=$GRID_HOME
B) OPatch 업데이트
Grid opatch 버전 확인 및 업데이트
$GRID_HOME/OPatch/opatch version #mv $GRID_HOME/OPatch $GRID_HOME/OPatch.old #unzip <패치 다운로드 경로>/p6880880_122010_Linux-x86-64.zip -d $GRID_HOME #chown -R oracle:oinstall $GRID_HOME/OPatch #ll $GRID_HOME | grep OPatch #$GRID_HOME/OPatch/opatch version
DB opatch 버전 확인 및 업데이트
$DB_HOME/OPatch/opatch version #mv $DB_HOME/OPatch $DB_HOME/OPatch.old #unzip <패치 다운로드 경로>/p6880880_122010_Linux-x86-64.zip -d $DB_HOME #chown -R oracle:oinstall $DB_HOME/OPatch #ll $DB_HOME | grep OPatch #$DB_HOME/OPatch/opatch version
C) 패치 현황 조사
패치 현황 확인
$GRID_HOME/OPatch/opatch lspatches -oh $GRID_HOME $DB_HOME/OPatch/opatch lspatches -oh $DB_HOME
D) 패치 압축 해제
패치 압축 해제
mkdir ~oracle/patch unzip p30116789_190000_Linux-x86-64.zip -d ~oracle/patch
E) Grid 패치 충돌 여부 검증
Grid 패치의 소프트웨어 충돌 여부 확인
$GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/30122149 $GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/30122167 $GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/30125133 $GRID_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/29401763
Grid 패치의 패치간 충돌 여부 확인
$GRID_HOME/OPatch/opatch prereq CheckConflictAmongPatches -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/30122149 $GRID_HOME/OPatch/opatch prereq CheckConflictAmongPatches -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/30122167 $GRID_HOME/OPatch/opatch prereq CheckConflictAmongPatches -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/30125133 $GRID_HOME/OPatch/opatch prereq CheckConflictAmongPatches -oh $GRID_HOME -phBaseDir ~oracle/patch/30116789/29401763
F) DB 패치 충돌 여부 검증
DB 패치의 소프트웨어 충돌 여부 확인
$DB_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $DB_HOME -phBaseDir ~oracle/patch/30116789/30122149 $DB_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -oh $DB_HOME -phBaseDir ~oracle/patch/30116789/30125133
DB 패치의 패치간 충돌 여부 확인
$DB_HOME/OPatch/opatch prereq CheckConflictAmongPatches -oh $DB_HOME -phBaseDir ~oracle/patch/30116789/30122149 $DB_HOME/OPatch/opatch prereq CheckConflictAmongPatches -oh $DB_HOME -phBaseDir ~oracle/patch/30116789/30125133
2. 1번 노드 패치
A) Grid 패치를 위한 공간 확인
1번 노드 Grid 패치 필요 공간 확인
cat > /tmp/patch_list_gihome.txt /home/oracle/patch/30116789/30122149 /home/oracle/patch/30116789/30122167 /home/oracle/patch/30116789/30125133 /home/oracle/patch/30116789/29401763 <ctrl+c> $GRID_HOME/OPatch/opatch prereq CheckSystemSpace -oh $GRID_HOME -phBaseFile /tmp/patch_list_gihome.txt
B) Prepatch 수행
1번 노드 root 유저로 prepatch 수행
$GRID_HOME/crs/install/rootcrs.sh -prepatch
C) Grid 패치
1번 노드 Grid 패치 적용
$GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/30122149 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/30122167 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/30125133 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/29401763
D) DB 패치를 위한 공간 확인
1번 노드 DB 패치 필요 공간 확인
cat > /tmp/patch_list_dbhome.txt /home/oracle/patch/30116789/30122149 /home/oracle/patch/30116789/30125133 <ctrl + c> $DB_HOME/OPatch/opatch prereq CheckSystemSpace -oh $DB_HOME -phBaseFile /tmp/patch_list_dbhome.txt
E) DB 패치
1번 노드 DB 패치 적용
~oracle/patch/30116789/30122149/custom/scripts/prepatch.sh -dbhome $DB_HOME $DB_HOME/OPatch/opatch apply -oh $DB_HOME -local ~oracle/patch/30116789/30122149 $DB_HOME/OPatch/opatch apply -oh $DB_HOME -local ~oracle/patch/30116789/30125133 ~oracle/patch/30116789/30122149/custom/scripts/postpatch.sh -dbhome $DB_HOME
F) Postpatch 수행
1번 노드 root 유저로 postpatch 수행
$GRID_HOME/rdbms/install/rootadd_rdbms.sh $GRID_HOME/crs/install/rootcrs.sh -postpatch
G) 패치 결과 확인
1번 노드 패치 결과 확인
$GRID_HOME/OPatch/opatch lspatches -oh $GRID_HOME $DB_HOME/OPatch/opatch lspatches -oh $DB_HOME
3. 2번 노드 패치
A) Grid 패치를 위한 공간 확인
2번 노드 Grid 패치 필요 공간 확인
cat > /tmp/patch_list_gihome.txt /home/oracle/patch/30116789/30122149 /home/oracle/patch/30116789/30122167 /home/oracle/patch/30116789/30125133 /home/oracle/patch/30116789/29401763 <ctrl+c> $GRID_HOME/OPatch/opatch prereq CheckSystemSpace -oh $GRID_HOME -phBaseFile /tmp/patch_list_gihome.txt
B) Prepatch 수행
2번 노드 root 유저로 prepatch 수행
$GRID_HOME/crs/install/rootcrs.sh -prepatch
C) Grid 패치
2번 노드 Grid 패치 적용
$GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/30122149 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/30122167 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/30125133 $GRID_HOME/OPatch/opatch apply -oh $GRID_HOME -local ~oracle/patch/30116789/29401763
D) DB 패치를 위한 공간 확인
2번 노드 DB 패치 필요 공간 확인
cat > /tmp/patch_list_dbhome.txt /home/oracle/patch/30116789/30122149 /home/oracle/patch/30116789/30125133 <ctrl + c> $DB_HOME/OPatch/opatch prereq CheckSystemSpace -oh $DB_HOME -phBaseFile /tmp/patch_list_dbhome.txt
E) DB 패치
2번 노드 DB 패치 적용
~oracle/patch/30116789/30122149/custom/scripts/prepatch.sh -dbhome $DB_HOME $DB_HOME/OPatch/opatch apply -oh $DB_HOME -local ~oracle/patch/30116789/30122149 $DB_HOME/OPatch/opatch apply -oh $DB_HOME -local ~oracle/patch/30116789/30125133 ~oracle/patch/30116789/30122149/custom/scripts/postpatch.sh -dbhome $DB_HOME
F) Postpatch 수행
2번 노드 root 유저로 postpatch 수행
$GRID_HOME/rdbms/install/rootadd_rdbms.sh $GRID_HOME/crs/install/rootcrs.sh -postpatch
G) 패치 결과 확인
2번 노드 패치 결과 확인
$GRID_HOME/OPatch/opatch lspatches -oh $GRID_HOME $DB_HOME/OPatch/opatch lspatches -oh $DB_HOME