Wednesday, August 25, 2010

Oracle database backup and restore

Here is command to take backup from the oracle database:

exp userid=system/{system_passwd}@{schema} owner={schema_owner} file={backup_file}.dmp buffer=102400 statistics=none grants=n log={backup_log_file}.log

Where
system_passwd is password for system user
schema is database schema name
schema_owner is user name for the database
backup_file is backup file name
backup_log_file is log file name for backup logs

To restore database from the backup (dmp file) use following command

imp system/{system_passwd}@{schema} file={backup_file}.dmp log={import_log_file}.log fromuser={existing_user} touser={new_user}


Where
system_passwd is password for system user
schema is database schema name
backup_file is backup file name
import_log_file is log file name where all the logs will be written
existing_user is database user name from the dmp file
new_user is database user name which is being restored.

1 comment:

Mayank Bhati said...

I have a *.dmp backup from a different computer, now i want to restore this to oracle 10g express edition. Please tell me the complete procedure to restore this database file. Please Help.If possible mail me at mayankbhati359@gmail.com