[Oracle] LOB Introduction

Source: Internet
Author: User

[Oracle] LOB introduces a relational database like Oracle and is better at dealing with structured data, so how does Oracle handle and store unstructured data? Lob (Large object) is used by Oracle to handle semi-structured and unstructured data, a large object data type that can store more than 4000 bytes of string, binary data. The LOB type has two types of lobs, very internal lob and external lob. The so-called internal lob refers to the LOB data stored in an Oracle data file, External LOB refers to the LOB data stored in the operating system outside the database. Internale LOB includes: 1) CLOB (Character LOB): LOB for storing string types, such as text and XML files, string database character set encoding, 2) BLOB (binary LOB): LOB for storing binary types ; 3) NCLOB (National Character Lob): Similar to Clob, but the string is encoded in the country character set. External LOB includes: 1) BFILE (Binary file LOB): The database stores a pointer to execute an external file, so it is a read-only LOB store when we build a table that contains LOB fields, Oracle automatically creates two separate segment for LOB fields, one for storing data, the other for indexing, and they are stored in the table space specified by the corresponding table. Look at the following example:?
1234567891011 [sql][email protected]> create table test.lobtest(b blob,c clob);    Table created.    [email protected]> select OWNER,TABLE_NAME,COLUMN_NAME,SEGMENT_NAME,INDEX_NAME from dba_lobs where table_name=‘LOBTEST‘   OWNER                          TABLE_NAME                     COLUMN_NAME                    SEGMENT_NAME                   INDEX_NAME  ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------  test                            lobtest                          b                               sys_lob0000101291c00001$$       sys_il0000101291c00001$$  TEST                           LOBTEST                        C                              SYS_LOB0000101291C00002$$      SYS_IL0000101291C00002$$

As shown in the example above, each LOB field corresponds to two segment, where the LOB data begins with Sys_lob and the index starts with Sys_il. LOB and other types of conversions through To_clob can convert the Char,nchar,varchar2,nvarchar2,nclob type to CLOB, and the TO_LOB can convert long raw to blob,long; _nclob can convert Char,nchar,varchar2,nvarchar2,clob to NCLOB.

[Oracle] LOB Introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.