블록 클린아웃은 트랜잭션에 의해 설정된 로우 Lock을 해제하고 블록 헤더에 커밋 정보를 기록하는 오퍼레이션이다.
대량의 갱신 작업이 있고 나서는 해당 블록들을 일일이 찾아 다니며 클린아웃을 수행하려면 시간이 오래 걸려 오라클은 대량 갱신 작업 후에는 커밋 정보를 트랜잭션 테이블에만 기록하고 커밋을 빠르게 끝낸다.
항상 이 방식으로 작동하는것은 아니며, 오라클은 delayed 블록 클린 아웃과 커밋 클린아웃 두 가지 매커니즘을 사용한다.
(1) Delayed 블록 클린아웃
트랜잭션이 갱신한 블록 개수가 총 버퍼 캐시 블록 개수의 1/10을 초과할 때 사용하는 방식이다. 커밋 이후 해당 블록을 액세스하는 첫 번째 쿼리에 의해 클린아웃이 이루어지며, 이때 아래와 같은 작업을 수행한다.
1. ITL 슬롯에 커밋 정보 저장 --> active 상태의 블록이, 다른 트랜잭션이 변경 시킨 사항이 ITL에 아직 기록되지 않았다면 ITL슬롯에 기록된 트랜잭션 ID를 이용해 undo 세그먼트 헤더에 있는 트랜잭션 테이블 슬롯을 찾아가 현재 상태를 확인하고 커밋된 상태면 이를 ITL슬롯에 반영.
2. 레코드에 기록된 lock byte 해제
3. online redo에 logging
(2) 커밋 클린아웃(=fast 블록 클린아웃)
트랜잭션이 갱신한 블록 개수가 버퍼 캐시 블록 개수의 1/10을 초과하지 않을때는 커밋 시점에 곧바로 블록 클린아웃을 수행한다.
다만, 이 경우에도 커밋 시점에는 '불완전한 형태의 클린아웃'을 수행하며 해당 블록을 갱신하는 다음 트랜잭션에 의해 완전한 클린아웃이 이루어진다.
ITL 슬롯에 커밋 정보만 저장하고 로우 헤더의 lock byte는 해제하지 않는다.
즉 커밋 클린아웃시에는 online redo에 로그를 남기지 않는다. 로깅 시점을 미룸
그러고 나서 해당 블록을 갱신하려고 currnt 모드로 읽는 시점에 비로소 lock byte를 해제하고 완전한 클린아웃을 수행함.
그리고 그 내역을 online redo 에 로깅. 이를 delayed 로깅 블록 클린 아웃이라고 부름.
Doc ID 2939270.1 *********************************************************************** Fatal NI connect error 12637, connecting to: (LOCAL=NO)
VERSION INFORMATION: TNS for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production TCP/IP NT Protocol Adapter for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production Oracle Bequeath NT Protocol Adapter for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production Time: 27-APR-2025 12:18:14 Tracing not turned on. Tns error struct: ns main err code: 12637
TNS-12637: Packet receive failed ns secondary err code: 12532 nt main err code: 0 nt secondary err code: 0 nt OS err code: 0 Sun Apr 27 12:18:14 2025 opiodr aborting process unknown ospid (35324084) as a result of ORA-609 ***********************************************************************
VERSION INFORMATION: TNS for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production TCP/IP NT Protocol Adapter for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production Oracle Bequeath NT Protocol Adapter for IBM/AIX RISC System/6000: Version 12.2.0.1.0 - Production Time: 27-APR-2025 07:43:32 Tracing not turned on. Tns error struct: ns main err code: 12535
TNS-12535: TNS:operation timed out ns secondary err code: 12606 nt main err code: 0 nt secondary err code: 0 nt OS err code: 0 Client address: <unknown> Sun Apr 27 07:43:32 2025 opiodr aborting process unknown ospid (28049744) as a result of ORA-609 Sun Apr 27 07:46:31 2025
oracleasm과 UDEV은 둘 다 Oracle ASM에서 디스크를 식별하고 접근할 수 있도록 도와주는 디바이스 레이어 매핑 방식이지만, 방식과 유연성, 관리 측면에서 차이가 있습니다. 아래에서 둘의 차이를 비교해볼게요.
✅ 1. 개념적 차이
항목
oracleasm
UDEV
목적
Oracle 전용 디스크 관리 도구
리눅스 시스템 전반의 디바이스 관리 체계
설계 대상
Oracle ASM에 특화됨
시스템 전체 디바이스 규칙 관리 (Oracle 외에도 사용 가능)
디바이스 노출
/dev/oracleasm/disks/DISKNAME
/dev/mapper/*, /dev/sdX, /dev/nvme*, 사용자 정의 이름 가능
설정 위치
/etc/sysconfig/oracleasm
/etc/udev/rules.d/*.rules
✅ 2. 구성 및 사용 방법
oracleasm
Oracle에서 제공하는 툴 (oracleasm-support, oracleasm-lib)
oracleasm createdisk, oracleasm listdisks, oracleasm scandisks 명령 사용
디바이스 준비, 파라미터 설정, ASM에서 바로 인식
UDEV
리눅스 기본 udev 시스템 사용
디바이스에 대한 규칙을 직접 작성해야 함
KERNEL==, OWNER=, GROUP=, MODE= 같은 매핑 조건 사용
디스크 이름, 소유자, 권한 직접 지정 가능
✅ 3. 장단점 비교
항목
oracleasm
UDEV
간편성
간단한 명령으로 디스크 관리
수동 설정 필요 (규칙 작성)
유연성
Oracle 전용, 제한적
디스크 이름/권한 자유롭게 설정 가능
표준성
Oracle 종속적
리눅스 표준 방식, 다목적
오버헤드
약간 있음 (oracleasm 모듈 필요)
없음 (리눅스 자체 기능)
권장 사용
과거엔 oracleasm 권장
현재는 UDEV가 일반적으로 권장됨
✅ 4. 현재 Oracle의 권장 방식은?
Oracle은 11g까지는 oracleasm을 많이 사용했지만, 12c 이후부터는 UDEV 사용을 더 권장하고 있습니다.
이유: 표준 리눅스 방식이고, 더 유연하고 범용성이 좋기 때문
Oracle 공식 문서에서도 UDEV 기반으로 ASM 디스크 구성하는 예제가 많습니다
✅ 결론 정리
상황
추천 방식
최신 환경 (12c 이상, 특히 19c)
UDEV 기반 권장
과거 환경, oracleasm 익숙한 경우
oracleasm 사용 가능 (단, 유지보수 제한적)
혼합 사용
절대 비추천 (충돌 위험)
✅ 1. ASM 디스크 물리 경로 확인
oracleasm 사용 시:
oracleasm listdisks
DATA1
DATA2
FRA1
oracleasm querydisk -p DATA1
→ 결과:
Disk "DATA1"is valid
[8,17] /dev/sdb1
→ 실제 물리 디바이스: /dev/sdb1
UDEV 사용 시 (oracleasm 미사용)
보통 /dev/mapper/, /dev/oracleasm/disks/, /dev/asmdisk*, /dev/sdX, /dev/nvmeXnXpX 등이 될 수 있습니다. UDEV 매핑 규칙은 /etc/udev/rules.d/99-oracle-asm.rules 등에 정의돼 있어요.
🧩 Oracle 19c + RAC 환경에서 crsctl start crs 시 ASM 기동 흐름
🧾 1. 명령어
crsctl start crs
실행 주체: root
설명: CRS(Cluster Ready Services)를 시작하는 명령어. RAC 노드마다 개별적으로 실행됨.
대상 위치: $GRID_HOME/bin/crsctl
🧱 2. 기동 순서 (CRS → ASM 포함)
root가 crsctl 실행 ↓ ohasd.bin 기동 ↓ cssd, gpnpd, evmd 등 핵심 데몬 기동 ↓ Voting Disk 확인 ↓ ASM 관련 에이전트 기동 (oraagent, orarootagent) ↓ +ASM 인스턴스 기동 (oracle binary) ↓ 디스크 그룹 마운트 (DATA, FRA 등) ↓ CRSD 기동 후 나머지 리소스(DB, Listener 등) 기동
🔧 3. 실행되는 bin 파일 목록
구성 요소실행 파일 경로설명
ohasd
$GRID_HOME/bin/ohasd.bin
가장 먼저 시작되는 데몬
ocssd
$GRID_HOME/bin/ocssd.bin
Voting Disk를 사용한 노드 간 동기화
oraagent
$GRID_HOME/bin/oraagent.bin
ASM 등 리소스 기동/모니터링
orarootagent
$GRID_HOME/bin/orarootagent.bin
루트 권한이 필요한 리소스 담당
oracle
$GRID_HOME/bin/oracle
ASM 인스턴스 자체 실행 (+ASM1, +ASM2 등 SID)
crsd
$GRID_HOME/bin/crsd.bin
리소스(서비스, DB 등) 기동
GRID_HOME은 예: /u01/app/19.0.0/grid
💽 4. ASM 디스크 및 디스크 그룹
ASM 디스크 경로 예시
/dev/oracleasm/disks/* (oracleasm-lib 사용 시)
/dev/mapper/*, /dev/sd*, /dev/nvme* (UDEV으로 매핑 시)
디스크 그룹
보통 DATA, FRA 등의 디스크 그룹 이름을 사용
ASM 인스턴스가 기동되며 디스크 그룹을 자동으로 마운트함
👤 5. 실행 주체 (사용자/프로세스)
실행 대상사용자설명
crsctl start crs
root
시스템/클러스터 전체 시작
ohasd.bin, crsd.bin 등
root
루트 데몬
oraagent.bin, orarootagent.bin
grid / root
리소스 감시 및 실행
ASM 인스턴스 (+ASM1)
grid
oracle 프로세스로 기동, SID는 +ASM1, +ASM2 형태
ASM 디스크 접근
grid
UDEV 혹은 oracleasm 설정으로 grid가 접근 가능해야 함
🔍 참고 확인 명령어
ps -ef | grep asm # ASM 인스턴스 기동 여부 확인
crsctl stat res -t # 리소스 상태 및 ASM 리소스 확인
asmcmd lsdg # 마운트된 디스크 그룹 정보 확인
ls -l /dev/oracleasm/disks/ # ASM 디스크 경로 확인 (oracleasm 사용 시)
ls -l /dev/mapper/ # UDEV 사용 시 디스크 매핑 확인
✅ 요약
항목내용
기동 명령
crsctl start crs (root 실행)
주요 순서
OHASD → CSSD → oraagent → ASM → CRSD
실행 파일
ohasd.bin, ocssd.bin, oraagent.bin, oracle 등
사용자
root (초기 데몬), grid (ASM 인스턴스)
디스크
/dev/oracleasm/disks/*, /dev/mapper/* 등
📋 예시 1: crsctl stat res -t 출력 예시
이 명령은 Cluster Resource 상태를 트리 형태로 보여줍니다. ASM 관련 부분 중심으로 발췌한 예시입니다:
#crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4535: Cannot communicate with Cluster Ready Services CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online
2. Try to stop and start it:-
#crsctl stop crs CRS-2796: The command may not proceed when Cluster Ready Services is not running CRS-4687: Shutdown command has completed with errors. CRS-4000: Command Stop failed, or completed with errors.
#crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4535: Cannot communicate with Cluster Ready Services CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online
#crsctl start crs CRS-4640: Oracle High Availability Services is already active CRS-4000: Command Start failed, or completed with errors.
3. Stop High availabilty service and crs resources:-
crsctl stop res -init -all root@dbwr1 ~]# crsctl stop res -init -all CRS-2500: Cannot stop resource 'ora.diskmon' as it is not running CRS-2673: Attempting to stop 'ora.asm' on 'dbwr1' CRS-2673: Attempting to stop 'ora.storage' on 'dbwr1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'dbwr1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'dbwr1' CRS-2673: Attempting to stop 'ora.gipcd' on 'dbwr1' CRS-2673: Attempting to stop 'ora.crf' on 'dbwr1' CRS-2673: Attempting to stop 'ora.evmd' on 'dbwr1' CRS-2677: Stop of 'ora.asm' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.storage' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'dbwr1' CRS-2673: Attempting to stop 'ora.crsd' on 'dbwr1' CRS-2673: Attempting to stop 'ora.ctssd' on 'dbwr1' CRS-2677: Stop of 'ora.evmd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.gipcd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.crsd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.crf' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'dbwr1' CRS-2677: Stop of 'ora.cssd' on 'dbwr1' succeeded CRS-4000: Command Stop failed, or completed with errors.
crsctl stop has [root@dbwr1 ~]# crsctl stop has CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'dbwr1' CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'dbwr1' has completed CRS-4133: Oracle High Availability Services has been stopped.
Verify no crs processes should be running :- ps -ef|grep d.bin
[root@opendb01 opendb01]#crsctl stop crs [root@dbwr1 ~]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'dbwr1' CRS-2673: Attempting to stop 'ora.crsd' on 'dbwr1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'dbwr1' CRS-2673: Attempting to stop 'ora.chad' on 'dbwr1' CRS-2677: Stop of 'ora.chad' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'dbwr1' CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'dbwr1' CRS-33673: Attempting to stop resource group 'ora.asmgroup' on server 'dbwr1' CRS-2673: Attempting to stop 'ora.asm' on 'dbwr1' CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.scan1.vip' on 'dbwr1' CRS-2677: Stop of 'ora.scan1.vip' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.dbwr1.vip' on 'dbwr1' CRS-2677: Stop of 'ora.dbwr1.vip' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.asm' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'dbwr1' CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.asmnet1.asmnetwork' on 'dbwr1' CRS-2677: Stop of 'ora.asmnet1.asmnetwork' on 'dbwr1' succeeded CRS-33677: Stop of resource group 'ora.asmgroup' on server 'dbwr1' succeeded. CRS-2672: Attempting to start 'ora.scan1.vip' on 'dbwr2' CRS-2672: Attempting to start 'ora.dbwr1.vip' on 'dbwr2' CRS-2676: Start of 'ora.dbwr1.vip' on 'dbwr2' succeeded CRS-2676: Start of 'ora.scan1.vip' on 'dbwr2' succeeded CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'dbwr2' CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'dbwr2' succeeded CRS-2799: Failed to shut down resource 'ora.OCR_DISK.dg' on 'dbwr1' CRS-2794: Shutdown of Cluster Ready Services-managed resources on 'dbwr1' has failed CRS-2675: Stop of 'ora.crsd' on 'dbwr1' failed CRS-2799: Failed to shut down resource 'ora.crsd' on 'dbwr1' CRS-2795: Shutdown of Oracle High Availability Services-managed resources on 'dbwr1' has failed CRS-4687: Shutdown command has completed with errors. CRS-4000: Command Stop failed, or completed with errors.
[root@opendb01 opendb01]#crsctl stop crs -f [root@dbwr1 ~]# crsctl stop crs -f CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'dbwr1' CRS-2673: Attempting to stop 'ora.crsd' on 'dbwr1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'dbwr1' CRS-2673: Attempting to stop 'ora.OCR_DISK.dg' on 'dbwr1' CRS-2677: Stop of 'ora.OCR_DISK.dg' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.ons' on 'dbwr1' CRS-2677: Stop of 'ora.ons' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.net1.network' on 'dbwr1' CRS-2677: Stop of 'ora.net1.network' on 'dbwr1' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'dbwr1' has completed CRS-2677: Stop of 'ora.crsd' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'dbwr1' CRS-2673: Attempting to stop 'ora.crf' on 'dbwr1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'dbwr1' CRS-2677: Stop of 'ora.crf' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.asm' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'dbwr1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.ctssd' on 'dbwr1' CRS-2673: Attempting to stop 'ora.evmd' on 'dbwr1' CRS-2677: Stop of 'ora.evmd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'dbwr1' CRS-2677: Stop of 'ora.cssd' on 'dbwr1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'dbwr1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'dbwr1' CRS-2677: Stop of 'ora.gpnpd' on 'dbwr1' succeeded CRS-2677: Stop of 'ora.gipcd' on 'dbwr1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'dbwr1' has completed CRS-4133: Oracle High Availability Services has been stopped.
[root@RAC01 ~]#crsctl stop crs CRS-2796: The command may not proceed when Cluster Ready Services is not running CRS-4687: Shutdown command has completed with errors. CRS-4000: Command Stop failed, or completed with errors.
[root@RAC01 ~]#crsctl start cluster
[root@RAC01 ~]#crsctl check crs [root@dbwr1 ~]# crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online
Call이 어디서 발생하느냐에 따라 User Call과 Recursive Call로 나눌 수 있다.
1) User Call : OCI(Oracle Call Interface)를 통해 외부로부터 들어오는 Call
2) Recursive Call : 오라클 내부에서 발생하는 Call, - SQL파싱과 최적화 과정에서 발생하는 Data Dictionary 조회, - PL/SQL로 작성된 사용자 정의 함수 , Procedure , Trigger로 인한 SQL수행
특징 1) User Call User Call 발생 빈도를 결정하는 요소들 개발자의 기술이 관여 프레임워크 내에 Array processing을 지원 유무가 중요하다. 설계 표준 가이드 사용자 정의 함수/프로시저에 대한 무조건적인 제약 모듈이 지나치게 단위로 구성되어 SQL이 건건이 호출되는 개발환경
Loop 쿼리를 해소하고, 집합적 사고를 통해 One-SQL로 구현
Array Processing : Array 단위 Fetch, Bulk Insert / Update / Delete 부분범위처리 활용 효과적인 화면 페이지 처리 사용자 정의함수 / 프로시저 / 트리거의 적절한 활용
2) Recursive Call Hard Parsing에 대해 Recursive Call 발생
바인드 변수의 적극적 사용, 하드파싱 횟수 절감을 통해 Recursive Call 감소 Recursive Depth를 크게 만들지 않게끔 프로시저 구성 ( 프로시저 안에 프로시저가 들어있는 횟수 : Recursive Depth ) Recursive Depth를 크기 만들지 않게끔 지나친 Procedure의 모듈화를 지양 대용량 데이터 조회시 함수호출이 건건이 발생하지 않게끔, 함수를 부분범위 처리가 가능한 상황에서, 제한적으로 사용해야함 조인 또는 스칼라 서브쿼리 형태로 변환.
# Array processing의 효과를 제대로 발휘하려면, 연속된 일련의 처리과정이 모두 Array 단위로 지정되어야 한다. ex : insert select문 - select (fetch), insert(execute)의 각각의 단계에서 Array processing size가 일치해야한다.만약 select에서 5000건식 Fetch를 한다 하더라도, insert 단계에서, 건건이 execute를 수행하면, 병렬로부터 직렬로 처리되는 부분이 병목현상을 야기하기 때문에 쿼리 처리속도가 빠르지 않다.
위의 표는 앞 절에서 수행한 3가지 테스트(PL/SQL,JAVA(array가 10),One-SQL)와 방금 확인한 java(array가 1000)결과를 표로 정리한 것. 네트워크를 경유해 발생하는 데이터베이스 Call이 얼마만큼 심각한 성능부하를 일으키는지 알 수 있다. 그 뿐 아니라 One-SQL로 통합하지 않더라도 Array Processing만으로 그에 버금가는 성능개선 효과를 얻을 수 있음을 확인 할 수 있다.