In this guide I will be showing you how to create a Carbon data dump in Oracle11g and how to restore it.
- Create a database
I will be suing SQLPlus prompt. Therefore lets first login to sqlplus as sysdba
C:\app\Administrator\OraHome_1\BIN>sqlplus sys as sysdba;
- Create a new user account and grant privileges
SQL> Create user <user_name> identified by <pasword> account unlock;
SQL> grant create session, dba to <user_name>
SQL> grant connect to <user_name>
- Now execute the oracle.sql which is available in CARBON_HOME/dbscripts. This will configure carbon database for you.
<provide username\password of above user when promted>
- Start the listner after configuring the database. For this go to ORA_HOME/BIN and start listner like below.
- Next copy the database driver to CARBON_HOME\repository\components\lib and point the configuration files (usermgmt.xml, registry.xml) to the database and start the Carbon server.
- Fill in the databse with data.
You may use Carbon server admin console for this. Information about this can be found in product documentation available in here.
- Create a Backup using the following command.
- In the following example 'yumani' schema will be exported to 'yumani100112_1657.dmp' dump file. The dump will be created in the place where you are executing the command from.
expdp USER_ID/PASSWORD schemas=SCHEMA dumpfile=DUMP_FILE.dmp
e.g. expdp yumani/yumani schemas=yumani dumpfile=yumani100112_1657.dmp
- Restore the database
- To restore the database from the exp dump created above you must first drop all of the previous objects from the schema.
Therefore login to sqlplus as sysdba and drop previous user and recreate it.
- After the schema is cleaned, import the dump using the following command. In the example below 'yumani' schema will be restored using the content of 'yumani100112_1640.dmp'
impdp USER_ID/PASSWORD SCHEMAS=SCHEMA DUMPFILE=DUMP_FILE.DMP
e.g. impdp yumani/yumani schemas=yumani dumpfile=YUMANI100112_1640.DMP
Associate Technical Lead - Quality Assurance; WSO2, Inc.