JChem Oracle Cartridge Installation without DBA account

Requirement
Step-by-step install guide (it is a guide, not a Bible!) for system with 
3 typical users: 
●	jchem_owner (JCHEM), 
●	user with data tables (DWH), 
●	user that has search capability (IJC).

Before Install
1. Unzip the installer package.
2. cd [install_directory]/jchem/cartridge
3. chmod 775 config-util.sh
4. chmod 775 install.sh
5. chmod 775 server.sh
6. export JAVA_HOME=[your_JAVA_HOME]

Get SQL necessary statements before install (interactive)
7. You will get runnable SQL statements - that should be executed by DBA
prior to install - by running the command:
../jchem/cartridge$ ./config-util.sh list-dba-sqls

interactive output:
+ /usr/lib/jvm/java-7-oracle-1.7.0.65//bin/java -classpath
../lib/jchem.jar
-Djava.util.logging.config.class=chemaxon.jchem.cartridge.util.LoggingConfigurator
-Dchemaxon.jchem.cartridge.config.file=conf/jcart.properties
-Djava.util.logging.config.file=conf/logging.properties
chemaxon.jchem.cartridge.config.JccConfigUtilCmdLine list-dba-sqls
Config file not found, running without logging.

Name of the cartridge owner [jchem]: JCHEM

The host name of the JChem Server [localhost]: jcc-vmc12.bpo.cxn

The port at which the JChem Server accepts connections [1099]: 15102

The role for basic JChem Cartridge user privileges [JCC_BASIC_ROLE]:
JCHEM_ROLE

Target Oracle version [11.2]: 11.0.3.2

====>
====>
====>---------------------------------------------------------------
====> -- Before installation:
====>---------------------------------------------------------------
====>
====> -- -------------------------- JChem Owner -----------
====> create user JCHEM identified by <password>;
====> --   For simplicity, UNLIMITED TABLESPACE is granted by default, but 100MB should be enough
====> --   on the tablespace which is made the JChem owner's default
tablespace
====> GRANT unlimited tablespace to JCHEM;
====> GRANT create session to JCHEM;
====> GRANT create table to JCHEM;
====> GRANT create sequence to JCHEM;
====> GRANT create procedure to JCHEM;
====> GRANT create trigger to JCHEM;
====> GRANT create type to JCHEM;
====> GRANT create operator to JCHEM;
====> GRANT create indextype to JCHEM;
====> call dbms_java.grant_permission('JCHEM',
'java.net.SocketPermission', 'jcc-vmc12.bpo.cxn:15102', 'connect,resolve');
====> call dbms_java.grant_permission('JCHEM',
'java.security.SecurityPermission', 'createAccessControlContext', '');
====>
====> -- -------------- Basic JChem Cartridge user role ---
====> create role JCHEM_ROLE;
====> call dbms_java.grant_permission('JCHEM_ROLE',
'java.net.SocketPermission', 'jcc-vmc12.bpo.cxn:15102', 'connect,resolve');
====> call dbms_java.grant_permission('JCHEM_ROLE',
'java.security.SecurityPermission', 'createAccessControlContext', '');
====> grant JCHEM_ROLE to JCHEM with admin option;
====>
====>---------------------------------------------------------------
====> -- After installation:
====>--------------------------------------------------------------
====> call JCHEM.privman_pkg.public_syns_for_jcobjs('JCHEM');
====>
+ set +x

7. Run sql statements mentioned at Before installation

Install
8. Run and fill the questions asked by install script. Pay attention to
answer with ! for the question: DBA login [SYSTEM]: !

.../jchem/cartridge$ ./install.sh

+ /usr/lib/jvm/java-7-oracle-1.7.0.65//bin/java -classpath
../lib/jchem.jar
-Dchemaxon.jchem.cartridge.config.file=conf/jcart.properties
-Djava.util.logging.config.class=chemaxon.jchem.cartridge.util.LoggingConfigurator
-Dchemaxon.jchem.cartridge.logging.config.file=conf/install-logging.properties
chemaxon.jchem.cartridge.install.InstallCmdLine
Config file not found, running without logging.

Database descriptor type (sid, service_name, url) [sid]:

Name of the Oracle host [localhost]: oracle10.bpo.cxn

Oracle listener port [1521]:

Name of the Oracle database (sid) [mydb]: e123

The host name of the JChem Server (fe80:0:0:0:216:3eff:fe8e:b966%16,
10.0.0.168, 0:0:0:0:0:0:0:1%1, 127.0.0.1) [localhost]: jcc-vmc12.bpo.cxn

The port at which the JChem Server accepts connections [1099]: 15102

Maximum memory allocated to the JChem Server process [700m]: 3600m

The structure cache id of this JChem Server instance [JCC1]:

====> Trying to start JChem Server...
INFO: Cache id set to JCC1
INFO: Directory licenses does not exist. Leaving it to LicenseHandler to
check the default location for licenses.
INFO: Maximum memory: 3450 MB
INFO: Listening at 15102

DBA login [SYSTEM]: !

Name of the cartridge owner [jchem]: JCHEM
Password of the cartridge owner:

Do you want a role for basic JChem Cartridge user privileges to be
created? (This role will be granted to JCHEM WITH ADMIN OPTION.
DataVault users, please, answer with "n") (y, n) [y]: n

You have entered the following parameters:
==========================================

Database descriptor type: sid
Name of the Oracle host: oracle10.bpo.cxn
Oracle listener port: 1521
Name of the Oracle database (sid): e123
The host name of the JChem Server: jcc-vmc12.bpo.cxn
The port at which the JChem Server accepts connections: 15102
Maximum memory allocated to the JChem Server process: 3600m
The structure cache id of this JChem Server instance: JCC1
DBA login: !
Name of the cartridge owner: JCHEM
Do you want a role for basic JChem Cartridge user privileges to be
created? (This role will be granted to JCHEM WITH ADMIN OPTION.
DataVault users, please, answer with "n"): n

Proceed with the Install? (y, n) [n]: y
INFO: Using chemaxon.jchem.cartridge.util.cpool.Oracle10gDataSource
INFO: JDBC driver version: 11.2.0.3.0

================================
INSTALLATION completed.
================================

Post Installation tasks
9. After the successful installation you should copy the license file to
[install_directory]/jchem/cartridge/licenses/ folder

10. start the server with command:
..jchem/cartridge$ ./server.sh start &

11. Run the following SQL statements with the users specified in the
following order:

With DBA:
call JCHEM.privman_pkg.public_syns_for_jcobjs('JCHEM');  -- if you want
to create public synonyms

-- if you already have the DWH user existing, then the create statements
should not be applied, but the grants!
create user DWH identified by <password>;
grant CONNECT, RESOURCE to DWH;
grant unlimited tablespace to DWH;

--grants needed for DWH user
ROLEs are not enough, this call must be executed!

call JCHEM.privman_pkg.grants_on_jcobjs('JCHEM', 'DWH'); 
exec dbms_java.grant_permission( 'DWH', 'SYS:java.net.SocketPermission',
'jcc-vmc12.bpo.cxn:15102', 'connect,resolve' );

create user IJC identified by <password>;
grant CONNECT, RESOURCE to IJC;
grant unlimited tablespace to IJC;
call JCHEM.privman_pkg.grants_on_jcobjs('JCHEM', 'IJC');
exec dbms_java.grant_permission( 'IJC', 'SYS:java.net.SocketPermission',
'10.0.0.168:15102', 'connect,resolve' );

With DWH:
--create Cartridge indexes needed on the structure tables using the pattern:
create index <index_name> on <table_name>(<structure_field>) indextype is JCHEM.jc_idxtype;

With DBA:
call JCHEM.privman_pkg.grants_on_jcidx('IJC', 'DWH', '<index_name>', 1, 1, 1, 1);

10. Check for search capability:
login as IJC into an SQL editor, then run:
call jchem_core_pkg.use_password('<password>');
select jchem_core_pkg.getenvironment() from dual; -- it should return
valid response
SELECT * FROM DWH.<table_name> where jc_compare(<structure_field>,
'cccccc', 't:s')=1;