Skip to Main Content
  • Questions
  • IMP-00020: long column too large for column buffer size

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Alison.

Asked: November 06, 2000 - 9:46 am UTC

Last updated: April 26, 2007 - 12:47 pm UTC

Version: Oracle7 Release 7.3.4

Viewed 10K+ times! This question is

You Asked

Hi There

I am having a problem when I'm trying to perform an import of a successfully exported database.

I am getting the following error message in the import logs.

. . importing table "PSPNLFIELD"
IMP-00020: long column too large for column buffer size (29214)
IMP-00028: partial import of previous table rolled back: 98896 rows rolled back

I have increased the buffer size in increments of 1000 but still get the same error message.

When I try the statement below I get the following error.
SQL> SELECT * FROM PSPNLFIELD;
ERROR:
ORA-00932: inconsistent datatypes.

I have attempted to export and import just this one table, however I still get the same results.

Many thanks

Alison.

and Tom said...

You should set the buffer size to some number larger then any of the LONG RAWs you have in that file.

I typically use

buffer=10000000

(10million) or so. If you long raws are bigger then 10m, adjust acorrdingly.

The inconsistent datatypes is expected -- long raw columns are not selectable in sqlplus.

Rating

  (7 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

"long column too large..." but no long column

Sri, April 18, 2003 - 6:25 pm UTC

Dear Tom,

I am getting the same error (as following) when I tried to import. I am using Oracle 9.0.1.1, I exported the data from the same server itself. But when I am trying to import it, it is giving the error.

IMP-00020: long column too large for column buffer size (10)

As you had adviced to the original post, I tried increasing buffers while importing, I gave values up to 10,000,000,000 but no use. Still exactly the same error with a 10 in brackets. I have done the export from using Direct=Y. The structure of the table for which the error is coming is as follows: -

Create Table CustomerMaster
(
Code Varchar2(10)
Constraint pk_CustM_Code Primary Key,
CustomerID Varchar2(10)
Constraint uq_CustM_CustID Unique
Constraint nn_CustM_CustID Not Null,
Customer_Name Varchar2(100)
Constraint uq_CustM_CustName Unique
Constraint nn_CustM_CustName Not Null,
Alias_Name Varchar2(100)
Constraint nn_CustM_AliasName Not Null,
Record_Info Varchar2(100),
Other_Details Varchar2(300),
CustomerType_Code Varchar2(10)
Constraint fk_CustM_CTypeCode References CustomerTypeMaster(Code),
Address1 Varchar2(100),
Address2 Varchar2(100),
Location_Code Varchar2(10)
Constraint fk_CustM_LocCode References LocationMaster(Code),
State_Code Varchar2(10)
Constraint fk_CustM_StaCode References StateMaster(Code),
ZipCode Varchar2(50),
Country_Code Varchar2(10)
Constraint fk_CustM_CountryCode References CountryMaster(Code),
Email_ID Varchar2(100),
Phone_No Varchar2(30),
Fax_No Varchar2(50),
Referred_Emp Varchar2(10)
Constraint fk_CustM_RefEmp References Employee(Code),
Customer_Since Date,
Customer_Status Varchar2(2)
Constraint nn_CustM_CustStatus Not Null,
Present_Status Varchar2(2)
Constraint nn_CustM_PStatus Not Null,
Remarks Varchar2(100) Constraint nn_CustM_CStat Not Null
)
/

As you can see there are not too many columns. Also there are no column with type Long etc. Why is this error coming still? How can I successfully import from this file? Kindly help.

Tom Kyte
April 18, 2003 - 6:49 pm UTC

lets see the output from imp -- the startup stuff that tells me the charactersets and all...

Here is the output...

Sri, April 18, 2003 - 7:26 pm UTC

Thank you for the response Tom. Here is the output you asked. Kindly go through and advice on how to import the data successfully.

C:\>imp

Import: Release 9.0.1.1.1 - Production on Fri Apr 18 18:30:15 2003

(c) Copyright 2001 Oracle Corporation. All rights reserved.

Username: sri
Password:

Connected to: Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production

Import file: EXPDAT.DMP > C:\SriData.Dmp

Enter insert buffer size (minimum is 8192) 30720> 100000000

Export file created by EXPORT:V09.00.01 via direct path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
List contents of import file only (yes/no): no >

Ignore create error due to object existence (yes/no): no >

Import grants (yes/no): yes >

Import table data (yes/no): yes >

Import entire export file (yes/no): no >
Username: sri

Enter table(T) or partition(T:P) names. Null list means all tables for user
Enter table(T) or partition(T:P) name or . if done: CustomerMaster

Enter table(T) or partition(T:P) name or . if done: .

. importing SRI's objects into SRI
. . importing table "CUSTOMERMASTER"
IMP-00020: long column too large for column buffer size (10)



Tom Kyte
April 18, 2003 - 7:50 pm UTC

a) was there a function based index on this table that was dropped?
b) you have opened a tar with support right?


there was a function based index...

Sri, April 18, 2003 - 8:05 pm UTC

Dear Tom,

Yes, there was a function based index for this table. (No, I haven't opened a tar.)

The index is as follows: -

CREATE UNIQUE INDEX custmaster_uppercustname_uqidx ON customermaster(UPPER(customer_name))
/

Why? Has it got anything to do with this Tom? Now, what is the way out?


Tom Kyte
April 19, 2003 - 11:58 am UTC

Article-ID:         <Note:148740.1>
Circulation:        PUBLISHED (EXTERNAL)
Folder:             server.Utilities.ExportImport
Topic:              Alerts
Title:              ALERT: Export of table with dropped functional index may 
                    cause IMP-20 on import


Import may fail with IMP-20 if direct-path export taken after functional index was dropped
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Versions Affected 
~~~~~~~~~~~~~~~~~ 
  This problem:
        Does not affect Oracle 8.0 releases 
        Affects Oracle release 8.1.5, 8.1.6, 8.1.7, 9.0.1
        The issue is fixed in the 8.1.7.3 Patch Set.
 
Platforms Affected 
~~~~~~~~~~~~~~~~~~ 
  GENERIC - affects all platforms
 
Description 
~~~~~~~~~~~ 
  Direct export may create a corrupt export file if a table is exported which
  had it's functional index dropped.
  Subsequent attempts to import the affected table result in errors:
    IMP-00020: long column too large for column buffer size
  Increasing the import buffer size has no effect.  
 
Likelihood of Occurrence 
~~~~~~~~~~~~~~~~~~~~~~~~ 
  In order to hit this problem an export file must have been created under 
  the following circumstances:

    a. The database was started with compatible set to 8.1.x or higher

    b. A table had a functional index created on it

    c. The functional index was dropped

    d. The table did NOT have unused columns dropped after the index was dropped

    e. The table was exported in direct-path mode

What are the chances of hitting this problem ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Connect as a SYSDBA user (or SYS) and run this statement:

      set echo off
      select 'ALTER TABLE '||u.name||'.'||o.name||' DROP UNUSED COLUMNS;'
        from user$ u, obj$ o, col$ c
      where o.type#=2
        and c.col#=0
        and bitand(32768,c.property)=32768
        and o.obj#=c.obj#
        and u.user#=o.owner#
        and u.user#!=0;

  If any rows are returned, drop the unused columns from the affected
  tables using the 'ALTER TABLE....' SQL statements returned from the
  above dictionary query. 

Example Sequence of events leading to a Corrupt Export file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The steps below illustrate a common sequence of events which lead to 
  a corrupt export file:

    a. Create and populate a table    
       CREATE TABLE W21
         ( W21PROGRAMM CHAR(8) DEFAULT (' ')  NOT null,
           W21BEREICH  CHAR(2) DEFAULT (' ')  NOT null,
           OGRAMID     CHAR(8) DEFAULT (' ')  NOT null);
       INSERT INTO W21 VALUES ('SIBG43',0,'STAU');
       COMMIT;

    b. Create the functional index, then drop it
       CREATE INDEX W2102 ON W21 (W21PROGRAMM DESC) ;
       DROP INDEX W2102;

       Note: The DESC keyword causes a functional index to be created in 
       Oracle8i onwards unless the init.ora parameter _IGNORE_DESC_IN_INDEX 
       is set to TRUE. The same problem occurs for a normal functional index. 
       For example:

          CREATE INDEX W2102 ON W21 (UPPER(W21PROGRAMM)); 

    c. Export the table (direct-path)
       exp user/pw buffer=100000 direct=yes tables=w21

    d. Drop the table 
       DROP TABLE W21;

    e. Attempt to import the table
       imp user/pw fromuser=username
       IMP-00020: long column too large for column buffer size (2)
       
Workaround 
~~~~~~~~~~

    a. If a functional index is dropped, immediately drop any unused
       columns from the table on which the index was created, using the
       syntax:

         SQL> ALTER TABLE <TABNAME> DROP UNUSED COLUMNS;

       Note that in some cases this command may fail with an ORA-600 [711]
       error. In such cases it should be possible to work around this
       ORA-600 by adding a dummy column to the table then dropping it.
       eg: 
         SQL> ALTER TABLE <TABNAME> ADD ( dummy_col number );
         SQL> ALTER TABLE <TABNAME> DROP COLUMN dummy_col;
         SQL> ALTER TABLE <TABNAME> DROP UNUSED COLUMNS;
 
    b. Use export in conventional mode, rather than direct-path

    Note, it is possible to import other objects from the same export dump
    file, regardless of their ordering within the file (i.e. whether they
    were created before or after the affected table).

References
~~~~~~~~~~
  Base bug for this alert                             <Bug:1805146>
  IMP-20 with DIRECT=Y issue caused by this bug       <Bug:1754922>

Modification History
~~~~~~~~~~~~~~~~~~~~
  23-Oct-2001 This alert was modified to add steps to take if the
              DROP UNUSED COLUMNS command errors with ORA-600 [711].
  21-Jan-2002 Added fixed in 8.1.7.3 information 

Don't use 9.0.1

A reader, April 19, 2003 - 12:05 am UTC

You dare to use 9.0.1... hope it's not an important database.

Tom Kyte
April 19, 2003 - 11:56 am UTC

huh?

FOLLOWUP

Dana Day, April 19, 2003 - 11:22 am UTC

Ran across this error in 8.1.7.2.
If you export direct path from a table that "had" and then dropped a function based index, you will recieve the error.
The workaround is to export conventional path.

Hope this helps.

IMP-00020 errors when importing when long column does not exist in export file

Mike, August 20, 2004 - 9:01 am UTC

Big thanks Tom. After searching for countless hours looking for answers to the root cause of the import problem, your answer to check for "drop unused colums" was the key. I have searched metalink until my fingers and eyes couldn't take it anymore. I was able to make it work by eliminating the direct=y but I use this everywhere and it just did not sit right.



IMP-00020: long column too large for column buffer size (7)

YaroSH, April 26, 2007 - 5:52 am UTC

Hi There

I am getting the same error (as following) when I tried to import.

Export is from Oracle 9.2.0.6
exp xxx/xxx@xx FILE=$DUMP/yyy.dmp LOG=$DUMP/yyy.log OWNER=xxx CONSISTENT=Y BUFFER=5000000

Import in other DB 9.2.0.8
imp xxx/xxx@xx FILE=yyy.dmp LOG=yyy.log FROMUSER=xxx TOUSER=xxx COMMIT=Y ANALYZE=Y

But when I am trying to import it, it is giving the
error.

IMP-00020: long column too large for column buffer size (7)

I tried increasing buffers while importing, I gave
values up to 500,000,000 but no use.

But import in 10g was OK.




Tom Kyte
April 26, 2007 - 12:47 pm UTC

please investigate this one with support - unless you can provide a way to reproduce....