<?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; SCALABLE LGWR</title>
	<atom:link href="https://www.xifenfei.com/tag/scalable-lgwr/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>Wed, 28 Oct 2026 00:37:06 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>_use_single_log_writer和_max_outstanding_log_writes</title>
		<link>https://www.xifenfei.com/2016/06/_use_single_log_writer%e5%92%8c_max_outstanding_log_writes.html</link>
		<comments>https://www.xifenfei.com/2016/06/_use_single_log_writer%e5%92%8c_max_outstanding_log_writes.html#comments</comments>
		<pubDate>Tue, 07 Jun 2016 08:12:44 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[ORACLE 12C]]></category>
		<category><![CDATA[SCALABLE LGWR]]></category>
		<category><![CDATA[_max_outstanding_log_writes]]></category>
		<category><![CDATA[_use_single_log_writer]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=6409</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2016/06/_use_single_log_writer%e5%92%8c_max_outstanding_log_writes.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/2016/06/_use_single_log_writer%e5%92%8c_max_outstanding_log_writes.html" target="_blank">_use_single_log_writer和_max_outstanding_log_writes</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>SCALABLE LGWR是12cR1中引入的一个令人激动的特性， 这是由于在OLTP环境中LGWR写日志往往成为系统的主要性能瓶颈， 如果LGWR进程能像DBWR(DBW0~DBWn)那样多进程（LGNN）写出redo到LOGFILE那么就可能大幅释放OLTP的并发能力，增长Transcation系统的单位时间事务处理能力。这里在12.2版本中进行测试，确定_use_single_log_writer和_max_outstanding_log_writes参数对于SCALABLE LGWR特性的影响<br />
<strong>数据库版本</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select * from v$version;

BANNER                                                                                         CON_ID
------------------------------------------------------------------------------------------ ----------
Oracle Database 12c Enterprise Edition Release 12.2.0.0.3 - 64bit Production                        0
PL/SQL Release 12.2.0.0.3 - Production                                                              0
CORE    12.2.0.0.3      Production                                                                  0
TNS for Linux: Version 12.2.0.0.3 - Production                                                      0
NLSRTL Version 12.2.0.0.3 - Production                                                              0
</pre>
<p><strong>_use_single_log_writer和_max_outstanding_log_writes默认值</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; /
Enter value for param: _use_single_log_writer
old   6:    and upper(a.ksppinm) LIKE upper('%&amp;param%')
new   6:    and upper(a.ksppinm) LIKE upper('%_use_single_log_writer%')

NAME                                                 VALUE                    DESCRIPTION
---------------------------------------------------- ------------------------ -------------------------------------------
_use_single_log_writer                               ADAPTIVE                 Use a single process for redo log writing

SQL&gt; /
Enter value for param: _max_outstanding_log_writes
old   6:    and upper(a.ksppinm) LIKE upper('%&amp;param%')
new   6:    and upper(a.ksppinm) LIKE upper('%_max_outstanding_log_writes%')

NAME                                                 VALUE                    DESCRIPTION
---------------------------------------------------- ------------------------ ----------------------------------------------
_max_outstanding_log_writes                          2                        Maximum number of outstanding redo log writes
</pre>
<p><strong>lg进程数量</strong><br />
这里可以看出来，有一个lgwr进程，两个lg进程和_max_outstanding_log_writes参数配置匹配</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@ora1221 ~]$ ps -ef|grep ora_lg
oracle    49790      1  0 10:32 ?        00:00:00 ora_lgwr_orcl12c2
oracle    49794      1  0 10:32 ?        00:00:00 ora_lg00_orcl12c2
oracle    49798      1  0 10:32 ?        00:00:00 ora_lg01_orcl12c2
</pre>
<p><strong>修改_max_outstanding_log_writes参数</strong><br />
通过修改_max_outstanding_log_writes参数为4，发现lg进程数量也变为了4，证明_max_outstanding_log_writes进程决定lg进程数量</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; alter system set &quot;_max_outstanding_log_writes&quot;=4 ;     
alter system set &quot;_max_outstanding_log_writes&quot;=4
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL&gt; alter system set &quot;_max_outstanding_log_writes&quot;=4 scope=spfile;

System altered.

SQL&gt; shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; startup
ORACLE instance started.

Total System Global Area 2516582400 bytes
Fixed Size                  8260048 bytes
Variable Size             671090224 bytes
Database Buffers         1828716544 bytes
Redo Buffers                8515584 bytes
Database mounted.
Database opened.
SQL&gt; exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.0.3 - 64bit Production
[oracle@ora1221 ~]$ ps -ef|grep lg
oracle    72339      1  0 13:45 ?        00:00:00 ora_lgwr_orcl12c2
oracle    72343      1  0 13:45 ?        00:00:00 ora_lg00_orcl12c2
oracle    72347      1  0 13:45 ?        00:00:00 ora_lg01_orcl12c2
oracle    72351      1  0 13:45 ?        00:00:00 ora_lg02_orcl12c2
oracle    72359      1  0 13:45 ?        00:00:00 ora_lg03_orcl12c2
</pre>
<p><strong>修改_use_single_log_writer参数</strong><br />
通过测试_use_single_log_writer参数修改，我们可以确定_use_single_log_writer修改为true后，数据库恢复到12c之前的lgwr管理方式</p>
<pre class="brush: sql; title: ; notranslate">
[oracle@ora1221 ~]$ ss

SQL*Plus: Release 12.2.0.0.3 Production on Thu Aug 6 13:45:33 2015

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.0.3 - 64bit Production

SQL&gt; alter system set &quot;_use_single_log_writer&quot;=1 ;     
alter system set &quot;_use_single_log_writer&quot;=1
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL&gt;  alter system set &quot;_use_single_log_writer&quot;=1 scope=spfile;
 alter system set &quot;_use_single_log_writer&quot;=1 scope=spfile
*
ERROR at line 1:
ORA-00096: invalid value 1 for parameter _use_single_log_writer, must be from
among ADAPTIVE, FALSE, TRUE


SQL&gt; alter system set &quot;_use_single_log_writer&quot;=TRUE scope=spfile;

System altered.

SQL&gt; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.0.3 - 64bit Production
[oracle@ora1221 ~]$ ps -ef|grep lg
oracle    72702  71510  0 13:46 pts/0    00:00:00 grep lg
[oracle@ora1221 ~]$ ss

SQL*Plus: Release 12.2.0.0.3 Production on Thu Aug 6 13:46:50 2015

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL&gt; startup
ORACLE instance started.

Total System Global Area 2516582400 bytes
Fixed Size                  8260048 bytes
Variable Size             671090224 bytes
Database Buffers         1828716544 bytes
Redo Buffers                8515584 bytes
Database mounted.
Database opened.
SQL&gt; exit   
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.0.3 - 64bit Production
[oracle@ora1221 ~]$ ps -ef|grep lg
oracle    72754      1  0 13:46 ?        00:00:00 ora_lgwr_orcl12c2
oracle    73008  71510  0 13:47 pts/0    00:00:00 grep lg
</pre>
<p>从这里可以确定_use_single_log_writer确定是否启用SCALABLE LGWR(多个lg子进程),_max_outstanding_log_writes确定lg进程个数</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/oracle%e7%94%a8%e6%88%b7%e9%87%8d%e5%91%bd%e5%90%8d.html" rel="bookmark" class="crp_title">ORACLE用户重命名</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/dual-%e7%bc%ba%e5%b0%91%e5%90%8c%e4%b9%89%e8%af%8d%e8%a7%a3%e5%86%b3.html" rel="bookmark" class="crp_title">dual 缺少同义词故障解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/01/heatmap-segment-size-is-large.html" rel="bookmark" class="crp_title">sysaux中HEATMAP 对象较大</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/07/oracle-12c-undo-failure-recovery-root-pdb.html" rel="bookmark" class="crp_title">Oracle 12c undo异常处理&#8212;root pdb undo异常</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/01/%e5%85%b3%e4%ba%8ewallet%e5%8a%a0%e5%af%86%e7%9a%84%e5%87%a0%e4%b8%aa%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">关于wallet加密的几个测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/01/%e8%ae%be%e7%bd%ae_smu_debug_mode%e5%ae%9e%e7%8e%b0%e6%8c%87%e5%ae%9asession%e7%ba%a7%e5%88%ab%e4%bd%bf%e7%94%a8%e7%89%b9%e5%ae%9a%e5%9b%9e%e6%bb%9a%e6%ae%b5.html" rel="bookmark" class="crp_title">设置_smu_debug_mode实现指定session级别使用特定回滚段</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/02/ora-12754.html" rel="bookmark" class="crp_title">ORA-12754: Feature &#8216;startup&#8217; is disabled due to missing capability &#8216;Runtime Environment&#8217;</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/08/max_columns-4096.html" rel="bookmark" class="crp_title">Oracle 23ai 表和视图的列最多支持到4096个</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/05/oracle-12c-table-access-by-index-rowid-batched.html" rel="bookmark" class="crp_title">Oracle 12C TABLE ACCESS BY INDEX ROWID BATCHED</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/08/joxcsys-release-mismatch.html" rel="bookmark" class="crp_title">joxcsys: release mismatch, 19.0.0.0.0 1.8 in database (classes.bin)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/%e8%b7%b3%e8%bf%87obj%e5%9d%8f%e5%9d%97%e6%96%b9%e6%b3%95.html" rel="bookmark" class="crp_title">跳过obj$坏块方法</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/10/ora-65101-container-database-set-up-incorrectly.html" rel="bookmark" class="crp_title">ORA-65101 container database set up incorrectly</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2016/06/_use_single_log_writer%e5%92%8c_max_outstanding_log_writes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
