Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2005
    Posts
    1

    How to store binary files in database

    Hello everybody. this is my first post in this forum.
    Actually i am looking for how to store binary files (like music files, doc files) inside Oracle database, specifically Oracle 10G.
    If they are not physically stored, how references are made to those files?
    How online music store tackles the situation with huge no. of files?
    plz help.

    s_de

  2. #2
    Join Date
    Dec 2004
    Posts
    54

    Binary

    Hi,
    ORACLE supports Binary Large Objects or BLOBs. In fact it's a data type and has been a data type since like 8i -I believe.

    It is designed specifically for multi-media. That's all I know, sorry.

    Hope that at least moves you in the right direction.
    Vmusic

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    At least in my experience, storing BLOBs within a database has been a poor choice. The performance impact on the end user is usually significant, if not enough to be a "deal breaker" because database engines don't often handle BLOB transfers very well.

    I've had much better luck storing a reference to the BLOB, such as a URL or UNC pathname. This allows your code to use tools built for the job such as FTP to move data wholesale from one box (a server) to another (client). This also allows you to use a "divide and conquer" approach as your needs grow, so that you can have the files served up by another machine(s) when your database becomes too busy to do the job.

    -PatP

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    web servers have this thing called cache

    when several requests are made for the same file, the web server can send it from cache rather than having to read it off the disk again

    you totally destroy this if the web server doesn't have access to the file on the file system, and instead must pass a request to a database server to pull the file out of a table

    of course, database servers have cache too, but the inter-server traffic can be totally avoided

    and let's not even mention the client's browser cache, which can't be used if the requesting url is dynamic (e.g. playmusic.html?clip=937)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Quote Originally Posted by r937

    ...of course, database servers have cache too...
    which most often don't cache LOBs anyway...

  6. #6
    Join Date
    Aug 2004
    Posts
    330
    How about a BIT table which holds the position and value (0 or 1) of each bit in the BLOB.... then write a program to reconstruct the binary from the query result. Of course, you will have to have a foreign key referencing a bit lookup table in order to enforce the ones and zeroes. (In case you ever want to move to ternary digits and an associated acronym)

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    associated acronym!!!!!!!!!!!!!!!!

    never heard that one before

    urquel, you slay me

    what a great sense of humour!!!!

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Quote Originally Posted by urquel
    an associated acronym
    Why, I do believe I'd enjoy playing with them!

    -PatP

  9. #9
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    Hello everybody. this is my first post in this forum.
    But it's still like every other forum out there.

    There are categories.

    Post Oracle questions under Oracle.

    Help us help you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •