标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-00742 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (103)
- 数据库 (1,701)
- DB2 (22)
- MySQL (74)
- Oracle (1,562)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (68)
- Oracle Bug (8)
- Oracle RAC (53)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (571)
- Oracle安装升级 (94)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (81)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- fio测试io,导致磁盘文件系统损坏故障恢复
- ORA-742 写丢失常见bug记录
- Oracle 19c 202501补丁(RUs+OJVM)
- 避免 19c 数据库性能问题需要考虑的事项 (Doc ID 3050476.1)
- Bug 21915719 Database hang or may fail to OPEN in 12c IBM AIX or HPUX Itanium – ORA-742, DEADLOCK or ORA-600 [kcrfrgv_nextlwn_scn] ORA-600 [krr_process_read_error_2]
- ORA-600 ktuPopDictI_1恢复
- impdp导入数据丢失sys授权问题分析
- impdp 创建index提示ORA-00942: table or view does not exist
- 数据泵导出 (expdp) 和导入 (impdp)工具性能降低分析参考
- 19c非归档数据库断电导致ORA-00742故障恢复
- Oracle 19c – 手动升级到 Non-CDB Oracle Database 19c 的完整核对清单
- sqlite数据库简单操作
- Oracle 暂定和恢复功能
- .pzpq扩展名勒索恢复
- Oracle read only用户—23ai新特性:只读用户
- 迁移awr快照数据到自定义表空间
- .hmallox加密mariadb/mysql数据库恢复
- 2025年首个故障恢复—ORA-600 kcbzib_kcrsds_1
- 第一例Oracle 21c恢复咨询
- ORA-15411: Failure groups in disk group DATA have different number of disks.
标签归档:library cache pin
library cache pin等待事件
library cache pin说明
library cache pin 事件是用来管理library cache的并发访问的, pin一个object会引起相应的heap被载入内存中,如果客户端需要修改或检测这个object它就必须在锁住后取得一个pin.library cache pin的等待时间为3秒钟,其中有1秒钟用于PMON后台进程,即在取得pin之前最多等待3秒钟,否则就超时.library cache pin通常是发生在编译或重新编译PL/SQL,VIEW,TYPES等object时.编译通常都是显性的,如安装应用程序,升级,安装补丁程序等,但object的重新编译也可能发生在object变得无效时.library cache pin的参数如下,有用的主要是P1和P2:
P1 – KGL Handle address.
P2 – Pin address
P3 – 10*Mode + Namespace
其中,P1,P2可与x$kglpn和x$kglob表相关.x$kglpn和x$kglob是ORACLE数据库的内部数据字典.
x$kglpn library cache pin信息
x$kglob library cache object信息
查询方法一
--通过查询V$SESSION_WAIT找出正在等待”library cache pin”的session SELECT sid, SUBSTR (event, 1, 30), TO_CHAR(p1, 'xxxxxxxx') p1_16, --P1RAW P1_16, p2, p3 FROM v$session_wait WHERE wait_time = 0 AND event LIKE 'library cache pin%'; --P1 列是Library Cache Handle Address --P2 列是Library Cache Pin Address. --找到相关session pin状态 SELECT ADDR, INDX, KGLPNADR,-- Library Cache Pin Address KGLPNUSE, KGLPNSES,--识别锁住此pin 的session KGLPNHDL,--Library Cache Handle Address kGLPNLCK, KGLPNMOD,-- Pin 锁 KGLPNREQ-- Pin 请求 FROM x$kglpn WHERE KGLPNHDL LIKE '%EB3EB8%';--p1_16 --询X$KGLOB (Library Cache Object),可找到相关的object SELECT KGLNAOBJ-- 相关object的名字(取前面80个字符) FROM X$KGLOB WHERE KGLHDADR LIKE '%EB3EB8%';--p1_16 --查出占着pin锁的session目前正在做什么 SELECT a.sid, a.username, a.program FROM v$session a, x$kglpn b WHERE a.saddr = b.kglpnuse AND b.kglpnhdl LIKE '%EB3EB8%'--p1_16 AND b.kgnmod <> 0; --查出阻塞者正执行的SQL语句 SELECT sid, sql_text FROM v$session, v$sqlarea WHERE v$session.sql_address = v$sqlarea.address AND sid =&sid;
查询方法二
--通过查询DBA_LOCK_INTERNAL和V$SESSION_WAIT,可得到与”library cache pin” 等待相关的object的名字 SELECT TO_CHAR (SESSION_ID, '999') sid, SUBSTR (LOCK_TYPE, 1, 30) TYPE, SUBSTR (lock_id1, 1, 23) Object_Name, SUBSTR (mode_held, 1, 4) HELD, SUBSTR (mode_requested, 1, 4) REQ, lock_id2 Lock_addr FROM dba_lock_internal WHERE mode_requested <> 'None' AND mode_requested <> mode_held AND session_id IN (SELECT sid FROM v$session_wait WHERE wait_time = 0 AND event LIKE 'library cache pin%'); --查出”library cache pin”占有者(即阻塞者)的session id SELECT sid Holder, KGLPNUSE Sesion, KGLPNMOD Held, KGLPNREQ Req FROM sys.x$kglpn, v$session WHERE KGLPNHDL IN (SELECT p1raw FROM v$session_wait WHERE wait_time = 0 AND event LIKE 'library cache pin%') AND KGLPNMOD <> 0 AND v$session.saddr = x$kglpn.kglpnuse; --查出”library cache pin”占有者(阻塞者)正在等什么 SELECT sid, SUBSTR (event, 1, 30), wait_time FROM v$session_wait WHERE sid IN (SELECT sid FROM x$kglpn, v$session WHERE KGLPNHDL IN (SELECT p1raw FROM v$session_wait WHERE wait_time = 0 AND event LIKE 'library cache pin%') AND KGLPNMOD <> 0 AND v$session.saddr = x$kglpn.kglpnuse); --查出阻塞者正执行的SQL语句 SELECT sid, sql_text FROM v$session, v$sqlarea WHERE v$session.sql_address = v$sqlarea.address AND sid =&sid;