Monday, May 21, 2007

Dev : Oracle Export and Import

Basic backup and restoring user in oracle using console is rather easy. First of all, what is a user? User in Oracle should be something we call a "database" in most relational database, such as MySQL and MSSQL.

So now, how do we backup a user? Some simple step will do.

Lets say we are tring to backup the user "newDB" and the password is "12345".

1. Go to console.
2. type "exp newDB/12345" and enter.
3. follow the steps. Normally by clicking "enter" will do. If you wish to change the name of the backup file, you may change it in one of the option.

Ok. Once your backup is done, you may want to store it to another location. So, in case of natural disaster, choi... We can get the dump file and recreate our database. But how?

1. Go to console.
2. Create new user, grant DBA permission.
3. type "imp newDB/12345 FILE=/get/dump/file/directory/dbdump.dmp FULL=y LOG=newlog.log" and enter.

See? Really as easy as 1-2-and-3! :)