martes, 21 de febrero de 2012

Conocer el tamaño y la cantidad de documentos de una content database

 

Ejecutar la siguiente consulta contra la content database deseada:

--"count" and "size" of all docs in your SP2010 contend DB
--run script against your SharePoint 2010 wss_Content..... db
SELECT
COUNT(*) AS 'Count',
(SUM(CONVERT(bigint,Size))/1024) AS 'Size in kbyte',
((SUM(Size)/1024)/COUNT(*)) AS 'AVG Size per Doc. in kbyte'
from dbo.AllDocs WITH(NOLOCK)
WHERE ID IN
(
SELECT tp_DocID FROM dbo.AllUserData WITH(NOLOCK)--comment this clause out if you also want include the SP systemfiles
)
AND Size is NOT NULL
AND Extension != '000'
--"count" and "size" of all docs in your SP2010 contend DB group by fileextension
--run script against your SharePoint 2010 wss_Content..... db
SELECT
COUNT(ID) AS 'Count',
(SUM(CONVERT(bigint,Size))/1024) AS 'Size in kbyte', --covert because of an "int" overflowrisk in a lager db
Extension AS 'Filetype',
((SUM(Size)/1024)/COUNT(*)) AS 'AVG Size per Doc. in kbyte'
from dbo.AllDocs WITH(NOLOCK)
WHERE ID IN
(
SELECT tp_DocID FROM dbo.AllUserData WITH(NOLOCK) --comment this clause out if you also want include the SP systemfiles
)
AND Size is NOT NULL
AND Extension != '000'
GROUP BY
Extension
ORDER BY 'Size in kbyte' DESC



 


Fuente:


https://www.nothingbutsharepoint.com/sites/itpro/Pages/COUNT-and-SIZE-of-all-your-documents-in-SharePoint-2010.aspx

No hay comentarios:

Publicar un comentario