Friday, July 15, 2016

How to Set up WSO2 App Manager with Oracle

These steps can be used to configure App Manager standalone with Oracle.
  1. Login to Oracle server and create following tables.
    Create user WSO2CarbonDB identified by WSO2CarbonDB account unlock;
    grant connect to WSO2CarbonDB;
    grant create session, dba to WSO2CarbonDB;
    commit;
    Create user WSO2AM_DB identified by WSO2AM_DB account unlock;
    grant connect to WSO2AM_DB;
    grant create session, dba to WSO2AM_DB;
    Create user ES_Storage identified by ES_Storage account unlock;
    grant connect to ES_Storage;
    grant create session, dba to ES_Storage;
    Create user WSO2SocialDB identified by WSO2SocialDB account unlock;
    grant connect to WSO2SocialDB;
    grant create session, dba to WSO2SocialDB;
    commit;
    view raw oracle.sql hosted with ❤ by GitHub
  2. Edit master-datasource.xml in <AppM_HOME>/repository/conf/datasources as follow.
    <datasource>
    <name>WSO2_CARBON_DB</name>
    <description>The datasource used for registry and user manager</description>
    <jndiConfig>
    <name>jdbc/WSO2CarbonDB</name>
    </jndiConfig>
    <definition type="RDBMS">
    <configuration>
    <url>jdbc:oracle:thin:@localhost:1521/ORCL</url>
    <username>WSO2CarbonDB</username>
    <password>WSO2CarbonDB</password>
    <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
    <defaultAutoCommit>false</defaultAutoCommit>
    <maxActive>50</maxActive>
    <maxWait>60000</maxWait>
    <testOnBorrow>true</testOnBorrow>
    <validationQuery>SELECT 1</validationQuery>
    <validationInterval>30000</validationInterval>
    </configuration>
    </definition>
    </datasource>
    <datasource>
    <name>WSO2AM_DB</name>
    <description>The datasource used for APP Manager database</description>
    <jndiConfig>
    <name>jdbc/WSO2AM_DB</name>
    </jndiConfig>
    <definition type="RDBMS">
    <configuration>
    <url>jdbc:oracle:thin:@localhost:1521/ORCL</url>
    <username>WSO2AM_DB</username>
    <password>WSO2AM_DB</password>
    <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
    <defaultAutoCommit>false</defaultAutoCommit>
    <maxActive>50</maxActive>
    <maxWait>60000</maxWait>
    <testOnBorrow>true</testOnBorrow>
    <validationQuery>SELECT 1</validationQuery>
    <validationInterval>30000</validationInterval>
    </configuration>
    </definition>
    </datasource>
    <datasource>
    <name>JAGH2</name>
    <description>The datasource used for by the Jaggery Storage Manager</description>
    <jndiConfig>
    <name>jdbc/ES_Storage</name>
    </jndiConfig>
    <definition type="RDBMS">
    <configuration>
    <url>jdbc:oracle:thin:@localhost:1521/ORCL</url>
    <username>ES_Storage</username>
    <password>ES_Storage</password>
    <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
    <defaultAutoCommit>false</defaultAutoCommit>
    <maxActive>50</maxActive>
    <maxWait>60000</maxWait>
    </configuration>
    </definition>
    </datasource>
    <datasource>
    <name>WSO2_SOCIAL_DB</name>
    <description>The datasource used for social framework</description>
    <jndiConfig>
    <name>jdbc/WSO2SocialDB</name>
    </jndiConfig>
    <definition type="RDBMS">
    <configuration>
    <url>jdbc:oracle:thin:@localhost:1521/ORCL</url>
    <username>WSO2SocialDB</username>
    <password>WSO2SocialDB</password>
    <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
    <defaultAutoCommit>false</defaultAutoCommit>
    <maxActive>50</maxActive>
    <maxWait>60000</maxWait>
    <testOnBorrow>true</testOnBorrow>
    <validationQuery>SELECT 1</validationQuery>
    <validationInterval>30000</validationInterval>
    </configuration>
    </definition>
    </datasource>
    Note: <defaultautocommit>false</defaultautocommit> property is mandatory for "jdbc/WSO2AM_DB" datasource.
  3. Edit social.xml in <AppM_HOME>/repository/conf as follow.
    <SocialConfig>
    <QueryAdaptorClass>org.wso2.carbon.social.db.adapter.Oracle11gQueryAdapter</QueryAdaptorClass>
    </SocialConfig>
    view raw social.xml hosted with ❤ by GitHub
  4. Copy the Oracle JDBC driver, which compatible to your Oracle database, to <AppM_HOME>/repository/components/lib
  5. Start the server with -Dsetup sh
    wso2server.sh -Dsetup

No comments:

Post a Comment