Skip to main content

Oracle Data Dump Import and Export

Login to server :
sqlplus / as sysdba


exp SYSTEM/password FULL=y FILE=dba.dmp LOG=dba.log CONSISTENT=y
or
exp SYSTEM/password PARFILE=param.dat

where param.dat contains the following information 

FILE=dba.dmp 
GRANTS=y 
FULL=y 
ROWS=y 
LOG=dba.log

To dump a single schema to disk.

exp / FILE=dump.dmp OWNER=production

Export Specific tables to disk

exp SYSTEM/password FILE=export.dmp TABLES=(user1.table,user2.table)

Export Data in one user 

exp / FILE=export.dmp TABLES=(table1,table2)


Using imp: 

To import the full database exported in the example above.
imp SYSTEM/password FULL=y FIlE=dba.dmp

To import just the dept and emp tables from the scott schema
imp SYSTEM/password FIlE=dba.dmp FROMUSER=scott TABLES=(dept,emp)

To import tables and change the owner 

imp SYSTEM/password FROMUSER=blake TOUSER=scott FILE=blake.dmp TABLES=(unit,manager)


To import just the scott schema exported in the example above
imp / FIlE=scott.dmp


Comments

Popular posts from this blog

Behavior Driven Development

Behavior Driven Development (BDD) is a development process that originally associated with Test-Driven Development (TDD).  BDD is written in a readable format in an understandable language for anyone involved in software development.  BDD Features Providing better readability and visibility.  Verifying the software against customer requirements.  Assure the implementation of the system is correct. Derives examples of different expected behaviors of the system. Uses examples as acceptance tests. Focus on customer requirements throughout the development. BDD Practice There are two practices in BDD:-  Specification by Example (SbE). Test-Driven Development (TDD). Specification by example (SbE) uses examples in conversation to illustrate the business rules and the behavior of the software.  This uses to have a better understanding for Business Analyst, Product Owners, Testers and the Developers to reduce the misunderstanding abou...