Wednesday, April 1, 2015

Export with No Data.Only Table structure.

When exporting you have to mention ROWS=N in the  exp command


[oracle@testdb backup]$ exp test/test FILE=ods.dmp LOG=ods.log ROWS=N

Export: Release 11.2.0.4.0 - Production on Wed Apr 1 09:25:47 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8MSWIN1252 character set (possible charset conversion)
Note: table data (rows) will not be exported
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST
About to export TEST's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST's tables via Conventional Path ...
. . exporting table                             T1
. . exporting table                             T2
. . exporting table                             T3
. . exporting table                             T4
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.



------------------------------------------------------------------------------------------------------------------------
Import above backup  (DMP)with another user test2

[oracle@testdb backup]$ imp userid=test2/test2 FILE=ods.dmp LOG=impods.log GRANTS=N IGNORE=Y CONSTRAINTS=Y STATISTICS=NONE FROMUSER=test TOUSER=test2

Import: Release 11.2.0.4.0 - Production on Wed Apr 1 09:29:49 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by TEST, not by you

import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
Import terminated successfully without warnings.


















No comments:

Post a Comment