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.

  1. Create a database
  2. I will be suing SQLPlus prompt. Therefore lets first login to sqlplus as sysdba

    C:\app\Administrator\OraHome_1\BIN>sqlplus sys as sysdba;
    

    1. Create a new user account and grant privileges
    2. SQL> Create user &ltuser_name&gt identified by &ltpasword&gt account unlock;
      User created.
      
      SQL> grant create session, dba to &ltuser_name>
      Grant succeeded.
      
      SQL> grant connect to &ltuser_name>
      Grant succeeded.
      
      SQL> exit
      
    3. Now execute the oracle.sql which is available in CARBON_HOME/dbscripts. This will configure carbon database for you.
    4. C:\app\Administrator\OraHome_1\BIN>sqlplus
      
      &ltprovide username\password of above user when promted&gt
      
      SQL&[email protected]_HOME\dbscripts\oracle.sql
      
    5. Start the listner after configuring the database. For this go to ORA_HOME/BIN and start listner like below.
    6. D:\oracle\product\10.2.0\db_2\BIN&gtLSNRCTL.EXE
      LSNRCTL.EXE&gtstart
      
    7. 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.

     

  3. Fill in the databse with data.
  4. You may use Carbon server admin console for this. Information about this can be found in product documentation available in here.

     

  5. Create a Backup using the following command.
    1. 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.
    2. expdp USER_ID/PASSWORD schemas=SCHEMA dumpfile=DUMP_FILE.dmp
      e.g. expdp yumani/yumani schemas=yumani dumpfile=yumani100112_1657.dmp
      

     

  6. Restore the database
    1. To restore the database from the exp dump created above you must first drop all of the previous objects from the schema.
    2. Therefore login to sqlplus as sysdba and drop previous user and recreate it.

    3. 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'
    4. impdp USER_ID/PASSWORD SCHEMAS=SCHEMA DUMPFILE=DUMP_FILE.DMP
      e.g. impdp yumani/yumani schemas=yumani dumpfile=YUMANI100112_1640.DMP 
      


 

Author

Yumani Ranaweera

Associate Technical Lead - Quality Assurance; WSO2, Inc.

[email protected]