패치 적용
Oracle
# 1) Shut down the database, apply the binary patch with OPatch:
$ $ORACLE_HOME/OPatch/opatch apply
# 2) Open the database and load the SQL layer changes:
$ $ORACLE_HOME/OPatch/datapatch -verboseopatch apply는 Oracle Home의 바이너리를 갱신하고, 이어서 datapatch가 열린 데이터베이스에 딕셔너리/SQL 변경을 적용해 dba_registry_sqlpatch에 기록한다. RAC에서는 rolling 설치 가능한 패치를 노드별로 적용할 수 있다.
PostgreSQL
# Minor version patch = replace binaries + restart (no dump needed):
$ sudo systemctl stop postgresql-16
$ sudo dnf update postgresql16-server # or apt upgrade
$ sudo systemctl start postgresql-16같은 메이저 버전 계열 내의 마이너 패치(16.3 -> 16.4)는 데이터 형식을 바꾸지 않는다. 패키지를 갱신하고 서비스를 재시작하면 충분하며 pg_upgrade나 dump/restore는 필요 없다.
MySQL
# Minor/patch update: update the package and restart the service
$ sudo systemctl stop mysqld
$ sudo dnf update mysql-community-server # or apt upgrade
$ sudo systemctl start mysqldMySQL 8.0+는 시작 시 데이터 딕셔너리를 자동으로 업그레이드하므로 별도의 mysql_upgrade 단계가 필요 없다. 복제 환경에서는 replica를 먼저 패치하고 소스를 나중에 패치한다.
SQL Server
-- Run the Cumulative Update (CU) or GDR security update installer:
-- SQLServer2022-KB<no>-x64.exe /quiet /IAcceptSQLServerLicenseTerms
-- /Action=Patch /InstanceName=MSSQLSERVER
-- The instance then restarts; verify the version with SERVERPROPERTY.CU(Cumulative Update)와 GDR(General Distribution Release) 업데이트는 setup 설치 프로그램으로 적용하며 인스턴스 재시작이 필요하다. Always On 그룹에서는 secondary replica를 먼저 패치하고 페일오버하여 다운타임을 최소화한다.
MongoDB
// 'Rolling' patch on a replica set: one node at a time
// 1) Stop mongod, replace the binary with the new patch version, restart
// 2) Secondaries first, the primary last
// Step down the primary manually before patching it:
rs.stepDown()같은 메이저 버전(7.0.x) 내의 패치 업데이트는 secondary부터 rolling 방식으로 수행한다. primary는 rs.stepDown()으로 역할을 넘긴 뒤 패치하여 쓰기 다운타임을 최소화한다.
Redis
# Patch via rolling restart in a replicated deployment:
# 1) Stop one replica node, install the new version, start it, wait for sync
# 2) Repeat for the remaining replicas
# 3) Finally, fail over the master and patch it:
redis-cli -h <replica> REPLICAOF NO ONE # promote the upgraded replica패치 버전(7.2.x)은 rolling restart로 적용한다. 먼저 replica를 업그레이드하고 재동기화한 뒤, replica를 master로 승격하고 기존 master를 패치한다. Sentinel/Cluster가 페일오버를 자동화한다.
Elasticsearch
# Rolling upgrade (patch within the same major version), per node:
PUT _cluster/settings
{ "persistent": { "cluster.routing.allocation.enable": "primaries" } }
# -> stop the node, update the package, start the node, then:
PUT _cluster/settings
{ "persistent": { "cluster.routing.allocation.enable": null } }패치/마이너 업그레이드는 rolling upgrade로 수행한다. 샤드 할당을 제한하고, 노드를 하나씩 갱신·재시작한 뒤 할당을 다시 활성화하고 클러스터가 green으로 돌아올 때까지 기다린다.