<?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>Le blog de SQLpro &#187; stockage</title>
	<atom:link href="https://blog.developpez.com/sqlpro/ptag/stockage/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/sqlpro</link>
	<description>Le SQL pour SQL Server, PostGreSQL et tous les autres SGBDR</description>
	<lastBuildDate>Thu, 15 Oct 2020 12:59:17 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Métrique de volumétrie du stockage par table, index et partition</title>
		<link>https://blog.developpez.com/sqlpro/p13171/ms-sql-server/metrique-de-volumetrie-du-stockage-par-table-index-et-partition</link>
		<comments>https://blog.developpez.com/sqlpro/p13171/ms-sql-server/metrique-de-volumetrie-du-stockage-par-table-index-et-partition#comments</comments>
		<pubDate>Wed, 07 Feb 2018 09:19:04 +0000</pubDate>
		<dc:creator><![CDATA[SQLpro]]></dc:creator>
				<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SQL Server 2014]]></category>
		<category><![CDATA[SQL Server 2016]]></category>
		<category><![CDATA[SQL Server 2017]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[métrique]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[SQL server]]></category>
		<category><![CDATA[stockage]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/sqlpro/?p=789</guid>
		<description><![CDATA[Voici une petite requête complémentaire pour mesurer les volumes stockées par partition, index et tables d&#8217;une base : SELECT s.name AS TABLE_SCHEMA, o.name AS TABLE_NAME, i.name AS INDEX_NAME, &#160; &#160; &#160; &#160;fs.name AS FILEGROUP_NAME, f.name AS FILE_NAME, f.physical_name, p.partition_number, &#160; &#160; &#160; &#160;p.ROWS, p.data_compression_desc, au.total_pages * 8 AS SIZE_TOTAL_KO, &#160; &#160; &#160; &#160;SUM&#40;au.total_pages * 8&#41; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Voici une petite requête complémentaire pour mesurer les volumes stockées par partition, index et tables d&rsquo;une base :<br />
<span id="more-789"></span></p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> s<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> TABLE_SCHEMA<span style="color: #66cc66;">,</span> o<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span><span style="color: #66cc66;">,</span> i<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> INDEX_NAME<span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;fs<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> FILEGROUP_NAME<span style="color: #66cc66;">,</span> f<span style="color: #66cc66;">.</span>name <span style="color: #993333; font-weight: bold;">AS</span> FILE_NAME<span style="color: #66cc66;">,</span> f<span style="color: #66cc66;">.</span>physical_name<span style="color: #66cc66;">,</span> p<span style="color: #66cc66;">.</span>partition_number<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;p<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">ROWS</span><span style="color: #66cc66;">,</span> p<span style="color: #66cc66;">.</span>data_compression_desc<span style="color: #66cc66;">,</span> au<span style="color: #66cc66;">.</span>total_pages <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">8</span> <span style="color: #993333; font-weight: bold;">AS</span> SIZE_TOTAL_KO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>au<span style="color: #66cc66;">.</span>total_pages <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">OVER</span><span style="color: #66cc66;">&#40;</span>PARTITION <span style="color: #993333; font-weight: bold;">BY</span> i<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">,</span> s<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">,</span> o<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> SIZE_TOTAL_INDEX_KO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>au<span style="color: #66cc66;">.</span>total_pages <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">OVER</span><span style="color: #66cc66;">&#40;</span>PARTITION <span style="color: #993333; font-weight: bold;">BY</span> s<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">,</span> o<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> SIZE_TOTAL_TABLE_KO<br />
<span style="color: #993333; font-weight: bold;">FROM</span> &nbsp; sys<span style="color: #66cc66;">.</span>partitions <span style="color: #993333; font-weight: bold;">AS</span> p<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>allocation_units <span style="color: #993333; font-weight: bold;">AS</span> au<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>hobt_id <span style="color: #66cc66;">=</span> au<span style="color: #66cc66;">.</span>container_id<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>filegroups <span style="color: #993333; font-weight: bold;">AS</span> fs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ON</span> au<span style="color: #66cc66;">.</span>data_space_id <span style="color: #66cc66;">=</span> fs<span style="color: #66cc66;">.</span>data_space_id<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>database_files <span style="color: #993333; font-weight: bold;">AS</span> f<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ON</span> fs<span style="color: #66cc66;">.</span>data_space_id <span style="color: #66cc66;">=</span> f<span style="color: #66cc66;">.</span>file_id<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>objects <span style="color: #993333; font-weight: bold;">AS</span> o<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>object_id <span style="color: #66cc66;">=</span> o<span style="color: #66cc66;">.</span>object_id<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>schemas <span style="color: #993333; font-weight: bold;">AS</span> s <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ON</span> o<span style="color: #66cc66;">.</span>schema_id <span style="color: #66cc66;">=</span> s<span style="color: #66cc66;">.</span>schema_id<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>indexes <span style="color: #993333; font-weight: bold;">AS</span> i<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>object_id <span style="color: #66cc66;">=</span> i<span style="color: #66cc66;">.</span>object_id <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AND</span> p<span style="color: #66cc66;">.</span>index_id <span style="color: #66cc66;">=</span> i<span style="color: #66cc66;">.</span>index_id;</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Frédéric Brouard, alias SQLpro, ARCHITECTE DE DONNÉES<br />
Expert &nbsp;S.G.B.D &nbsp;relationnelles &nbsp; et &nbsp; langage &nbsp;S.Q.L<br />
Moste &nbsp;Valuable &nbsp;Professionnal &nbsp;Microsoft &nbsp;SQL Server<br />
Société SQLspot &nbsp;: &nbsp;modélisation, conseil, formation,<br />
optimisation, &nbsp;audit, &nbsp;tuning, &nbsp;administration &nbsp;SGBDR<br />
Enseignant: CNAM PACA, ISEN Toulon, CESI Aix en Prov.</div></div>
<p>L&rsquo;entreprise <a href="http://www.sqlspot.com">SQL Spot</a><br />
<strong>Le site web sur le </strong><a href="http://sqlpro.developpez.com/">SQL et les SGBDR</a></p>
<p><img src="http://blog.developpez.com/media/Microsoft_MVP_logo_vertical Brouard 400.jpg" width="400" height="135" alt="MVP Microsoft SQL
Server" /></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Métriques du stockage de vos bases</title>
		<link>https://blog.developpez.com/sqlpro/p12910/ms-sql-server/metriques-du-stockage-de-vos-bases</link>
		<comments>https://blog.developpez.com/sqlpro/p12910/ms-sql-server/metriques-du-stockage-de-vos-bases#comments</comments>
		<pubDate>Sun, 04 Oct 2015 10:19:41 +0000</pubDate>
		<dc:creator><![CDATA[SQLpro]]></dc:creator>
				<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SQL Server 2014]]></category>
		<category><![CDATA[SQL Server 2016]]></category>
		<category><![CDATA[capacity planning]]></category>
		<category><![CDATA[dimensionnement]]></category>
		<category><![CDATA[disques]]></category>
		<category><![CDATA[données]]></category>
		<category><![CDATA[fichiers]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[SQL server]]></category>
		<category><![CDATA[stockage]]></category>
		<category><![CDATA[transactions]]></category>
		<category><![CDATA[volume]]></category>
		<category><![CDATA[volumétrie]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/sqlpro/?p=608</guid>
		<description><![CDATA[Il est important pour un DBA de vérifier régulièrement le stockage de ses bases et anticiper sur les volumes afin de ne jamais avoir d&#8217;opérations de croissance qui pénalise fortement les performances (capacity planning). Pour cela il est nécessaire de vérifier régulièrement l&#8217;adéquation des &#171;&#160;enveloppes&#160;&#187; du stockage et du volume qui y figure afin de [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Il est important pour un DBA de vérifier régulièrement le stockage de ses bases et anticiper sur les volumes afin de ne jamais avoir d&rsquo;opérations de croissance qui pénalise fortement les performances (<em>capacity planning</em>). Pour cela il est nécessaire de vérifier régulièrement l&rsquo;adéquation des &laquo;&nbsp;enveloppes&nbsp;&raquo; du stockage et du volume qui y figure afin de réagir avant qu&rsquo;une croissance automatique ait lieu.<br />
<span id="more-608"></span><br />
Pour ce faire vous devez mesurer régulièrement les volumes des fichiers, des données (tables et index) des transactions et réajuster les tailles de fichiers.<br />
Voici une procédure qui vous donne ces métriques.</p>
<p><strong>LA PROCÉDURE :</strong></p>
<div class="codecolorer-container sql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">USE</span> master;<br />
<span style="color: #993333; font-weight: bold;">GO</span><br />
<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">PROCEDURE</span> dbo<span style="color: #66cc66;">.</span>sp__METRIQUE_STOCKAGE @REAJUSTE BIT <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><br />
<span style="color: #993333; font-weight: bold;">AS</span><br />
<span style="color: #993333; font-weight: bold;">SET</span> NOCOUNT <span style="color: #993333; font-weight: bold;">ON</span>;<br />
<br />
<span style="color: #993333; font-weight: bold;">IF</span> @REAJUSTE <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span><br />
<span style="color: #808080; font-style: italic;">--&gt; réajustement des statistiques des espaces de stockage</span><br />
&nbsp; &nbsp;DBCC UPDATEUSAGE <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">--&gt; volume des transactions</span><br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @T <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #66cc66;">&#40;</span>database_name sysname<span style="color: #66cc66;">,</span> log_size_mb <span style="color: #993333; font-weight: bold;">FLOAT</span><span style="color: #66cc66;">,</span> log_space_used_percent <span style="color: #993333; font-weight: bold;">FLOAT</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">STATUS</span> bit<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @TRANSACTIONS_RESERVEES_MO <span style="color: #993333; font-weight: bold;">BIGINT</span><span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; @TRANSACTIONS_UTILISEES_MO <span style="color: #993333; font-weight: bold;">BIGINT</span><span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; @TRANSACTIONS_UTILISEES_POURCENT <span style="color: #993333; font-weight: bold;">DECIMAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> @T<br />
<span style="color: #993333; font-weight: bold;">EXEC</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'DBCC SQLPERF(LOGSPACE)'</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @TRANSACTIONS_RESERVEES_MO <span style="color: #66cc66;">=</span> ROUND<span style="color: #66cc66;">&#40;</span>log_size_mb<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;@TRANSACTIONS_UTILISEES_MO <span style="color: #66cc66;">=</span> ROUND<span style="color: #66cc66;">&#40;</span>log_size_mb <span style="color: #66cc66;">*</span> log_space_used_percent <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">100.0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;@TRANSACTIONS_UTILISEES_POURCENT <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>log_space_used_percent <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">DECIMAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span> @T <span style="color: #993333; font-weight: bold;">WHERE</span> database_name <span style="color: #66cc66;">=</span> DB_NAME<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">-- taille de l'enveloppe de stockage :</span><br />
<span style="color: #993333; font-weight: bold;">WITH</span> <br />
T_FILES <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>ROUND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">CASE</span> <span style="color: #993333; font-weight: bold;">WHEN</span> <span style="color: #ff0000;">&quot;type&quot;</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">THEN</span> <span style="color: #993333; font-weight: bold;">SIZE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">END</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">128.0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">BIGINT</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> TRANSACTIONS_RESERVEES_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>ROUND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">CASE</span> <span style="color: #993333; font-weight: bold;">WHEN</span> <span style="color: #ff0000;">&quot;type&quot;</span> !<span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">THEN</span> <span style="color: #993333; font-weight: bold;">SIZE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">END</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">128.0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">BIGINT</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> DONNEES_RESERVE_MO<br />
<span style="color: #993333; font-weight: bold;">FROM</span> &nbsp; sys<span style="color: #66cc66;">.</span>database_files<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><br />
T_DB <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#40;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> TRANSACTIONS_RESERVEES_MO <span style="color: #66cc66;">+</span> DONNEES_RESERVE_MO <span style="color: #993333; font-weight: bold;">AS</span> BASE_TAILLE_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;DONNEES_RESERVE_MO<span style="color: #66cc66;">,</span> TRANSACTIONS_RESERVEES_MO<br />
<span style="color: #993333; font-weight: bold;">FROM</span> &nbsp; T_FILES<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> &nbsp; <br />
T_PAGES <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#40;</span><br />
<span style="color: #808080; font-style: italic;">-- taille des pages données et index &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>ROUND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span>au<span style="color: #66cc66;">.</span>used_pages<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">128.0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">BIGINT</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> DONNEES_UTILISEES_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>ROUND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SUM</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">CASE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">WHEN</span> it<span style="color: #66cc66;">.</span>internal_type <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">202</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">204</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">211</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">212</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">213</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">214</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">215</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">216</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">THEN</span> <span style="color: #cc66cc;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">WHEN</span> au<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TYPE</span> !<span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">THEN</span> au<span style="color: #66cc66;">.</span>used_pages<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">WHEN</span> p<span style="color: #66cc66;">.</span>index_id <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">2</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">THEN</span> au<span style="color: #66cc66;">.</span>data_pages<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">ELSE</span> <span style="color: #cc66cc;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">END</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">128.0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">BIGINT</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> TABLES_MO<br />
<span style="color: #993333; font-weight: bold;">FROM</span> &nbsp; sys<span style="color: #66cc66;">.</span>partitions <span style="color: #993333; font-weight: bold;">AS</span> p <br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>allocation_units au <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>partition_id <span style="color: #66cc66;">=</span> au<span style="color: #66cc66;">.</span>container_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">OUTER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> sys<span style="color: #66cc66;">.</span>internal_tables <span style="color: #993333; font-weight: bold;">AS</span> it <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">ON</span> p<span style="color: #66cc66;">.</span>object_id <span style="color: #66cc66;">=</span> it<span style="color: #66cc66;">.</span>object_id<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> BASE_TAILLE_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;DONNEES_RESERVE_MO<span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;DONNEES_UTILISEES_MO<span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100.0</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span> DONNEES_UTILISEES_MO <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">FLOAT</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">/</span> DONNEES_RESERVE_MO <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">DECIMAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> DONNEES_UTILISEES_POURCENT<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;TABLES_MO<span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;DONNEES_UTILISEES_MO <span style="color: #66cc66;">-</span> TABLES_MO <span style="color: #993333; font-weight: bold;">AS</span> INDEX_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100.0</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span> TABLES_MO <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">FLOAT</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">/</span> DONNEES_UTILISEES_MO <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">DECIMAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> TABLES_POURCENT <span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100.0</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span> DONNEES_UTILISEES_MO <span style="color: #66cc66;">-</span> TABLES_MO <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">FLOAT</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">/</span> DONNEES_UTILISEES_MO <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">DECIMAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> INDEX_POURCENT<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;TRANSACTIONS_RESERVEES_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;@TRANSACTIONS_UTILISEES_MO <span style="color: #993333; font-weight: bold;">AS</span> TRANSACTIONS_UTILISEES_MO<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;@TRANSACTIONS_UTILISEES_POURCENT <span style="color: #993333; font-weight: bold;">AS</span> TRANSACTIONS_UTILISEES_POURCENT<br />
<span style="color: #993333; font-weight: bold;">FROM</span> &nbsp; T_PAGES <span style="color: #993333; font-weight: bold;">CROSS</span> <span style="color: #993333; font-weight: bold;">JOIN</span> &nbsp;T_DB;<br />
<span style="color: #993333; font-weight: bold;">GO</span></div></div>
<p>Pour pouvoir l&#039;exécuter de n&#039;importe quelle base, nous pouvons la marquer comme procédure système :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">EXEC sp_MS_marksystemobject 'sp__METRIQUE_STOCKAGE';<br />
GO</div></div>
<p>Les métriques fournies par cette procédure sont les suivantes :<br />
BASE_TAILLE_MO : taille globale de la base y compris transactions<br />
DONNEES_RESERVE_MO : taille réservée pour les données de la base<br />
DONNEES_UTILISEES_MO : volume effectif des données de la base (tables et index)<br />
<strong>DONNEES_UTILISEES_POURCENT : taux de remplissage des données dans les fichiers de la base</strong><br />
TABLES_MO : volume des données des tables (à titre indicatif)<br />
INDEX_MO : volume des index (à titre indicatif)<br />
TABLES_POURCENT : proportion du volume des tables en %  (à titre indicatif)<br />
INDEX_POURCENT : proportion du volume des index en %  (à titre indicatif)<br />
TRANSACTIONS_RESERVEES_MO : taille réservée pour le journal de transaction de la base<br />
TRANSACTIONS_UTILISEES_MO : volume effectif des transactions de la base<br />
<strong>TRANSACTIONS_UTILISEES_POURCENT : taux de remplissage des transactions dans les fichiers de la base</strong></p>
<p>Les deux métriques les plus importantes sont indiquées en gras. C&rsquo;est sur celles-ci qu&rsquo;il faut réagir au plus vite en redimensionnant les fichiers ou en rajoutant de nouveaux fichiers&#8230;<br />
Il est d&rsquo;usage de se poser des questions lorsque les taux de remplissage dépasse 70%, de planifier la croissance à 80 et d&rsquo;agir impérativement à 90%.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Frédéric Brouard, alias SQLpro, ARCHITECTE DE DONNÉES<br />
Expert &nbsp;S.G.B.D &nbsp;relationnelles &nbsp; et &nbsp; langage &nbsp;S.Q.L<br />
Moste &nbsp;Valuable &nbsp;Professionnal &nbsp;Microsoft &nbsp;SQL Server<br />
Société SQLspot &nbsp;: &nbsp;modélisation, conseil, formation,<br />
optimisation, &nbsp;audit, &nbsp;tuning, &nbsp;administration &nbsp;SGBDR<br />
Enseignant: CNAM PACA, ISEN Toulon, CESI Aix en Prov.</div></div>
<div id="attachment_590" style="width: 548px" class="wp-caption alignnone"><a href="http://blog.developpez.com/sqlpro/files/2015/09/Couverture-livre-SQL-server-Eyrolles.jpg"><img src="http://blog.developpez.com/sqlpro/files/2015/09/Couverture-livre-SQL-server-Eyrolles.jpg" alt="Développez et administrez pour la performance avec SQL Server 2014" width="538" height="652" class="size-full wp-image-590" /></a><p class="wp-caption-text">Développez et administrez pour la performance avec SQL Server 2014</p></div>
<p>L&rsquo;entreprise <a href="http://www.sqlspot.com">SQL Spot</a><br />
<strong>Le site web sur le </strong><a href="http://sqlpro.developpez.com/">SQL et les SGBDR</a></p>
<p><img src="http://blog.developpez.com/media/Microsoft_MVP_logo_vertical Brouard 400.jpg" width="400" height="135" alt="MVP Microsoft SQL
Server" /></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Où et comment sont stockées mes données avec PostGreSQL ?</title>
		<link>https://blog.developpez.com/sqlpro/p11821/bases-de-donnees/ou-et-comment-sont-stockees-mes-donnees-avec-postgresql</link>
		<comments>https://blog.developpez.com/sqlpro/p11821/bases-de-donnees/ou-et-comment-sont-stockees-mes-donnees-avec-postgresql#comments</comments>
		<pubDate>Thu, 07 Mar 2013 10:46:25 +0000</pubDate>
		<dc:creator><![CDATA[SQLpro]]></dc:creator>
				<category><![CDATA[bases de données]]></category>
		<category><![CDATA[PostGreSQL]]></category>
		<category><![CDATA[fichier]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[stockage]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/sqlpro/?p=261</guid>
		<description><![CDATA[Comme tous les SGBD relationnel, PostGreSQL stocke les données des tables et des index dans des fichiers organisés sous forme de pages. Que les données soient dans le cache (donc en mémoire vive), ou bien sur le disque, ces pages sont structurées d’une manière bien particulière afin d’exploiter au mieux les lectures et écritures physiques [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Comme tous les SGBD relationnel, PostGreSQL stocke les données des tables et des index dans des fichiers organisés sous forme de pages. Que les données soient dans le cache (donc en mémoire vive), ou bien sur le disque, ces pages sont structurées d’une manière bien particulière afin d’exploiter au mieux les lectures et écritures physiques et logiques ainsi que la gestion des versions de ligne.<br />
L&rsquo;ensemble des pages figurent dans des fichiers.<br />
Cet article a pour but de vous présenter comment et où PostGreSQL stocke les données et compare sa façon de faire aux autres SGBDR que sont Oracle et MS SQL Server.<br />
Mais contrairement à ses grands frères, PostGreSQL ne dispose pas d&rsquo;une gestion des espaces de stockage&#8230; Voyons ce que cela induit notamment sur le plan des performances et de la volumétrie.<br />
<span id="more-261"></span><br />
L&rsquo;étude est disponible sous format PDF à l&rsquo;URL suivante : <a href="http://blog.developpez.com/sqlpro/files/2013/03/Ou-sont-stockées-mes-données-avec-PostGreSQL.pdf">Ou sont stockées mes données avec PostGreSQL</a></p>
<p><strong>Le site web sur le </strong><a href="http://sqlpro.developpez.com/">SQL et les SGBDR</a></p>
<p><img src="http://blog.developpez.com/media/Microsoft_MVP_logo_vertical Brouard 400.jpg" width="400" height="135" alt="MVP Microsoft SQL Server" /></p>
<pre>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Frédéric Brouard, alias SQLpro, ARCHITECTE DE DONNÉES<br />
Expert &nbsp;S.G.B.D &nbsp;relationnelles &nbsp; et &nbsp; langage &nbsp;S.Q.L<br />
Moste &nbsp;Valuable &nbsp;Professionnal &nbsp;Microsoft &nbsp;SQL Server<br />
Société SQLspot &nbsp;: &nbsp;modélisation, conseil, formation,<br />
optimisation, &nbsp;audit, &nbsp;tuning, &nbsp;administration &nbsp;SGBDR<br />
Enseignant: CNAM PACA, ISEN Toulon, CESI Aix en Prov.</div></div>

</pre>
<p>L&rsquo;ntreprise <a href="http://www.sqlspot.com">SQL Spot</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
