Problems caused by changing the tablespace blob field in Oracle

Source: Internet
Author: User
Because blob fields are fields that store binary big data, and can be stored for a maximum of 4 GB. Therefore, it is stored differently from other fields. When blob is stored, it is only stored in

Because blob fields are fields that store binary big data, and can be stored for a maximum of 4 GB. Therefore, it is stored differently from other fields. When blob is stored, it is only stored in

The scenario is as follows:

All the original table data is stored in the users tablespace. Now you need to replace the tablespace with the ntbs tablespace.

When moving, tables with blob, clob, and long types fail to be replaced. Why?

Because blob fields are fields that store binary big data, and can be stored for a maximum of 4 GB. Therefore, it is stored differently from other fields. When blob is stored, it only stores a Data Pointer in it. The real data is separated from the table Storage and placed in another address space. Of course, this address space may be two independent tablespaces in the same tablespace as the table. But it is two different buckets.

Therefore, in the preceding scenario, the actual data of blob fields is stored in users tablespaces. The users who use blob fields do not have the users tablespaces permission and only have the ntbs tablespace permission.

1. solution:

Assign the users tablespace permission to the user, but the user cannot change the tablespace because the data of the blob field is still in the users tablespace.

Therefore, execute: alter table tname move tablespace ntbs blob (col_name) store as (tablesapce ntbs );

In this way, the data in the field col_name in the tname of the table containing blob is replaced with the table space ntbs.

2. If it is changed between different machines, for example, the dmp file exported from the users tablespace of machine A is imported to the ntbs tablespace of machine B.

In this case, you can create a table with blob fields in the ntbs tablespace of machine B. After the table is created, the actual data with blob fields is actually stored in the ntbs tablespace, then execute imp.

The same is true for clob and long types.

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.