Open In App

Difference between LONGs vs LOBs

Last Updated : 22 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

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

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads