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
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 all oracle jdbc libraries to $CARBON_HOME/lib/extensions. (Oracle jdbc libraries are available in $ORACLE_HOME/jdbc/lib)
Database tables can be created either manually by running scripts or automatically by using startup parameters.
Database tables can be created manually by logging in to created database and running the following scripts
CARBON_HOME/dbscripts/common/oracle-registry.sql
CARBON_HOME/dbscripts/usermanager/um-oracle.sql
Windows users can run $CARBON_HOME/bin/wso2server.bat -Dsetup to create the database tables when starting WSO2 Registry for the first time. Linux users should use $CARBON_HOME/bin/wso2server.sh -Dsetup