I think this is what you are looking for to see pages. https://confluence.atlassian.com/confkb/how-to-obtain-a-list-of-all-pages-their-authors-and-related-information-from-the-confluence-database-968687591.html
Attachment information is stored in the content table as well so you will just need to change the contenttype = 'ATTACHMENT'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.