Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add sample db configs for all db types

...

  1. Create the following databases that are used in WSO2 Open Banking Key Manager (WSO2_OB_KM) and WSO2 Open Banking API Manager (WSO2_OB_APIM):

      1. openbank_am_configdb   
      2. openbank_apimgt_statsdb

      3. openbank_apimgtdb

      4. openbank_consentdb

      5. openbank_govdb

      6. openbank_iskm_configdb       

      7. openbank_mbstoredb

      8. openbank_userdb

    Tip
    Localtabgroup
    Localtab
    titleMySQL

    For MySQL database, use this command with the database names from the list below.

    Code Block
    languagesql
    CREATE DATABASE <DATABASE_NAME>;
    
    1. Place the compatible MySQL JDBC drivers in the <WSO2_OB_APIM_HOME>/repository/components/lib and <WSO2_OB_KM_HOME>/repository/components/lib directories. By default, the mysql-connector-java-5.1.42-bin.jar JDBC driver is available in these locations. 
    2. Edit the default datasource configurations in the files below with the MySQL configurations.
      1. <WSO2_OB_APIM_HOME>/repository/conf/datasources/master-datasources.xml
      2. <WSO2_OB_APIM_HOME>/repository/conf/datasources/open-banking-datasources.xml
      3. <WSO2_OB_KM_HOME>/repository/conf/datasources/master-datasources.xml
      4. <WSO2_OB_KM_HOME>/repository/conf/datasources/open-banking-datasources.xml
    3. Make sure you update the properties such as the url, username, password, driverclassname in the configurations. A sample is given below: 

      Code Block
      languagexml
      <datasource>
      	<name>WSO2CONFIG_DB</name>
      	<description>The datasource used by the registry</description>
      	<jndiConfig>
      		<name>jdbc/WSO2Config_DB</name>
      	</jndiConfig>
      	<definition type="RDBMS">
      		<configuration>
      			<url>jdbc:mysql://localhost:3306/openbank_openbankingdb?autoReconnect=true&useSSL=false</url>
      			<username>root</username>
      			<password>root</password>
      			<driverClassName>com.mysql.jdbc.Driver</driverClassName>
      			<maxActive>150</maxActive>
      			<maxWait>60000</maxWait>
      			<testOnBorrow>true</testOnBorrow>
      			<validationQuery>SELECT 1</validationQuery>
      			<validationInterval>30000</validationInterval>
      			<defaultAutoCommit>false</defaultAutoCommit>
      		</configuration>
      	</definition>
      </datasource>
    Localtab
    titleMS SQL

    For Microsoft SQL database, use this command with the database names from the list below.

    Code Block
    languagesql
    CREATE DATABASE <DATABASE_NAME>;
    1. Place the compatible MS SQL JDBC drivers in the <WSO2_OB_APIM_HOME>/repository/components/lib and <WSO2_OB_KM_HOME>/repository/components/lib directories. 
    2. Edit the default datasource configurations in the files below with your MS SQL configurations.
      1. <WSO2_OB_APIM_HOME>/repository/conf/datasources/master-datasources.xml
      2. <WSO2_OB_APIM_HOME>/repository/conf/datasources/open-banking-datasources.xml
      3. <WSO2_OB_KM_HOME>/repository/conf/datasources/master-datasources.xml
      4. <WSO2_OB_KM_HOME>/repository/conf/datasources/open-banking-datasources.xml
    3. Make sure you update the properties such as the url, username, password, driverclassname in the configurations. A sample is given below: 

      Code Block
      languagexml
      <datasource>
      	<name>WSO2CONFIG_DB</name>
      	<description>The datasource used by the registry</description>
      	<jndiConfig>
      		<name>jdbc/WSO2Config_DB</name>
      	</jndiConfig>
      	<definition type="RDBMS">
      		<configuration>
      			<url>jdbc:sqlserver://localhost:1433;databaseName=openbank_openbankingdb</url>
      			<username>root</username>
      			<password>root</password>
      			<driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
      			<maxActive>300</maxActive>
      			<maxWait>60000</maxWait>
      			<testOnBorrow>true</testOnBorrow>
      			<validationQuery>SELECT 1</validationQuery>
      			<validationInterval>30000</validationInterval>
      			<defaultAutoCommit>false</defaultAutoCommit>
      		</configuration>
      	</definition>
      </datasource>


    Localtab
    titleOracle

    For Oracle database, use these commands with the database names from the list below.

    Code Block
    CREATE USER <DATABASE_NAME> IDENTIFIED BY <PASSWORD>;
    GRANT SELECT ANY TABLE TO <DATABASE_NAME>;
    GRANT DELETE ANY TABLE TO <DATABASE_NAME>;
    GRANT INSERT ANY TABLE TO <DATABASE_NAME>;
    GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER to <DATABASE_NAME>;
    
    ALTER USER <DATABASE_NAME> QUOTA <SPACE_QUOTA_SIZE_IN_MEGABYTES> ON USERS;
    1. Place the compatible Oracle JDBC drivers in the <WSO2_OB_APIM_HOME>/repository/components/lib and <WSO2_OB_KM_HOME>/repository/components/lib directories.

    2. Edit the default datasource configurations in the files below with the your Oracle configurations.

      1. <WSO2_OB_APIM_HOME>/repository/conf/datasources/master-datasources.xml

      2. <WSO2_OB_APIM_HOME>/repository/conf/datasources/open-banking-datasources.xml

      3. <WSO2_OB_KM_HOME>/repository/conf/datasources/master-datasources.xml

      4. <WSO2_OB_KM_HOME>/repository/conf/datasources/open-banking-datasources.xml

    3. Make sure you update

    4. the
    5. properties such

    6. as the
    7. as url, username, password, driverclassname in the configurations. A sample is given below:

      Code Block
      languagexml
      <datasource>
      
    8. 	<name>WSO2CONFIG_DB</name>
      	<description>The datasource used 
    9. <description>Description for
    10. by the 
    11. datasource<
    12. registry</description>
      
    13. 	<jndiConfig>
      
    14. 		<name>jdbc/WSO2Config_DB</name>
      
    15. 	</jndiConfig>
      
    16. 	<definition type="RDBMS">
      
    17. <configuration>
    18. 		<configuration>
      			<url>jdbc:oracle:thin:
    19. @SERVER_NAME:PORT/SID</url> <username><DATABASE_NAME></username> <password><PASSWORD></password>
    20. openbank_openbankingdb/password@localhost:1521:root</url>
      			<username>openbank_openbankingdb</username>
      			<password>password</password>
      			<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
      
    21. <maxActive>300</maxActive> <maxWait>60000</maxWait> <minIdle>5</minIdle> <testOnBorrow>true</testOnBorrow>
    22. 			<maxActive>150</maxActive>
      			<maxWait>60000</maxWait>
      			<validationQuery>SELECT 1 from dual</validationQuery>
      
    23. 			<validationInterval>30000</validationInterval>
      
    24. 			<defaultAutoCommit>false</defaultAutoCommit>
      
    25. 		</configuration>
      
    26. 	</definition>
      </datasource>
  2. Update the INPUTS field size in AM_APPLICATION_REGISTRATION table in the sql file according to your database. The sql scripts are available in the <WSO2_OB_KM_HOME>/dbscripts/apimgt directory. (mysql5.7.sql, mssql.sql, oracle.sql)

    1. For UK specification:

      Localtabgroup
      Localtab
      titleMySQL / MSSQL
      Code Block
      languagesql
      INPUTS VARCHAR(7500),
      Localtab
      titleOracle
      Code Block
      languagesql
      INPUTS VARCHAR(4000),
    2. For Berlin specification: 

      Code Block
      languagesql
      INPUTS CLOB,
    Note
    iconfalse
    Note

    If you are using Microsoft SQL, do the following changes, in addition to the step above.

    Update the IDN_OIDC_REQ_OBJECT_REFERENCE table in <WSO2_OB_KM_HOME>/dbscripts/apimgt/mssql.sql file, by replacing the following lines:

    1. Replace FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE with

      Code Block
      FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID)
    2. Replace FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) with

      Code Block
      FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE
  3. Anchor
    dbScripts
    dbScripts
    To create the database schema, execute the following scripts against the given database:

    Localtabgroup
    Localtab
    titleMySQL
    Database NameScripts to execute
    openbank_am_configdb

    <WSO2_OB_APIM_HOME>/dbscripts/mysql5.7.sql

    openbank_mbstoredb

    <WSO2_OB_APIM_HOME>/dbscripts/mb-store/mysql-mb.sql

    openbank_consentdb

    For UK specification:

    <WSO2_OB_APIM_HOME>/dbscripts/dynamic-client-registration/mysql-5-7.sql

    <WSO2_OB_APIM_HOME/dbscripts/dynamic-client-registration/migration-3.1_to_3.2/mysql-5-7.sql

    <WSO2_OB_KM_HOME>/dbscripts/finance/openbanking.org.uk/mysql-5-7.sql

    <WSO2_OB_KM_HOME>/dbscripts/finance/event-notification/mysql-5-7.sql


    For Berlin specification:

    <WSO2_OB_KM_HOME>dbscripts/finance/berlin-group.org/mysql-5-7.sql

    openbank_govdb

    <WSO2_OB_KM_HOME>/dbscripts/mysql5.7.sql

    openbank_iskm_configdb 

    <WSO2_OB_KM_HOME>/dbscripts/mysql5.7.sql

    openbank_userdb

    <WSO2_OBKM_HOME>/dbscripts/mysql5.7.sql

    openbank_apimgtdb

    <WSO2_OB_KM_HOME>/dbscripts/apimgt/mysql5.7.sql

    Localtab
    titleMSSQL
    Database NameScripts to execute
    openbank_am_configdb

    <WSO2_OB_APIM_HOME>/dbscripts/mssql.sql

    openbank_mbstoredb

    <WSO2_OB_APIM_HOME>/dbscripts/mb-store/mssql-mb.sql

    openbank_consentdb

    For UK specification:

    <WSO2_OB_APIM_HOME>/dbscripts/dynamic-client-registration/mssql.sql

    <WSO2_OB_APIM_HOME/dbscripts/dynamic-client-registration/migration-3.1_to_3.2/mssql.sql

    <WSO2_OB_KM_HOME>/dbscripts/finance/openbanking.org.uk/mssql.sql

    <WSO2_OB_KM_HOME>/dbscripts/finance/event-notification/mssql.sql


    For Berlin specification:

    <WSO2_OB_KM_HOME>dbscripts/finance/berlin-group.org/mssql.sql

    openbank_govdb

    <WSO2_OB_KM_HOME>/dbscripts/mssql.sql

    openbank_iskm_configdb 

    <WSO2_OB_KM_HOME>/dbscripts/mssql.sql

    openbank_userdb

    <WSO2_OB_KM_HOME>/dbscripts/mssql.sql

    openbank_apimgtdb

    <WSO2_OB_KM_HOME>/dbscripts/apimgt/mssql.sql

    Localtab
    titleOracle
    Database NameScripts to execute
    openbank_am_configdb

    <WSO2_OB_APIM_HOME>/dbscripts/oracle.sql

    openbank_mbstoredb

    <WSO2_OB_APIM_HOME>/dbscripts/mb-store/oracle-mb.sql

    openbank_consentdb

    For UK specification:

    <WSO2_OB_APIM_HOME>/dbscripts/dynamic-client-registration/oracle.sql

    <WSO2_OB_APIM_HOME/dbscripts/dynamic-client-registration/migration-3.1_to_3.2/oracle.sql

    <WSO2_OB_KM_HOME>/dbscripts/finance/openbanking.org.uk/oracle.sql

    <WSO2_OB_KM_HOME>/dbscripts/finance/event-notification/oracle.sql


    For Berlin specification:

    <WSO2_OB_KM_HOME>dbscripts/finance/berlin-group.org/oracle.sql

    openbank_govdb

    <WSO2_OB_KM_HOME>/dbscripts/oracle.sql

    openbank_iskm_configdb 

    <WSO2_OB_KM_HOME>/dbscripts/oracle.sql

    openbank_userdb

    <WSO2_OB_KM_HOME>/dbscripts/oracle.sql

    openbank_apimgtdb

    <WSO2_OB_KM_HOME>/dbscripts/apimgt/oracle.sql

...