Friday, June 26, 2009

ORACLE- Import and Export

Lets say u have a huge database created in Machine A. Now you want a replica of the database in machine B at a different location.. What r u gonna do? Copy the SQL CREATE-INSERT statements, then execute these. What if u miss out on an insert statement???
Well, to perform these tasks, ORACLE provides import and export commands.

If you want to create a replica of ur database, create a dump(.dmp) using exp command
exp file=(location where dump is to be created) Log=(location where log is to be created) owner=(user whose dump is being exported)

Now to import this dump into a new user:

imp file=(location where dump is kept) fromuser=(user whose dump is being exported) touser=(user where dump is being imported)

There u go... The database gets created successfully.

No comments:

Post a Comment