<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; ORA-04020</title>
	<atom:link href="https://www.xifenfei.com/tag/ora-04020/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sat, 07 Nov 2026 15:45:44 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ORA-04020导致adg异常</title>
		<link>https://www.xifenfei.com/2019/12/ora-04020-adg.html</link>
		<comments>https://www.xifenfei.com/2019/12/ora-04020-adg.html#comments</comments>
		<pubDate>Wed, 25 Dec 2019 03:29:52 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Data Guard]]></category>
		<category><![CDATA[ORA-xxxxx]]></category>
		<category><![CDATA[ORA-04020]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=8386</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2019/12/ora-04020-adg.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2019/12/ora-04020-adg.html" target="_blank">ORA-04020导致adg异常</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>今日早上有客户反馈adg停止同步了,通过检查alert日志发现</p>
<pre class="brush: bash; title: ; notranslate">
Tue Dec 24 18:17:41 2019
Media Recovery Waiting for thread 1 sequence 56655 (in transit)
Recovery of Online Redo Log: Thread 1 Group 11 Seq 56655 Reading mem 0
  Mem# 0: Y:\ORACLE\ORADATA\ORACLE11\STD_REDO11.LOG
Archived Log entry 56248 added for thread 1 sequence 56654 ID 0x5b6bcf9b dest 1:
Tue Dec 24 18:18:11 2019
Errors in file C:\APP\ADMINISTRATOR\diag\rdbms\oracle11dg\oracle11\trace\oracle11_lgwr_3252.trc:
ORA-04020: deadlock detected while trying to lock object SYS.orcl
LGWR (ospid: 3252): terminating the instance due to error 4020
Tue Dec 24 18:18:11 2019
System state dump requested by (instance=1, osid=3252 (LGWR)), summary=[abnormal instance termination].
System State dumped to trace file C:\APP\ADMINISTRATOR\diag\rdbms\oracle11dg\trace\oracle11_diag_3236_20191224181811.trc
Dumping diagnostic data in directory=[cdmp_20191224181811], 
      requested by (instance=1, osid=3252 (LGWR)), summary=[abnormal instance termination].
Instance terminated by LGWR, pid = 3252
</pre>
<p>由于lgwr进程遭遇ORA-04020,从而使得lgwr进程异常,进而整个数据库crash.<br />
<br />
分析trace文件</p>
<pre class="brush: bash; title: ; notranslate">
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows NT Version V6.1 Service Pack 1 
CPU                 : 8 - type 8664, 8 Physical Cores
Process Affinity    : 0x0x0000000000000000
Memory (Avail/Total): Ph:8395M/32733M, Ph+PgF:41002M/65464M 
Instance name: oracle11
Redo thread mounted by this instance: 1
Oracle process number: 10
Windows thread id: 3252, image: ORACLE.EXE (LGWR)


*** 2019-12-24 18:18:11.072
*** SESSION ID:(384.1) 2019-12-24 18:18:11.072
*** CLIENT ID:() 2019-12-24 18:18:11.072
*** SERVICE NAME:(SYS$BACKGROUND) 2019-12-24 18:18:11.072
*** MODULE NAME:() 2019-12-24 18:18:11.072
*** ACTION NAME:() 2019-12-24 18:18:11.072
 
A deadlock among DDL and parse locks is detected.
This deadlock is usually due to user errors in
the design of an application or from issuing a set
of concurrent statements which can cause a deadlock.
This should not be reported to Oracle Support.
The following information may aid in finding
the errors which cause the deadlock:
ORA-04020: deadlock detected while trying to lock object SYS.orcl
--------------------------------------------------------
  object   waiting  waiting       blocking blocking
  handle   session     lock mode   session     lock mode
--------  -------- -------- ----  -------- -------- ----
0000000676C20F08  000000066D22BE10 00000006738AB970    X  000000066D22BE10 00000006738A04B0    S
0000000677DF2E80  00000006792E2880 0000000673B13AE8    X  000000066D22BE10 00000006738A19B8    S
--------------------------------------------------------
---------- DUMP OF WAITING AND BLOCKING LOCKS ----------
--------------------------------------------------------
------------- WAITING LOCK -------------
----------------------------------------
SO: 0x00000006738AB970, type: 78, owner: 0x000000065D440498, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
 proc=0x000000066CDE7AD0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8751, pg=0

LibraryObjectLock:Address=00000006738AB970 Handle=0000000676C20F08 
  RequestMode=X CanBeBrokenCount=2 Incarnation=3 ExecutionCount=0  
………………
SO: 0x00000006738A19B8, type: 78, owner: 0x000000065A38D6C0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
 proc=0x000000066CDE7AD0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8751, pg=0

LibraryObjectLock:Address=00000006738A19B8 Handle=0000000677DF2E80 
   Mode=S CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0   
  
  User=000000066D22BE10 Session=000000066D22BE10 ReferenceCount=1 Flags=CNB/[0001] SavepointNum=1b749 
  LibraryHandle:  Address=0000000677DF2E80 Hash=675351da LockMode=S PinMode=0 LoadLockMode=0 Status=0 
  ObjectName:  Name=SYS.orcl   
    FullHashValue=285b654fe3f440652c403c98675351da Namespace=DBINSTANCE(74) Type=CURSOR(00) Identifier=1 OwnerIdn=0 
  Statistics:  InvalidationCount=0 ExecutionCount=0 LoadCount=0 ActiveLocks=1 TotalLockCount=74719 TotalPinCount=0 
  Counters:  BrokenCount=1 RevocablePointer=1 KeepDependency=0 Version=0 
        BucketInUse=2 HandleInUse=2 HandleReferenceCount=0 
  Concurrency:  DependencyMutex=0000000677DF2F30(0, 0, 0, 0) Mutex=0000000677DF2FC0(0, 149471, 1, 0) 
  Flags=RON/PIN/KEP/BSO/[00810003] 
  WaitersLists:  
    Lock=0000000677DF2F10[0000000673B13B58,000000067382E2F0] 
    Pin=0000000677DF2EF0[0000000677DF2EF0,0000000677DF2EF0] 
    LoadLock=0000000677DF2F68[0000000677DF2F68,0000000677DF2F68] 
  Timestamp:  
  HandleReference:  Address=0000000677DF3030 Handle=0000000000000000 Flags=[00] ---------------------------------
This lock request was aborted.
error 4020 detected in background process
ORA-04020: deadlock detected while trying to lock object SYS.orcl
kjzduptcctx: Notifying DIAG for crash event
----- Abridged Call Stack Trace -----
ksedsts()+585&lt;-kjzdssdmp()+329&lt;-kjzduptcctx()+288&lt;-kjzdicrshnfy()+99&lt;-ksuitm()+1525&lt;-ksbrdp()+4578&lt;-opirip()
+853&lt;-opidrv()+906&lt;-sou2o()+98&lt;-opimai_real()+280&lt;-opimai()+191
    &lt;-BackgroundThreadStart()+646&lt;-0000000076CF59CD&lt;-0000000076E2A561 
----- End of Abridged Call Stack Trace -----

*** 2019-12-24 18:18:11.165
LGWR (ospid: 3252): terminating the instance due to error 4020

*** 2019-12-24 18:18:17.483
ksuitm: waiting up to [5] seconds before killing DIAG(3236)

 
</pre>
<p>日志显示由于lgwr进程等待LIBRARY OBJECT LOCK超时,从而引起异常,根据经验此类问题一般是由于bug导致,查询mos发现匹配bug信息Bug 18515268  ORA-4020 in ADG Standby Database causing instance crash by LGWR<br />
<a href="//www.xifenfei.com/wp-content/uploads/2019/12/20191225112622.jpg"><img src="//www.xifenfei.com/wp-content/uploads/2019/12/20191225112622.jpg" alt="20191225112622" width="986" height="799" class="alignnone size-full wp-image-8387" /></a><br />
<hr />
可以根据需要打上相关Patch 18515268: ACTIVE DATAGUARD STANDBY CRASHES DUE TO AN ORA-4020 ENCOUNTERED BY LGWR</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/%e8%87%aa%e6%b2%bb%e4%ba%8b%e4%bb%b6%e5%bc%95%e8%b5%b7%e6%ad%bb%e9%94%81.html" rel="bookmark" class="crp_title">自治事件引起死锁</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/04/modify-host-time-db-crash.html" rel="bookmark" class="crp_title">12.1人工修改操作系统时间导致数据库异常</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/03/noarchivelog-recovery.html" rel="bookmark" class="crp_title">非归档数据库异常恢复一例</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/01/bug-21915719.html" rel="bookmark" class="crp_title">Bug 21915719 Database hang or may fail to OPEN in 12c IBM AIX or HPUX Itanium &#8211; ORA-742, DEADLOCK or ORA-600 [kcrfrgv_nextlwn_scn] ORA-600 [krr_process_read_error_2]</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/05/ora-00470.html" rel="bookmark" class="crp_title">ORA-00470: LGWR process terminated with error</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/08/200t-oracle-recovery.html" rel="bookmark" class="crp_title">记录一次200T的数据库恢复经历</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/07/ora-600-kkdlcob-objn-exist-40.html" rel="bookmark" class="crp_title">ORA-600 kkdlcob-objn-exist 40</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/10/controlfile-sequence-number-in-file-header-is-different-from-the-one-in-memory.html" rel="bookmark" class="crp_title">Controlfile sequence number in file header is different from the one in memory</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/09/%e8%af%af%e6%9d%80%e8%bf%9b%e7%a8%8b%e5%af%bc%e8%87%b4rac-hang%e4%bd%8f.html" rel="bookmark" class="crp_title">误杀进程导致rac hang住</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/01/ora-704-ora-702-recovery.html" rel="bookmark" class="crp_title">2019恢复第一单&#8212;ORA-704-ORA-702恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/09/ora-600-4194-smon-maximum-100-non-fatal-internal-errors.html" rel="bookmark" class="crp_title">ORA-600 4194引起SMON encountered 100 out of maximum 100 non-fatal internal errors故障</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/02/ora-600-kcbzib_kcrsds_1.html" rel="bookmark" class="crp_title">ORA-600 kcbzib_kcrsds_1报错</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2019/12/ora-04020-adg.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
