Related Articles

Related Articles

Difference between LONGs vs LOBs
  • Last Updated : 27 Feb, 2020

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 only 2GB of data. Can store 4GB or more amount 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

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :