Difference between LONGs vs LOBs

What are Large Objects?
Large Objects(LOBs) are a collection of datatypes which is designed to hold a large amount of data. A LOB is able to hold up to maximum size ranging from 8 terabytes to 128 terabytes, depending upon how your database is configured. Storing data into LOBs helps you to manipulate & access data efficiently in your own application.

Why not Use LONGs?

The database can be able to support LOB as well as a LONG datatype. Whenever possible, change your existing application to use LOBs in place of LONGs because of some added benefit that LOBs provide. LONG to LOB migration helps you to migrate your existing application that access LONG columns, to access LOB columns.

For storing a large amount of unstructured data LONG datatype is used to develop an application which can be used with Oracle Database version 7 or earlier.

After the existence of Oracle8i and later version of the database, LOB datatype is preferred for storing a large amount of semi-structured and unstructured data. LOB datatype has several advantages over LONG datatype which are mentioned below:

  • Capacity of LOB: LOBs can store huge amount of data. It can store 4GB of data or more
    depending upon the system configuration. The LONG datatype can store around half of the LOBs i.e., up to 2GB of data.
  • Number of LOB columns in a table: A table can contain multiple LOB columns. A LOB column in a table can contain any LOB type whereas, for LONG, a table can have only a single LONG column.
  • Access of Data: LOB support random access to any data whereas LONG support only sequential access to data.
  • LOBs can also be object attributes.
LONG LOB
Can store 4GB or more amount of data Can store only 2GB of data.
Hard to maintain. Easily maintained
One column per table Multiple columns per table.
Sequential access of data Random access of data
One column per table Multiple columns per table.
Can store only binary data Can store both binary & character data


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.