Working with Databases¶
WSO2 API Manager is shipped with an H2 database for storing data. These default databases are located in the
<API-M_HOME>/repository/database directory of the product pack.
Explained below are the default databases which will be used within API Manager.
- AM database :
WSO2AM_DB.mv.dbWSO2 API Manager has this database keeping its specific API-M related data.
- Shared database :
WSO2SHARED_DB.mv.dbThis database contains the registry and user management data.
- Carbon database:
WSO2CARBON_DB.mv.dbThis database has the internal data related to the product. This data is stored in the embedded H2 database.
Following image shows the default databases and the data that are stored in each database.
Changing the default databases¶
The embedded H2 databases shipped with your product are suitable for development and testing environments. However, for production environments, it is recommended to use an industry-standard RDBMS such as Oracle, PostgreSQL, MySQL, MS SQL, etc.
WSO2 products are shipped with scripts for creating the required tables in all the required databases: The scripts for creating tables for apim, user
management and registry data are stored in the
Changing the default database: You simply have to set up new physical databases, point the product server to the new databases by updating the relevant configuration files, and create the required tables using the scripts provided in the product pack. See the following topics for instructions:
- Changing to MySQL
- Changing to Oracle
- Changing to MSSQL
- Changing to Oracle RAC
- Changing to PostgreSQL
- Changing to IBM DB2
- Changing to MariaDB
To enable the default H2 database, add the below configurations to deployment.toml file in
/repository/conf and restart the server.
[database_configuration] enable_h2_console = true
You can access the database using URL - http://localhost:8082