WSO2 Governance Registry - Setting up database - Oracle [ Documentation Index ]

WSO2 Governance Registry - Setting up database - Oracle

Table of Contents

Setup Database and User

Create a new database. This can be done by either using oracle db configuration assistant (dbca) or manually. Do necessary changes to oracle tnsnames.ora and listner.ora files in order to define databases addresses for establishing connections to newly created database. After configuring them, connect to oracle as System DBA using SQL*Plus
$ sqlplus sys/sys-password as sysdba
Now startup the oracle instance.
SQL> startup 
As SYS DBA Create a database user,and grant privileges to the user as below:
Create user USER_NAME identified by PASSWORD account unlock;  
grant connect to USER_NAME;  
grant create session, dba to USER_NAME;  
commit;  	
Now exit from SQL*Plus session and start oralcle listner
$ lsnrctl start

Setup Configuration File

Edit $CARBON_HOME/conf/registry.xml and give the following:
 
<dbConfig name="wso2registry">
	<url>jdbc:oracle:thin:@SERVER_NAME:PORT/DB_NAME</url>
	<userName>USER_NAME</userName>
	<password>PASSWORD</password>
	<driverName>oracle.jdbc.driver.OracleDriver</driverName>
</dbConfig>
Edit $CARBON_HOME/conf/user-mgt.xml and give the following:
 
<Database>
	<URL>jdbc:oracle:thin:@SERVER_NAME:PORT/DB_NAME</URL>
	<UserName>USER_NAME</UserName>
	<Password>PASSWORD</Password>
	<Dialect>oracle</Dialect>
	<Driver>oracle.jdbc.driver.OracleDriver</Driver>
</Database>

Default port for oracle is 1521

Copy JDBC Driver

Copy the oracle jdbc libraries to $CARBON_HOME/repository/components/lib. (Ex:- $ORACLE_HOME/jdbc/lib/ojdbc14.jar)

Create Database Tables

Database tables can be created either manually by running scripts or automatically by using startup parameters.

Using Scripts

Database tables can be created manually by logging in to created database and running the following scripts

CARBON_HOME/dbscripts/oracle.sql

Using Startup Parameters

Windows users can run $CARBON_HOME/bin/wso2server.bat -Dsetup to create the database tables when starting WSO2 Governance Registry for the first time. Linux users should use $CARBON_HOME/bin/wso2server.sh -Dsetup