Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deferred Segment Creation feature not enabled (ORA-00439)

I have .sql script file with DDL for more than 60 tables. I am trying to copy-paste the script into SQL Developer, connected to a database which is "Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production".

Sample DDL Script:

CREATE TABLE UserName."Table_Name" 
   (    "Col1" NUMBER(*,0), 
    "Col2" VARCHAR2(50 BYTE), 
    "Col3" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION DEFERRED 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  TABLESPACE "USERS" ;

Error report -
SQL Error: ORA-00439: feature not enabled: Deferred Segment Creation
00439. 00000 -  "feature not enabled: %s"
*Cause:    The specified feature is not enabled.
*Action:   Do not attempt to use this feature.

If I remove SEGMENT CREATION DEFERRED in the DDL Script:

CREATE TABLE UserName."Table_Name" 
   (    "Col1" NUMBER(*,0), 
    "Col2" VARCHAR2(50 BYTE), 
    "Col3" VARCHAR2(50 BYTE)
   ) 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  TABLESPACE "USERS" ;

This works. But I can't manually remove that in each and every table script.

If I have .dmp dump file then the following syntax will also solve the issue; on the source instance:

EXPDP user/pwd dumpfile=somename.dmp directory=DATA_DUMP_DIR nologfile=Y version=10.2

and on the target instance

IMPDP user/pwd dumpfile=somename.dmp directory=DATA_DUMP_DIR nologfile=Y version=10.2

But I don't have a .dmp file, I only have a .sql file.

Which is the best way of doing this?

like image 306
MAX Avatar asked Jun 21 '16 10:06

MAX


People also ask

How do I enable deferred segment creation?

Deferred segment creation can be controlled by the following: Setting the DEFERRED_SEGMENT_CREATION initialization parameter to TRUE or FALSE in the initialization parameter file. Setting the initialization parameter DEFERRED_SEGMENT_CREATION to TRUE or FALSE with the ALTER SESSION or ALTER SYSTEM SQL statements.

What is segment creation immediate in Oracle?

When creating many tables with deferred segment creation, ensure that you allocate enough space for your database so that when the first rows are inserted, there is enough space for all the new segments. SEGMENT CREATION IMMEDIATE : The table segment is created as part of this CREATE TABLE statement.


2 Answers

The deferred segment creation option is not available in Oracle 11g Express Edition (XE), which is what you are using. It's only available in Enterprise Edition (EE).

If you don't want to do an export/import and can only use the supplied script file you already have, your only option is to find and remove all instances of the SEGMENT CREATION DEFERRED clause.

Any text edit can do that of course, and SQL Developer has its own find/replace in the SQL Worksheet window.

like image 138
Alex Poole Avatar answered Sep 30 '22 15:09

Alex Poole


Just use SEGMENT CREATION IMMEDIATE in place of SEGMENT CREATION DEFERRED

like image 25
ankit Avatar answered Sep 30 '22 13:09

ankit