Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sybase-How to check BLOB size

Posted on 2012-09-11
4
Medium Priority
?
1,107 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

618 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