• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1182
  • Last Modified:

sybase-How to check BLOB size

I have one question about how to check blob db size, not sure how to check this ?
0
motioneye
Asked:
motioneye
  • 3
2 Solutions
 
Joe WoodhousePrincipal ConsultantCommented:
Tell us more about what you're trying to do here...?

Do you want to know how big one particular BLOB in one row is? How much space is used for all BLOBs in one table? In the whole database?
0
 
motioneyeAuthor Commented:
Hi,
I want to know how much space is used for all BLOB in one table or how much space used by BLOB in all tables within database.
0
 
Joe WoodhousePrincipal ConsultantCommented:
Well, those are two separate questions. :)

For the first, run

     exec sp_spaceused [table], 1
     go

This will give you a breakdown of the space for each index as well. BLOBs are stored as indid (index id) 255. The column you want is the "reserved" column as this much space has been taken from the database and is not available for anything else.

The second takes more work, I'll come back to you later with this.
0
 
Joe WoodhousePrincipal ConsultantCommented:
Does this answer have to be entirely in SQL? If so, you'll need to use the data_length column, and write some dynamic SQL to figure out which columns in which tables it needs to be run on.

If you can run this (say) in a shell script, you could run a whole pile of sp_spaceused commands as above, and detect when it is for indid 255, and sum the reserved column of those lines. Slower but easier to code.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now