1

I am saving huge blob(500 MB) into oracle DB using JDBC. It takes a lot of time in insertion and later on retrieval.

Please suggest, if any of you have encountered this problem.

4
  • 4
    Of course, the BLOB will take a lot of time to insert and retrieve. It's 500 MB after all. You might want to specify how much time it is taking, and why it shouldn't take so long. Then, somebody might be able to help you. Commented Jun 12, 2011 at 11:38
  • 1
    one solution would be not to insert or retrieve BLOBs that large. Commented Jun 12, 2011 at 11:51
  • or compress the data, perhaps. But all such answers are presumptuous. Commented Jun 12, 2011 at 11:55
  • 1
    How long does it take to save the BLOB to the database? How long does it take to move a 500 MB file from the web server to the database server? Commented Jun 12, 2011 at 12:03

2 Answers 2

5

Lots of non-database people are really scared of sticking BLOBs and CLOBs in databases. They shouldn't be. Oracle manages them very well. Also bear in mind that Oracle also develops file systems (including BTRFS) so know about storing all kinds of data. Data in the database can be better protected against media or system failure, secured against unauthorised access and audited for improper use.

You should be using 11g and SecureFile LOBS. This document on SecureFile performance gives guidelines to achieving performance that is as good or better than regular filesystem storage.

Of course it is worth checking what the bottleneck is first. If it is the network between the app server and the DB server then no amount of database tuning will bypass the issue.

Sign up to request clarification or add additional context in comments.

Comments

0

500 MB blob? Oh my God.

Look, seriously, the answer is "don't do that!" Relational databases aren't intended for that or optimized for it; the way the tables and filesystem have to be organized for indexing and searching aren't suited for that kind of big indigestable lump.

Consider, instead, creating a separate filesystem for this big lumps, and storing a pathname in the database.

6 Comments

I agree with this in principle. There's only problem though with this approach - accessing the blob is no longer a transactional activity. If the OP is fine with that, he should consider it.
@Vineet...this is out of context, I know that OP refers to the person asking the question, but what does it actually stand for?
@Bagmita, OP = Original Poster.
@Vineet I really really doubt that Oracle can maintain transactional integrity across a 500MB blob. But you can, using JDBC, start a unit of work, do your BAB ("big ass blob"), update your pathname, and end the UOW. You have to deal with error handling during the BAB, but the DB can handle integrity.
Of course Oracle can maintain transactional integrity with a 500Mb BLOB. It is just data. Databases are REALLY good at handling data.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.