library cache lock: 대기: library cache 객체 핸들 경합(parse/DDL 직렬화)
Oracle의미
세션이 library cache 내 객체(SQL, PL/SQL, 테이블 정의)의 락을 기다리고 있다. 보통 parse와 DDL 작업의 직렬화로 인해 발생한다.
원인
많이 사용되는 객체에 대한 DDL(ALTER/CREATE), 자주 재컴파일되는 PL/SQL 객체(invalidation), 과도한 hard parse, 종속 객체의 invalidation, 또는 대량의 동시 접속 폭주.
해결 방법
블로킹 세션과 객체를 찾는다(v$session, ASH, 필요하면 library cache lock 진단). 많이 사용되는 객체에 대한 DDL은 피크 시간에 실행하지 않는다. 종속성 체인을 줄이고 불필요한 재컴파일을 방지한다. 바인드 변수를 사용해 hard parse를 줄인다. 접속 폭주는 커넥션 풀로 완화한다.
같은 데이터베이스의 다른 항목
- db file scattered read대기: 다중 블록 물리 읽기, 보통 full table scan 또는 index fast full scan
- buffer busy waits대기: 다른 세션이 이미 읽거나 수정 중인 버퍼에 대한 경합
- gc buffer busy대기(RAC): 인스턴스 간 전송 중인 cache fusion 블록에 대한 경합
- ORA-00604error occurred at recursive SQL level
- ORA-01438value larger than specified precision allowed for this column
- ORA-01400cannot insert NULL into (column)
- ORA-02291integrity constraint violated - parent key not found