473,769 Members | 5,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

blobs question

Hi,

the column "picture" in table emp_photo from sample db is defined as
blob(102400)
As a Blob type, the actual data should be stored separately from the
base table.
However, when i look at the table structure of emp_photo, the all data
are stored in same default "USERSPACE1 "

What is the normal way to design a table with blob column?
Should i just simply add a column with blob type or need to define one
more column (rowid) to reference actual data in other tablespace?

Thanks!

Nov 14 '05 #1
2 1615
ca*****@gmail.c om wrote:
Hi,

the column "picture" in table emp_photo from sample db is defined as
blob(102400)
As a Blob type, the actual data should be stored separately from the
base table.
However, when i look at the table structure of emp_photo, the all data
are stored in same default "USERSPACE1 "

What is the normal way to design a table with blob column?
That depends on your requirements. You can keep the LOBs together with the
primary data in the same tablespace, or you can place it separately. If
you are using raw devices for the primary data, the recommendation is to
place LOBs in a separate tablespace that is file system based so that you
can take advantage of the operating system's file system cache for the
LOBs.
Should i just simply add a column with blob type or need to define one
more column (rowid) to reference actual data in other tablespace?


There is a difference between tablespaces and tables. If you create a table
in a DMS tablespace (managed by database), then you have the option to
place LOB data from all tables in that tablespace in a separate LONG
tablespace. There is nothing on the table-level that you should adjust
(like your suggestion to vertically partition the table).

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 15 '05 #2
That's because you are definng the table in an SMS tblspc.
When you look in its container, you'll see most likely 4 files.
SQL0000x.DAT, SQL0000x.INX, SQL0000x.LB,SQL 0000x.LBA
The x is the file and table id, DAT is the 4k page data which has a column
for LOB which points to the lov=cation of the LOB in the .LB file, the .LBA
is also used to manage LOB storage.
So, yes, the LOBs are stored in a separate file from the actual data.

Now, if you want to store the LOBs in a separate tblspc. that the data,
you'll have to use DMS tablespace and read Knut's answer to your question.
HTH, Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
<ca*****@gmail. com> a écrit dans le message de news:
11************* ********@g43g20 00...legro ups.com...
Hi,

the column "picture" in table emp_photo from sample db is defined as
blob(102400)
As a Blob type, the actual data should be stored separately from the
base table.
However, when i look at the table structure of emp_photo, the all data
are stored in same default "USERSPACE1 "

What is the normal way to design a table with blob column?
Should i just simply add a column with blob type or need to define one
more column (rowid) to reference actual data in other tablespace?

Thanks!


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3362
by: Kirby Urner | last post by:
I've been testing the Cookbook example 8.6 (2002 edition) re using cPickle to insert and retrieve BLOBs from mySQL, using Python's MySQLdb module. When I try to cPickle.loads(blob), I get an error telling me that loads wants a string, not type array.array. So I go cPickle.loads(blob.tostring()) instead and it works. My question is: has something changed in the Python API since this example was written?
0
2889
by: Ole Hansen | last post by:
Hi, Is it at all possible to insert BLOBs using the Array Interface? Today I have an application using the array interface. It works fine but so far I haven't been using BLOBs. I insert 100-200 rows in one server round trip. Now I want to have one or more colums of type BLOB but I cant see how this can fit into my current application.
12
5337
by: Ryan Stewart | last post by:
I am in extremely urgent need (by tomorrow) of a way to store files in and retrieve files from an Oracle database using TopLink as an intermediary. I have the JSPs for it, and it works for small files, but larger ones like Word documents and Excel Spreadsheets give an error saying that the data is too large for the field. Can anyone help with this? Our file object has a fileData field which is an array of bytes which is mapped in TopLink to...
6
1579
by: Marcus | last post by:
Hi all, Quick question... I am storing jpegs as blobs in a mysql table, which is fine on my live server because I am just uploading them using phpmyadmin (I am working with a small number of images that will rarely change and thus do not have a need for an upload script). My problem is I do all my testing on my local host where I do not have phpmyadmin, I do everything with mysql through the command prompt. How can I insert rows of...
7
6950
by: Howard Lowndes | last post by:
My situation is that I am interacting PHP 4.1.2 to PostgreSQL 7.2.2 I have no difficulty inserting and managing BLOBs into the Large Object system table, and I have a user table called images which maintains the relationship between the BLOB loid and the identity that relates to it in my user tables. So far so good. When I RTFM obout psql it refers to the \lo_import, \lo_list, \lo_export and \lo_unlink functions.
7
4054
by: Nilabhra Banerjee | last post by:
Hi, I am still not sure whether the BLOBS are actually stored in the database or they have the pointer to the database for that file in the filesystem. If I remove the files (sources) for BLOBS from the directories with the BLOB still hold the data ? Also one more very intriguing part is that if BLOBS are not deleted if we delete them from tables how to
0
1468
by: Bing | last post by:
Hi there, I am using the DB2 universal JDBC driver type 4 to insert BLOBs into a DB2 database. The Method I used for supplying the BLOB data value is setBinaryStream(). Everything works fine as long as the binary data is less than or equal to 100k. Anything larger than that (even for one byte) will result an exception saying the value is too large. All the DB2 samples (at least two)I have found have a limit of 100k (magic number!!!),...
2
2820
by: Jerry LeVan | last post by:
Hi, I am just getting into large objects and bytea "stuff". I created a small db called pictures and loaded some large objects and then tried to do a restore. Here is how I got the dump. pg_dump -Fc -b pictures > /Users/jerry/desktop/db.comp
1
1798
by: Marc Gravell | last post by:
Following up on a question somebody asked a day-or-so ago... When /reading/ BLOBs in C# I can use sequential access and GetBytes(); fine, sorted. However, is there a similar equivalent for /writing/ BLOBs? *Without* having to buffer the entire thing into a byte to set into param.Value? Or would the stream-friendly way of doing this be to execute multiple commands with the UPDATE column_Name .WRITE (@chunk, NULL, 0) syntax ?
5
16361
by: bhodgins | last post by:
Hi, I am new on here, and had a newbie question that I am stumped with. I am not new to access, but am new to VB. I am trying to export BLOBs from a field called photo to external jpeg files. I have tried the MS kb 210486 and successfully got the import/export to work with a sample table, but only the first record. I do not wish to impost binary data to the database, it's already there. I simply wish to pick up the binary BLOB from the photo...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.