Follow the instructions below to set up the Oracle database.
Notice
For Oracle RAC, see Setting up with Oracle RAC.
Setup Database and User
1. Create a new database. This can be done by either using the Oracle database configuration assistant (dbca) or manually. Do necessary changes in the Oracle tnsnames.ora
and listner.ora
files in order to define databases addresses for establishing connections to the newly created database. After configuring them, startup the Oracle instance.
$ sudo /etc/init.d/oracle-xe restart
2. Connect to Oracle using SQL*Plus as sysdba.
$ ./${ORACLE_HOME}/config/scripts/sqlplus.sh sysadm/password as sysdba
2.1. Connect to instance with username and password.
$ connect
3. As SYS DBA, create a database user and grant privileges to the user as shown below:
Create user USER_NAME identified by PASSWORD account unlock; grant connect to USER_NAME; grant create session, dba to USER_NAME; commit;
4. Exit from the SQL*Plus session by typing the "quit" command.
SQL> quit
Setup Configuration File
1. Open $GREG_HOME/repository/conf/registry.xml
in a text editor.
2. Edit $GREG_HOME/repository/conf/registry.xml
and give the following:
<currentDBConfig>oracle-db</currentDBConfig> <dbConfig name="oracle-db"> <url>jdbc:oracle:thin:@SERVER_NAME:PORT/DB_NAME</url> <userName>USER_NAME</userName> <password>PASSWORD</password> <driverName>oracle.jdbc.driver.OracleDriver</driverName> <maxActive>80</maxActive> <maxWait>60000</maxWait> <minIdle>5</minIdle> </dbConfig>
3. Open $GREG_HOME/repository/conf/user-mgt.xml
in a text editor.
4. Edit $GREG_HOME/repository/conf/user-mgt.xml
and give the following:
<Configuration> ... <Property name="url">jdbc:oracle:thin:@SERVER_NAME:PORT/DB_NAME</Property> <Property name="userName">USER_NAME</Property> <Property name="password">PASSWORD</Property> <Property name="driverName">oracle.jdbc.driver.OracleDriver</Property> <Property name="maxActive">50</Property> <Property name="maxWait">60000</Property> <Property name="minIdle">5</Property> </Configuration>
Tip
Default port for Oracle is 1521.
Copy JDBC Driver
Copy the Oracle JDBC libraries to $GREG_HOME/repository/components/lib
. For example, - $ORACLE_HOME/jdbc/lib/ojdbc14.jar
.
Create Database Tables
Database tables can be created either manually by running scripts or automatically by using start-up parameters.
Using Scripts
Database tables can be created manually by logging in to the created database and running the following scripts in SQL*Plus:
SQL> @${GREG_HOME}/dbscripts/oracle.sql
Start the WSO2 Governance Registry.
$ ./${GREG_HOME}/bin/wso2server.sh
Using start-up Parameters
- For Windows users:
$GREG_HOME/bin/wso2server.bat -Dsetup
To create the database tables when starting the WSO2 Governance Registry for the first time.
- For Linux Users
$ ./${GREG_HOME}/bin/wso2server.sh -Dsetup