Oracle 11g solutions for exporting empty and small tables

Source: Internet
Author: User

Oracle 11g solutions for exporting empty and small tables

Oracle 11g has a new feature. When the table has no data, no segment is allocated to save space.

Solution:

1) insert a row and then roll back to generate a segment.

This method inserts data into an empty table and then deletes it, resulting in a segment. An empty table can be exported.

2) set the deferred_segment_creation Parameter

SQL> show parameter deferred_segment_creation
NAME TYPE VALUE
-----------------------------------------------------------------------------
Deferred_segment_creation boolean TRUE
SQL> alter system set deferred_segment_creation = false;
The system has been changed.
SQL> show parameter deferred_segment_creation
NAME TYPE VALUE
-----------------------------------------------------------------------------
Deferred_segment_creation boolean FALSE

It should be noted that the value setting does not affect the empty tables previously imported and cannot be exported. It can only be used for the newly added tables. To export an empty table, you can only use the first method.

3) Batch Process empty tables

First, use the following SQL statement to query all empty tables of the current user.

Select table_name from user_tables where NUM_ROWS = 0;

Run the SQL statement

Select 'alter table' | table_name | 'allocate extent; 'from user_tables where num_rows = 0

Assume that the table TBL_1, TBL_2, TBL_3, and TBL_4 are empty here, the query result is as follows:

Alter table TBL_1 allocate extent;

Alter table TBL_2 allocate extent;

Alter table TBL_3 allocate extent;

Alter table TBL_4 allocate extent;

Finally, we can execute the preceding SQL statement.

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

Install Oracle 11.2.0.4 x64 in Oracle Linux 6.5

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.