标签云
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-01595 ORA-08103 ORA-600 2131 ORA-600 2662 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,742)
- DB2 (22)
- MySQL (75)
- Oracle (1,591)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (162)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (68)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (582)
- Oracle安装升级 (95)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (84)
- PostgreSQL (27)
- pdu工具 (5)
- PostgreSQL恢复 (9)
- SQL Server (30)
- SQL Server恢复 (11)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- ora-600 kdsgrp1 错误描述
- GAM、SGAM 或 PFS 页上存在页错误处理
- ORA-600 krhpfh_03-1208
- VMware勒索加密恢复(vmdk勒索恢复)
- ORA-39773: parse of metadata stream failed故障处理
- sql数据库备份失败—失败: 23(数据错误(循环冗余检查)
- vmdk文件被加密恢复(虚拟机文件加密)
- 差点被误操作的ORA-600 kcratr_nab_less_than_odr故障
- win平台19c 打patch遭遇2个小问题汇总
- pg单个数据库目录恢复-pdu恢复单个数据库目录数据
- pg删除数据恢复—pdu恢复pg delete数据
- .[OnlyBuy@cyberfear.com].REVRAC勒索mysql恢复
- 表dml操作权限授权给public,导致只读用户失效
- 21c数据库恢复遭遇ora-600 ktugct: corruption detected
- pg_control丢失/损坏处理
- 当前主流数据库版本服务支持周期-202503
- pg启动报invalid checkpoint record处理
- 删除redo导致ORA-00313 ORA-00312故障处理
- Navicat连接postgresql时出现column “datlastsysoid” does not exist错误解决
- aix磁盘损坏oracle数据库恢复
标签归档: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;