oracle11g when you export a table, you will see fewer tables and no solution for empty tables.

Source: Internet
Author: User

Tag: statement attribute present use Export data query default delay what to do

One: Background introduction

oracle11g when exporting a database table with the EXP command, it is sometimes found that only a subset of the tables are exported and will not be error-free because the empty table has not been exported and has not been found before. So the most stupid way to re-build these empty tables, of course, in our actual table in the number of large when we should do??? There is no such issue in the oracle10g version.

So the data found that oracle11g has a new feature, added a new feature "deferred_segment_creation" meaning is the paragraph delay creation, the default is true.

What does it mean exactly? Let's explain the following:

If this parameter is set to True, you create a new table and do not insert data into it, the table will not immediately allocate extend, that is, no data space, that is, the table does not allocate segment to save space, so the tables are not exported. You can also see in the system table user_tables that the segment_treated field is "NO" or "YES" to indicate whether a table is assigned a segment. It is plainly intended to save a small amount of space.

The workaround I have used:

>>> SQL command to allocate space for empty tables.

1. To query all empty tables under the current user, it is best for a user to have a default tablespace with the following command:

>sql:select table_name from user_tables where num_rows= ' 0 '

2. According to the above query statement, you can build the empty table allocation space for the command statement, as follows;

>sql:select ' ALTER TABLE ' | | table_name| | ' allocate extent; ' from User_tables where num_rows=0 or num_rows is null (Note: Many tutorials do not have here, here is possible bit empty)

The above code can produce a batch of modified table extent SQL statements (how many empty tables to produce how many), we just have to generate all the SQL code to execute all, we can give each existing table to allocate segment, OK.

Then export with the EXP command.

Reference: http://blog.sina.com.cn/s/blog_5f0e9ca50101it7n.html

oracle11g when you export a table, you will see fewer tables and no solution for empty tables.

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.