What is export and import in Oracle?
Export and Import are two utilities in Oracle database used to extract data from database into a single file, and also extract data from that single file into a database. We normally call that file as dump file. It is widely used during backup and transfer data from one database to another.
- Use command below to show out the parameters that can be used in Export:
exp help=y - To export everything in database:
exp [username]/[password]@[database] full=y file=[dump file] log=[log file] - To export everything in one single schema:
exp [username]/[password]@[database] owner=[schema] file=[dump file] log=[log file] - To export particular tables in database:
exp [username]/[password]@[database] tables=([table],[table]) file=[dump file] log=[log file] - To show parameters that can be used in Import:
imp help=y - To import everything in a dump file:
imp [username]/[password]@[database] full=y file=[dump file] log=[log file] - To import particular schema in a dump file:
imp [username]/[password]@[database] fromuser=[schema in dump file] touser=[schema in db] file=[dump file] log=[log file] - To import particular tables in dump file:
imp [username]/[password]@[database] tables=([table],[table]) file=[dump file] log=[log file] - To import table structure only, add the following parameter:
rows=n - To import table (or other objects) that already exist in database, add following parameter:
ignore=y - Normally import the whole database cannot be done in one shot, need to import objects of different type one by one:
imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=y constraints=n indexes=n grants=n
imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=n constraints=y indexes=n grants=n
imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=n constraints=n indexes=y grants=n
imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=n constraints=n indexes=n grants=y

0 comments:
Post a Comment