?
Solved

sybase-How to check BLOB size

Posted on 2012-09-11
4
Medium Priority
?
1,076 Views
Last Modified: 2012-10-18
I have one question about how to check blob db size, not sure how to check this ?
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 38424656
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
 

Author Comment

by:motioneye
ID: 38449806
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
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 2000 total points
ID: 38450248
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
 
LVL 24

Assisted Solution

by:Joe Woodhouse
Joe Woodhouse earned 2000 total points
ID: 38458346
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

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"Any files you do not have backed up in at least two [other] places are files you do not care about."
I originally wrote this article to compare SARDU and YUMI, but have now added Easy2Boot, since that is the one I currently use and find the easiest to create and alter.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question