Reason analysis and solution for ORACLE exp not exporting empty table _oracle

Source: Internet
Author: User

One, cannot export the reason of empty table

1, oracle11g default to empty table does not assign segment, so use EXP export oracle11g database, empty table will not export.

2, set the Deferred_segment_creation parameter is false, whether it is empty table or Non-empty table, are allocated segment.

In Sqlplus, execute the following command:

Sql>alter system set Deferred_segment_creation=false;

View:

Sql>show parameter deferred_segment_creation;

This value is set to work only on the newly added table, which does not affect the previously created empty table.

Ii. Solutions

You can use a manual method of assigning extent to empty tables to resolve the problem of empty tables that were created before exporting

①select ' ALTER TABLE ' | | table_name| | ' allocate extent ' from user_tables where num_rows=0 or num_rows is null

Use the above statement to assign a extent statement to an empty table

However, there are many empty tables in the view user_tables num_rows not equal to 0 (reason: The table has previous data, after the deletion of Oracle statistics, the view User_tables data is not updated), so the above method does not allocate data segments for all empty tables, The workaround is as follows

②select ' Analyze table ' | | table_name| | ' compute statistics; ' from User_tables

Analyze table TableName COMPUTE statistics
Equivalent to analyze table TableName compute statistics for table for all indexes to all columns
The statistics for table exist in the view: User_tables, All_tables, Dba_tables
The statistics for the all indexes exist in the view: User_indexes, All_indexes, dba_indexes
The statistics for the all columns exist in an attempt to: User_tab_columns, All_tab_columns, Dba_tab_columns

After the execution, the Num_rows value in the View User_tables is updated, then the ① is executed, and the data segment can be assigned to all the empty tables

However, when executing the Analyze Table TableName Compute Statistics, Oracle reports the object Statictis are locked (the statistics of these tables are locked) and unlocks in the following way

③select ' exec dbms_stats.unlock_table_stats (' | | | ') Jxdemo ' ' | | | table_name| | ""); From User_tables

(③ results need to be performed on Sqlplus, and errors are performed in SQL windows in Pl/sql Developer)

③ after the execution of the results obtained after the execution of the ② there is no object Statictis are locked error prompted

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.