Search This Blog

Friday, July 10, 2015

Export empty table in Oracle 11G database


If you create any schema in your database, you should  set "deferred_segment_creation" parameter to "False". Login by using Sys user and use following command from SQL.

        "alter database set deferred_segment_creation=false ; scope=both;"

Now, you can export all tables either it's empty or not.


If you find that some table already created before executing above command, then you should use below way:

1. use "select 'alter table '||table_name||' allocate extent;' from user_tables
where segment_created = 'NO
' " query to get the script of empty tables which needs to create segment.


Copy the output and execute it. Now, segment will be created and you can easily export your database or schema.

No comments:

Post a Comment