Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a SQL query to find out the number of spaces, the number of pages in each of those spaces

Central1 Admin Douglas Phan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 27, 2020

I'm looking to an MS SQL Query to find out the Spaces we have, how pages each of those spaces have and the number of attachments it has.

2 answers

0 votes
JimmyVanAU
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2020

Hi there,

Be careful as Nic says. There are a number of Atlassian KB docs which can guide you:

https://confluence.atlassian.com/confkb/how-to-find-the-total-amount-of-space-used-for-a-single-space-s-attachments-229839506.html

https://confluence.atlassian.com/confkb/how-to-get-more-statistical-data-disk-space-contents-created-from-confluence-s-usage-830284173.html

Once again, be careful, and do your best to run on a database clone or non-production instance.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2020

This is the sort of SQL that could kill your database (not damage it, but the nested searches you'd need to do could rapidly overwhelm it)

I'd strongly recommend writing a user macro to do this instead, as you can (sort of) get directly into the API, which will not overload your database and can get to the answers a lot quicker.

Central1 Admin Douglas Phan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2020

Hi Nic,

 

Are there any guides relating to creating a user macro to get this report data?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2020

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events