Creating a WSO2 Carbon Database Dump and Restoring - Oracle11g
By Yumani Ranaweera
- 23 May, 2012
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
- Create a new user account and grant privileges
- Now execute the oracle.sql which is available in CARBON_HOME/dbscripts. This will configure carbon database for you.
- 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.
- 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.
- 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.
- 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'
I will be suing SQLPlus prompt. Therefore lets first login to sqlplus as sysdba
C:\app\Administrator\OraHome_1\BIN>sqlplus sys as sysdba;
SQL> Create user <user_name> identified by <pasword> account unlock; User created. SQL> grant create session, dba to <user_name> Grant succeeded. SQL> grant connect to <user_name> Grant succeeded. SQL> exit
C:\app\Administrator\OraHome_1\BIN>sqlplus <provide username\password of above user when promted> SQL&[email protected]_HOME\dbscripts\oracle.sql
You may use Carbon server admin console for this. Information about this can be found in product documentation available in here.
expdp USER_ID/PASSWORD schemas=SCHEMA dumpfile=DUMP_FILE.dmp e.g. expdp yumani/yumani schemas=yumani dumpfile=yumani100112_1657.dmp
Therefore login to sqlplus as sysdba and drop previous user and recreate it.
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.