标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 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)
- 操作系统 (102)
- 数据库 (1,683)
- DB2 (22)
- MySQL (73)
- Oracle (1,545)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (7)
- Oracle ASM (68)
- Oracle Bug (8)
- Oracle RAC (53)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (565)
- Oracle安装升级 (92)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (79)
- 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)
-
最近发表
- ORA-15411: Failure groups in disk group DATA have different number of disks.
- 断电引起的ORA-08102: 未找到索引关键字, 对象号 39故障处理
- ORA-00227: corrupt block detected in control file
- 手工删除19c rac
- 解决oracle数据文件路径有回车故障
- .wstop扩展名勒索数据库恢复
- Oracle Recovery Tools工具一键解决ORA-00376 ORA-01110故障(文件offline)
- OGG-02771 Input trail file format RELEASE 19.1 is different from previous trail file form at RELEASE 11.2.
- OGG-02246 Source redo compatibility level 19.0.0 requires trail FORMAT 12.2 or higher
- GoldenGate 19安装和打patch
- dd破坏asm磁盘头恢复
- 删除asmlib磁盘导致磁盘组故障恢复
- Kylin Linux 安装19c
- ORA-600 krse_arc_complete.4
- Oracle 19c 202410补丁(RUs+OJVM)
- ntfs MFT损坏(ntfs文件系统故障)导致oracle异常恢复
- .mkp扩展名oracle数据文件加密恢复
- 清空redo,导致ORA-27048: skgfifi: file header information is invalid
- A_H_README_TO_RECOVER勒索恢复
- 通过alert日志分析客户自行对一个数据库恢复的来龙去脉和点评
标签归档: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;