Before you begin installing JChem Cartridge, please, read the Introduction and the High Level Overview of the JChem Cartridge architecture.
If you encounter any problem during installation, do not hesitate to contact our technical support for assistance.
Configuring the JChem Server comprises the following steps:
Environment variables specify "static" settings: for these settings to take effect JChem Server has to be restarted.
JAVA_HOME to the home directory
of a Sun Microsystems Java Development Kit version 1.4.2 or newer.
Set the JAVA_HEAP_SIZE variable which indicates the maximum amount of heap memory the Java runtime will be allowed to use. The amount of free physical memory should be large enough to accommodate the Java heap memory. The amount of Java heap memory, in turn, should be large enough to accommodate the structure caches of the Search Engine. The rule of thumb is that the JChem Base search engine (running in JChem Server) needs 100 MB for 1 million molecular structures. (For a detailed description of how to calculate the exact memory requirement of the search cache, see the FAQ.)
In addition to the memory requirements of the structure caches, you have to allow for some 60 MB needed for other functions running in JChem Server. For example, for 3 million structures, you need at least 360 MB memory allocation pool.
Example: In order to allow the Java runtime to use up to 700 megabyte of heap memory set the JAVA_HEAP_SIZE environment variable as follows:
on Windows:
SET JAVA_HEAP_SIZE=700mon Unix/Linux (bash):
export JAVA_HEAP_SIZE=700m
If JChem Server host has an Oracle installation on it and the ORACLE_HOME environment variable is set, the Oracle JDBC driver will be automatically found. If you want to use another driver (or the ORACLE_HOME environment variable is not set), set the ORACLE_JDBC_DRIVER environment variable to the path of the ojdbc14.jar file (with the file name itself included), like:
on Windows:
SET ORACLE_JDBC_DRIVER=C:\chemaxon\oem_libs\ojdbc14.jaron Unix/Linux (bash):
export ORACLE_JDBC_DRIVER=/opt/chemaxon/oem_libs/ojdbc14.jar
Set the oracle.server.* parameters in the
cartridge/conf/jcart.properties file as appropriate. You
typically need to change only the oracle.server.instance
property, setting it to the database instance name (aka system identifier
or SID).
Please, see also How to setup JChem Server and Oracle on two different hosts?, if applicable.
Create a directory licenses in the cartridge
directory (in the working directory of the JChem Server) and drop the
license files received from ChemAxon's Sales into the licenses
directory. If you want JChem Server to retrieve the license files from
a different directory, set the license.dir property in the
jcart.properties file to the path of that directory.
The cartridge/licenses directory is supposed to hold the newly
issued license files which are XML files.
License codes issued for JChem versions prior to 5.0 are supposed to work in the same manner as with JChem versions prior to 5.0:
licenses.dat file in its old place
and start JChem Server with the same user as Tomcat used to be started
for JChem Cartridge versions prior to 5.0.
Using a command interpreter available on your platform (terminal on Unix/Linux,
Command Prompt on Windows), make the cartridge directory
your current working directory and call the server script
(server.sh on Unix/Linux server.bat on Windows) with
the start parameter:
bash server.sh start
Please, refer to Managing JChem Server for how
to stop JChem Server. In order to create system services for production use,
please, use the facilities provided on your platform for this purpose.
(Windows users will want to refer to Installing the JChem Server as a Windows NT
service.)
connect and resolve
permissions (java.net.SocketPermission)
to the cartridge owner. Assuming that
call dbms_java.grant_permission( 'JCHEM', 'SYS:java.net.SocketPermission', '127.0.0.1', 'resolve' ) call dbms_java.grant_permission( 'JCHEM', 'SYS:java.net.SocketPermission', '127.0.0.1', 'connect,resolve' )
ORACLE_HOME
environment variable to the directory
where the Oracle Database is installed. Eg:
| On windows: | set ORACLE_HOME="c:\oracle\ora92" |
| On Linux: | export ORACLE_HOME=/home/user/oracle/OraHome1 |
JAVA_HOME to the home
directory of a Sun Microsystems Java Development Kit
version 1.4.2 or newer.
cartridge directory in the uncompressed
JChem package is writable by you.
cartridge
directory.
install script suitable for
your platform (install.sh for UNIX and Linux or
install.bat for Windows). (The Oracle RDBMS must be
running.)
The script loads the jcart.jar file into the Oracle
Database and creates PL/SQL functions, procedures, and other PL/SQL
objects needed by the cartridge.
The name and password of the cartridge owner have to be specified as
the first parameter of the script. The install script assumes that
JChem Server is running on the same host as Oracle and listens on the
1099 port by default. If any of the JChem Server connection parameters
differs from the default, a third argument must also be specified to
the install script indicating the JChem Server host and port:
For example:install.sh username/password[@connect_string] [<jchem.server.host>:<jchem.server.port>]
install.sh jchem/tiger@db
Connect to the database as the JChem-owner and execute the following:
call jchem_core_pkg.use_password('<passwd>');
where <passwd> is JChem-owner's password;
select jchem_core_pkg.getenvironment() from dual;
JCHEM_CORE_PKG.GETENVIRONMENT() -------------------------------------------------------------------------------- Oracle environment: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for Linux: Version 10.2.0.3.0 - Production NLSRTL Version 10.2.0.3.0 - Production JChem Server environment: Java VM vendor: Sun Microsystems Inc. Java VM version: 1.5.0_14-b03 JChem version: 5.0.0alpha14 JCHEM_CORE_PKG.GETENVIRONMENT() -------------------------------------------------------------------------------- JDBC driver version: 10.2.0.3.0
If your JChem Cartridge is correctly working with the cartridge owner, you may want to configure other Oracle users to use JChem Cartridge. Please, perform the following steps for each user A_USER who needs to use JChem Cartridge:
grant connect to a_user; grant resource to a_user; grant create synonym to a_user; call dbms_java.grant_permission( 'A_USER', 'SYS:java.net.SocketPermission', 'localhost', 'resolve'); call dbms_java.grant_permission( 'A_USER', 'SYS:java.net.SocketPermission', 'localhost', 'connect,resolve');
privman_pkg package in the
file privman.sql for granting the necessary
privileges on, and the necessary synonyms for, objects in the
JChem-owner's schema by performing the following steps:
sqlplus jchem/tiger@mydb @privman.sql
call privman_pkg.grants_on_jcobjs('JCHEM', 'A_USER', 'A_USER.JCHEMPROPERTIES', 1);
grant execute on privman_pkg to A_USER;
call jchem.privman_pkg.syns_for_jcobjs('JCHEM');
Notice that the package must be prefixed with the
JChem-owner's schema, since A_USER has no synonyms for
those objects at the time the call is executed.
The structure tables and domain indexes of a given user initiating a given
cartridge operation must be accessible via the JDBC connection(s) opened in
the JChem Server for use by the fingerprint caching engine. Beginning with
JChem version 3.0.12 the recommended way to achieve this is for users to
call the PL/SQL procedure jchem_core_pkg.use_password(password
VARCHAR2) with their password as the parameter at the beginning
of each database session (see a brief description of the mechanism at work
here).
The function jchem_core_pkg.set_password(password
VARCHAR2) has a similar effect; it returns 0, if the password is
valid for the user, -1 otherwise.
If the password of a given user has not been set for JChem Server
via the use_password PL/SQL procedure,
the oracle.server.login and
oracle.server.password JChem Cartridge properties
will be used to open database connections in JChem Server.
If the jchem_core_pkg.use_password(password VARCHAR2)
call cannot be used by users or applications for some unlikely reason, the
user specified by the oracle.server.login property must have
the following privileges:
Please, note that the JChem Cartridge components which are executed in Oracle currently communicate with JChem Server using an open RMI protocol. This means that some kind of protection (e.g. a simple firewall) must be setup on the machine which hosts JChem Server to prevent unauthorized searches in the structure tables.
SQL operators of the Cartridge can be used to search for chemical
data. SQL procedures are also defined to perform DML operations on
chemical tables. To increase the speed of the searching process, the jc_idxtype
index type has to be applied.
The server.{sh,bat} script can be
used for managing the JChem Server. It accepts one of the following
commands at a time:
start starts the JChem Server
stop stops the JChem Server
reload re-reads the following files
conf/jcart.properties by default), licenses directory (or
whatever directory has been specified using the
license.dir property int the master
configuration file),
conf/logging.properties by default)
setpassword sets the password that will be required
for administering JChem Server.
--no-pwprompt: do not prompt for a password.
--config-file <config-file>: use the
configuration file <config-file> instead of the
default conf/jcart.properties.
Each time it is run, the server script prompts for the administrative
password unless you specify the --no-pwprompt option. One
exception is the start command, for which you will never be
prompted for a password. Initially, no password is set. Until a password is
set with the setpassword command, you can just hit
<enter> when prompted for the password (or use the
--no-pwprompt for non-interactive use).
By default, JChem Server does not accept remote administrative calls. The
server script must therefore be run on the JChem Server host.
(In order to allow the JChem Server to be managed remotely using the
server script, you have to set the property
remote.admin.allowed to true. In case of
executing the server script on a remote JChem Server, the
jchem.server.host and jchem.server.port
properties must be appropriately set on the client machine where where the
script is executed. Note that you cannot start JChem Server remotely using
the server script.)
To remove JChem Cartridge drop all jc_idxtype
indexes or other pl/sql
objects that have been created after the installation
(including user defined operators added in support of
user
defined functions and supporting PL/SQL functions)
and run the uninstall
(uninstall.sh, uninstall.bat) script with
the user/password[@connect_string] argument. This script
drops every pl/sql type, function and other pl/sql objects that were
created by the install script and drops the JFunctions.class,
jchem.jar and dom4j.jar files.
bash upgrade.sh jchem/tiger@mydb
on Unix/Linux if the schema where JChem Cartridge is installed is
"jchem", the password is "tiger" and the TNS name of the database
is "mydb". If you see DROP statements (or ALTER statements with a
DROP clause) complaining of non-existent database objects, you can
safely ignore these error messages. The reason is that the upgrade
procedure tries to drop certain objects or object attributes only
to recreate them with their new signature or implementation. These
objects will be created as required even if they did not exist
in the JChem Cartridge version that is being upgraded from.
If the Oracle database and the JChem Server are on different machines,
you need to specify the connection descriptor of the JChem Server as
the second argument to the upgrade script similarly to
the install script as described here. For example:
bash upgrade.sh jchem/tiger@mydb apollo:1099where
jchem.server.host
in cartridge/conf/jcart.properties
oracle.server.host in
cartridge/conf/jcart.properties to the host name as the
Oracle host is visible from the JChem Server host.
bash install.sh jchem/tiger@mydb apollo:1099where
apollo is the JChem Server host name and 1099
is the JChem Server port as specified by the property
jchem.server.port in jcart.properties.
server.bat file as the
<path> component and server.bat as the
<application.ext> component.
In addition to the Application value, you also have to add an
AppDirectory and an AppParameters value under the
Parameters key created in step 3. The AppDirectory value
must be the path to the server.bat file. The
AppParameters value must be start.
For the first time after you created the service, the service has to be started
manually using the Services program in the Administrative Tools program group
(or Windows has to be restarted). It will be automatically restarted after each
Windows restart.
Note that this procedure will not give you a true Windows NT service: it will
only make sure that JChem Server is started at each restart. You still should
call server.bat stop in the command line, if you want to stop the
service.