|
|
|
How to export-import Oracle data
|
|
|
|
|
|
Usually, the backup function for Oracle databases in a lot of large companies is managed by a DBA, so SamePage administrators do not have to worry about it. But in case you are using a stand-alone Oracle 10G XE, you can simply use the Oracle export utility to take regular database backups.
For Export
You simply need to run the following command at the command prompt of the machine where you have Oracle installed:
exp username/password file=samepage.dmp log=backuplog.txt
where
- username/password is the Oracle username and password that is used by SamePage
- samepage.dmp is the name of the file where you want the SamePage data to get backed up.
- backuplog.txt is file into which you want to redirect the logs
You can also copy this command into a .bat file and have it run at regular intervals.
The dmp file should be securly stored so you can import it back to re-create the schema in case of a database crash.
For Import
If you are importing the schema to another database user, you should first create that database user and give it the required privileges. Oracle allows only system user to import one schema's objects into another.
So if the data was exported from User1, you can import it into User2 with the following command:
imp system/systempassword fromuser=User1 touser=User2 file=samepage.dmp log=implog.txt
where
- system/systempassword is the Oracle system username and password
- User1 is the original DB user from where the data was exported
- User2 is the new DB user into which the data is being imported
- samepage.dmp is the exported database dump file
- implog.txt is file into which you want to redirect the logs