<?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>Sybase数据库技术，数据库恢复专家 &#187; stack size</title>
	<atom:link href="http://www.dbainfo.net/tag/stack-size/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dbainfo.net</link>
	<description>提供Sybase ASE及Sybase SQL Anywhere数据库修复服务，电话：13811580958(微信)，QQ：289965371！We have many years of experience in recovering data from damanged Sybase devices. Contact us by Phone: +86 13811580958 Wechat: 13811580958 Email: 289965371@qq.com</description>
	<lastBuildDate>Sat, 14 Jun 2025 16:28:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>添加自动扩展时调整stack size的大小</title>
		<link>https://www.dbainfo.net/ase_db_extend_increase_stack_size_.htm</link>
		<comments>https://www.dbainfo.net/ase_db_extend_increase_stack_size_.htm#comments</comments>
		<pubDate>Mon, 24 Jan 2011 13:39:22 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[stack size]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=641</guid>
		<description><![CDATA[在为数据库配置自动扩展时，提示需要增加参数：stack size的大小。 执行下面的SQL语句，使得用户数据库pmdb的default段的阈值为：1000m sp_dbextend &#39;set&#39;,&#39;threshold&#39;,pmdb,&#39;default&#39;,&#39;1000m&#39; go 但是返回下面的错误： Msg 3626, Level 17, State 4: Server &#39;syb1503&#39;, Procedure &#39;sp_exec_SQL&#39;, Line 49: The transaction was aborted because it used too much stack space. Either use sp_configure to increase the stack size, or break the query into smaller pieces. spid: 27, suid: 1, hostname: LIUZHENFU, application name: isql Msg [...]]]></description>
			<content:encoded><![CDATA[<p>在为数据库配置自动扩展时，提示需要增加参数：stack size的大小。</p>
<p>执行下面的SQL语句，使得用户数据库pmdb的default段的阈值为：1000m</p>
<blockquote>
<p>sp_dbextend &#39;set&#39;,&#39;threshold&#39;,pmdb,&#39;default&#39;,&#39;1000m&#39;</p>
<p>go</p>
</blockquote>
<p>但是返回下面的错误：</p>
<p><strong>Msg 3626, Level 17, State 4:</strong><br />
	Server &#39;syb1503&#39;, Procedure &#39;sp_exec_SQL&#39;, Line 49:<br />
	The transaction was aborted because it used too much stack space. Either use<br />
	sp_configure to increase the stack size, or break the query into smaller pieces.<br />
	spid: 27, suid: 1, hostname: LIUZHENFU, application name: isql<br />
	<strong>Msg 19206, Level 16, State 1:</strong><br />
	Server &#39;syb1503&#39;, Procedure &#39;sp_exec_SQL&#39;, Line 53:<br />
	sp_dbxt_ins_db_seginfo: Execute immediate SQL failed. SQL statement is: insert<br />
	#syssegments(dbname, inserted_by, segment, name, status) select<br />
	&#39;pmdb&#39;,&#39;sp_dbxt_set_extend_db&#39;, segment, name, status from pmdb.dbo.syssegments<br />
	(return status = 1)</p>
<p><strong>那就按照提示做吧。 将stack size参数的大小配置为:130KB<br />
	</strong></p>
<blockquote>
<p><strong>sp_configure &quot;stack size&quot;,130000<br />
		go<br />
		</strong></p>
</blockquote>
<p>此参数：stack size是静态参数，需要重启ASE服务器。<span id="more-641"></span></p>
<p>重启后，再次执行为default设置阈值的命令，成功！</p>
<blockquote>
<p>use pmdb<br />
		go<br />
		sp_dbextend &#39;set&#39;,&#39;threshold&#39;,pmdb,&#39;default&#39;,&#39;1000m&#39;<br />
		go</p>
</blockquote>
<p>1&gt; use pmdb<br />
	2&gt; go<br />
	1&gt; sp_dbextend &#39;set&#39;,&#39;threshold&#39;,pmdb,&#39;default&#39;,&#39;1000m&#39;<br />
	2&gt; go<br />
	Adding threshold for segment &#39;default&#39; at &#39;64000&#39; pages.<br />
	DBCC execution completed. If DBCC printed error messages, contact a user with<br />
	System Administrator (SA) role.<br />
	(return status = 0)<br />
	1&gt; sp_dbextend &#39;listfull&#39;,&#39;database&#39;,pmdb<br />
	2&gt; go<br />
	&nbsp;name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; segment item&nbsp;&nbsp; value status&nbsp; comment<br />
	&nbsp;----------- ------- ------ ----- ------- -------------------------<br />
	&nbsp;server-wide (n/a)&nbsp;&nbsp; (n/a)&nbsp; (n/a) enabled set=&#39;Jan 13 2011&nbsp; 3:21PM&#39;<br />
	&nbsp;default&nbsp;&nbsp;&nbsp;&nbsp; (all)&nbsp;&nbsp; growby 10%&nbsp;&nbsp; enabled set=&#39;Jan 13 2011&nbsp; 3:21PM&#39;</p>
<p>	(1 row affected)<br />
	&nbsp;segment name&nbsp;&nbsp; free pages&nbsp;&nbsp; free pages (KB)&nbsp;&nbsp; threshold procedure<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; status<br />
	&nbsp;-------------- ------------ ----------------- ---------------------<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------------<br />
	&nbsp;default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 256000 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1024000 sp_dbxt_extend_db<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enabled<br />
	&nbsp;logsegment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 70360&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 281440 sp_thresholdaction<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; last-chance,enabled</p>
<p>	Msg 3606, Level 16, State 0:<br />
	Server &#39;syb1503&#39;, Procedure &#39;sp_dbxt_help_threshold&#39;, Line 142:<br />
	Arithmetic overflow occurred.<br />
	(return status = -6)</p>
<p>&nbsp;</p>
<p>关于错误3626，官方文档的解释如下：</p>
<p>At start-up, Adaptive Server allocates one stack for each configured user connection. These stacks are in contiguous areas of memory, with a guard area at the end of each stack. Adaptive Server periodically checks to determine whether the stack point for a user connection has entered the stack guard area adjacent to that connection&#39;s stack. Error 3626 occurs when this has happened.</p>
<p>Because Error 3626 occurs before any stack corruption, Adaptive Server does not shut down. Instead, it aborts the user process and rolls back any transactions that existed for that process.</p>
<p>An Adaptive Server process usually encounters this error for one of two reasons:</p>
<ul>
<li>
<p>The stack size is too small. The information placed on the stack is valid but its total size exceeds the specified stack size. This is often caused by a single, complex query which requires more than the average amount of stack space. Long <b>where</b> clauses, long <b>select</b> lists, and deeply nested stored procedures can contribute to this type of stack overflow and Error 3626.</p>
</li>
<li>
<p>An incorrectly handled error results in recursive calls which eventually fill the stack, regardless of its size.</p>
</li>
</ul>
<p>If this error occurs frequently, there is increased risk a process may overflow its stack area and corrupt another process&#39; stack. This situation will cause Adaptive Server to shutdown with the error:</p>
<pre>kernel:  *** Stack guardword corrupted.</pre>
<p>See <a href="http://manuals.sybase.com/onlinebooks/group-as/asg1250e/svrtsg/@ebt-link;pt=37994;lang=zh?target=%25N%15_53457_START_RESTART_N%25" target="_top">Stack Guardword Error</a> for more information.</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/ase_db_extend_increase_stack_size_.htm">https://www.dbainfo.net/ase_db_extend_increase_stack_size_.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/ase_db_extend_increase_stack_size_.htm">添加自动扩展时调整stack size的大小</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2010-10-24 -- <a href="https://www.dbainfo.net/sybase-ase-convert-function-style-date-time-format.htm" title="Sybase ASE convert函数中的style日期时间样式">Sybase ASE convert函数中的style日期时间样式</a> (0)</li><li>2013-04-02 -- <a href="https://www.dbainfo.net/ase-3rt-party-tools-illegal-chinese-words.htm" title="使用第三方工具访问ASE表时汉字乱码问题的解决方法">使用第三方工具访问ASE表时汉字乱码问题的解决方法</a> (1)</li><li>2010-08-05 -- <a href="https://www.dbainfo.net/sql-server-trace-flags.htm" title="SQL Server TRACE FLAGS">SQL Server TRACE FLAGS</a> (0)</li><li>2014-07-02 -- <a href="https://www.dbainfo.net/restore_delete_file_linux_ext3grep.htm" title="linux上使用ext3grep恢复误删除的文件">linux上使用ext3grep恢复误删除的文件</a> (0)</li><li>2011-03-19 -- <a href="https://www.dbainfo.net/ultrapower-sybase-dba-job-opportunity.htm" title="神州泰岳招聘sybase初、中、高级dba 3名">神州泰岳招聘sybase初、中、高级dba 3名</a> (0)</li><li>2015-03-08 -- <a href="https://www.dbainfo.net/sap-ase-cr-number-3.htm" title="SAP Adaptive Server Enterprise的所有已知BUG列表（3）">SAP Adaptive Server Enterprise的所有已知BUG列表（3）</a> (0)</li><li>2011-10-14 -- <a href="https://www.dbainfo.net/history-of-common-databases.htm" title="各数据库的发展历史">各数据库的发展历史</a> (0)</li><li>2010-08-07 -- <a href="https://www.dbainfo.net/sqlserver2000-dbcc-checkdb-error-8905.htm" title="sql server 2000 扩展盘区分配错误 error:8905 的问题解决">sql server 2000 扩展盘区分配错误 error:8905 的问题解决</a> (0)</li><li>2015-03-08 -- <a href="https://www.dbainfo.net/sap-asa-cr-number-4.htm" title="SAP SQL Anywhere的所有已知BUG列表（4）">SAP SQL Anywhere的所有已知BUG列表（4）</a> (0)</li><li>2010-12-22 -- <a href="https://www.dbainfo.net/pass-sybase-ase-certified-administrator-associate.htm" title="通过ASE认证考试Sybase Certified Adaptive Server Administrator Associate (Version 15.0)">通过ASE认证考试Sybase Certified Adaptive Server Administrator Associate (Version 15.0)</a> (6)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/ase_db_extend_increase_stack_size_.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
