The concept of having mutiiple schemas (as addressed in this blog posting – Importing and Exporting Oracle DMP Files), is very powerful. The second part of this is being able to “point” the application server to the correct database. Tomcat is a great and free application server.
The second part of this is pointing the browser to the correct application server. In this post we will describe how to reroute Tomcat. But first a brief definition of Tomcat:
Tomcat Web Server
“Jakarta Tomcat is not only the most commonly used open source servlet engine today, it’s become the de facto standard by which other servlet engines are measured. Powerful and flexible, it can be used as a stand-alone web server or in conjunction with another server, like Apache or IIS, to run servlets or JSPs. But mastery of Tomcat is not easy: because it’s as complex as it is complete.”
Also, here is a link to Tomcat 5.5 documentation
http://tomcat.apache.org/tomcat-5.5-doc/index.html
A listing of web / app servers can be found here. The principle of web server rerouting is the same in each, but of course the method of doing is different per web server. If anyone knows of a free webserver that is easy to configure and can be rerouted with a simple front end http page, please respond to this post. WebLogic, which is a very expensive server which does about the same thing as Tomcat has a console which allows you to route to different Oracle users/schemas.
First you must have different application folders to switch between. This is where environmental settings as well as the application logic (stored in compressed JAR files) are located.
For most apps multiple folders will be housed in:
C:\Computer\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\(app folder)\
You can have different application folders to select from by copying an already existing application folder…..
C:\Computer\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\(app folder2)\
…..and making a change to the context.xml file. In many applications it will be located here.
C:\Computer\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\(app folder)\META-INF
The context.xml file will need several the text changed to reflect the correct schema name.
In addition there is typically a setting within the application directory. We will demonstrate with the application we are using. Here are the instructions:
- Find SPO_HOME directory and then\apps\resources\spo.properties.sample
- Make a copy of this file and rename it to be:
- spo.properties
- Open the spo.properties file for editing.
- Set the dbURL variable to the correct value. The format to be followed is jdbc:oracle:thin:@host:port:instance.
- EXAMPLE: dbURL= jdbc:oracle:thin:@transit:1521:SPOUNIT
- Set the userName variable to the correct value. This is the database schema owner name.
- EXAMPLE: userName= SPOUSER1
Save the file.
Next we need to….(to be continued)
The final step is restarting the web browser and pointing the browser to the correct URL. The web server will only be able to represent one schema and one folder of application logic at a time.