setup tomcat and geoserver for oracle RAC connection

1 - First you need to put ojdbc14.jar or later driver in tomcat/lib folder and set permision to tomcat (linux).
2 - In tomcat/conf/context.xml
  in side <Context> tag put :
    <Resource name="jdbc/ora-rac" auth="Container" type="javax.sql.DataSource"              url="jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
                        (ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
                        (ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
                        (CONNECT_DATA=(SERVICE_NAME=service)))"
             driverClassName="oracle.jdbc.driver.OracleDriver"
             username="dbuser" password="dbpasswd"
             maxActive="20" maxIdle="3" maxWait="10000"
             poolPreparedStatements="true"
             maxOpenPreparedStatements="100"
             validationQuery="SELECT SYSDATE FROM DUAL" />
3 - To allow a geoserver to user reference you must put in GEOSERVER_DIR/WEB-INF/web.xml :
    <resource-ref>
        <description>Oracle Datasource</description>
        <res-ref-name>jdbc/ora-rac</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

4. Restart tomcat
5. Create JNDI connection and put in JNDIrefrerence this java/comp/env/jdbc/orac-rac

And you are successfully connected geoserver to Oracle RAC. :]

Comments

Popular Posts