Saturday, February 25, 2012

Setting up Governance Registry with Oracle RAC

Oracle Real Application Clusters (RAC) is an option for the Oracle Database for clustering and high availability in Oracle database environments.
In an Oracle RAC environment, some of the commands we have used in our oracle.sql is considered inefficient.If someone is testing products on a Oracle RAC, please rename oracle_rac.sql to oracle.sql before running -Dsetup.

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

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;     


Setup Configuration File

Edit $GREG_HOME/repository/conf/registry.xml and give the following:


 <currentDBConfig>oracle-db</currentDBConfig>
    <dbConfig name="oracle-db">
        <url>jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
                 (ADDRESS=(PROTOCOL=TCP)(HOST=host_1) (PORT=1521))
                 (ADDRESS=(PROTOCOL=TCP)(HOST=host_2) (PORT=1521))
                 (CONNECT_DATA=(SERVICE_NAME=service)))
            </url>
        <userName>USER_NAME</userName>
        <password>PASSWORD</password>
        <driverName>oracle.jdbc.driver.OracleDriver</driverName>
        <maxActive>80</maxActive>
        <maxWait>60000</maxWait>
        <minIdle>5</minIdle>
    </dbConfig>


Edit $GREG_HOME/repository/conf/user-mgt.xml and give the following

<Configuration>
        ...
        <Property name="url">jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
                             (ADDRESS=(PROTOCOL=TCP)(HOST=host_1) (PORT=1521))
                             (ADDRESS=(PROTOCOL=TCP)(HOST=host_2) (PORT=1521))
                             (CONNECT_DATA=(SERVICE_NAME=service)))</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>

 Copy JDBC Driver

When we connecting WSO2 Governance Registry with Oracle 11g versions we want to copy the newest version oracle jdbc libraries to
$CARBON_HOME/repository/components/lib.If we used previous one ArrayIndexOutOfBoundsException arise.

 Create the database tables

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



No comments:

Post a Comment