<?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>databázové štatistiky &#8211; ArcGEO Information systems s.r.o.</title>
	<atom:link href="https://www.arcgeo.sk/tag/databazove-statistiky/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.arcgeo.sk</link>
	<description>GIS riešenia</description>
	<lastBuildDate>Tue, 24 Sep 2024 13:24:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.12</generator>
	<item>
		<title>Aktualizácia štatistík a prebudovanie indexov pre vybrané tabuľky v SQL Server</title>
		<link>https://www.arcgeo.sk/sql-server-aktualizacia-statistik/</link>
		
		<dc:creator><![CDATA[Peter Nemec]]></dc:creator>
		<pubDate>Wed, 22 Nov 2017 15:58:41 +0000</pubDate>
				<category><![CDATA[Tipy]]></category>
		<category><![CDATA[databázové štatistiky]]></category>
		<category><![CDATA[prebudovanie indexov]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[výkon]]></category>
		<guid isPermaLink="false">http://www.arcgeo.sk/?p=3231</guid>

					<description><![CDATA[<p>Aktualizácia štatistík a prebudovanie indexov pre vybrané tabuľky v SQL Server V prostrediach geodatabáz, kde dochádza k intenzívnej editácii údajov, je potrebné pravidelne aktualizovať databázové štatistiky a prebudovať indexy. Upozornenie: Prebudovanie indexov je prostredí SQL Serveru náročná operácia, ktorá má vplyv na prácu používateľov a preto ju vykonávajte len v čase odstávky systému. V&#160;príklade je &#160;&#160; [...] </p>
<div class="read-more"><a href="https://www.arcgeo.sk/sql-server-aktualizacia-statistik/">Viac podrobností <i class="fa fa-angle-double-right "></i></a></div>
<p>The post <a rel="nofollow" href="https://www.arcgeo.sk/sql-server-aktualizacia-statistik/">Aktualizácia štatistík a prebudovanie indexov pre vybrané tabuľky v SQL Server</a> appeared first on <a rel="nofollow" href="https://www.arcgeo.sk">ArcGEO Information systems s.r.o.</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class='infinite-row np'>
<div class='container'><div class="row spacing"><div class="col-md-12">
<h1>Aktualizácia štatistík a prebudovanie indexov pre vybrané tabuľky v SQL Server</h1>
<p>V prostrediach geodatabáz, kde dochádza k intenzívnej editácii údajov, je potrebné pravidelne aktualizovať databázové štatistiky a prebudovať indexy.</p>
<p><strong>Upozornenie</strong>:</p>
<ul>
<li>Prebudovanie indexov je prostredí SQL Serveru náročná operácia, ktorá má vplyv na prácu používateľov a preto ju vykonávajte len v čase odstávky systému.</li>
<li>V&nbsp;príklade je prebudovanie indexov zakomentované, pretože môže blokovať prácu používateľov.</li>
<li>Aktualizácia štatistík je v&nbsp;našom prípade zámerne nastavená iba pre A&nbsp;a&nbsp;D tabuľky (Delta tabuľky)&nbsp; a tiež SDE STATES tabuľky.</li>
</ul>
<p>Procedúra pre SQL Server, ktorá prebuduje indexy a&nbsp;tiež aktualizuje štatistiky nad tabuľkami:</p>
<pre><em>use &lt;nazov databazy&gt;</em>

<em>-- Rebuild indexes on tables for all owners in the table registry</em>
<em>-- ***************************************************************</em>
<em>--&nbsp; Run under the DB that holds the SDE Schema tables.</em>
<em>--&nbsp; If the sde schema is owned by dbo then you will need to change:</em>
<em>--&nbsp; select distinct owner from sde.sde_table_registry</em>
<em>--&nbsp; to</em>
<em>--&nbsp; select distinct owner from dbo.sde_table_registry</em>

<em>Declare @OwnerName varchar(50)</em>
<em>Declare @TableName varchar(50)</em>
<em>Declare @QualifiedName varchar(100)</em>

<em>Declare OwnerCursor cursor for </em>
<em>select distinct owner from sde.SDE_table_registry</em>
<em>open OwnerCursor</em>

<em>Fetch OwnerCursor into @OwnerName</em>
<em>while (@@fetch_status=0) </em>
<em>begin</em>

<em>Declare TableCursor cursor for</em>
<em>-- Get all the tables for this user</em>
<em>select so.name from sysobjects so join sysusers su on so.uid = su.uid&nbsp; where type = 'U' and (so.name like 'A[0-9]%' or so.name like 'D[0-9]%' or so.name in ('sde_states','sde_state_lineages')) and su.name = @OwnerName</em>
<em>open TableCursor</em>
<em>Fetch TableCursor into @TableName</em>
<em>while (@@fetch_status=0) </em>
<em>&nbsp;begin</em>
<em>&nbsp; set @QualifiedName = @OwnerName + '.' + @TableName</em>
<em>&nbsp; --print 'Rebilding indexes on&nbsp; : ' + @QualifiedName</em>
<em>&nbsp; --dbcc dbreindex(@QualifiedName) WITH NO_INFOMSGS</em>
<em>&nbsp; print 'Updating Statistics on: ' + @QualifiedName</em>
<em>&nbsp; EXEC ('UPDATE STATISTICS ' + @QualifiedName )</em>
<em>&nbsp; print ''</em>
<em>&nbsp; Fetch TableCursor into @TableName</em>
<em>end</em>
<em>Fetch OwnerCursor into @OwnerName</em>
<em>close TableCursor</em>
<em>Deallocate TableCursor</em>
<em>end</em>
<em>close OwnerCursor</em>
<em>Deallocate OwnerCursor</em>

<em>go</em></pre>
<p>Zdroj: <a href="http://support.esri.com/en/technical-article/000006051" target="_blank" rel="noopener">support.esri.com/en/technical-article/000006051</a></div></div></div>
</div>
<p>The post <a rel="nofollow" href="https://www.arcgeo.sk/sql-server-aktualizacia-statistik/">Aktualizácia štatistík a prebudovanie indexov pre vybrané tabuľky v SQL Server</a> appeared first on <a rel="nofollow" href="https://www.arcgeo.sk">ArcGEO Information systems s.r.o.</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
