How to Determine the Number of Attachments in My Confluence Instance

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

How to Find the Number of Attachments in Confluence

DB level count:

To query the database for attachments, run this SQL:

アトラシアン サポートの提供について

The following SQL query is outside the scope of Atlassian Support Offerings and is provided for general guidance only.

-- To get the number of attachments in a space
select count(*) as "number of attachments", SPACES.SPACENAME from CONTENT
join SPACES on CONTENT.SPACEID = SPACES.SPACEID
where contenttype='ATTACHMENT' and spacename='<insert spacename here>'
and prevver is null
and content_status='current' 
group by SPACES.SPACENAME
Confluence 5.7 以降
-- To get a count of current attachment versions only
select count(*) from content where contenttype = 'ATTACHMENT' and prevver is null;
 
-- To get a count of all attachment versions
select count(*) from content where contenttype = 'ATTACHMENT';
For Confluence 5.6 and below
-- To get a count of current attachment versions only
select count(*) from attachments a join content c on a.pageid = c.contentid where c.prevver is null and a.prevver is null;
 
-- To get a count of all attachment versions
select count(*) from attachments;


File System count:
Linux の場合
find pathtoattachments -type f | awk -F'/' '{print $(NF-1)}' | wc -l
Last modified on Mar 21, 2024

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.