If you want to change the database for the JobScheduler then follow these steps.
- Create the new database
- Stop the JobScheduler
- Configure the new database connection data in the following files:
- ./config/factory.ini (For JobScheduler tables like SCHEDULER_HISTORY. See factory.ini)
- ./config/hibernate.cfg.xml (Used by JID and some JITL jobs)
- ./config/sos_settings.ini (Used by the script ./install/scheduler_install_tables.(sh|cmd) and some JITL jobs)
- Call the script ./install/scheduler_install_tables.sh (for Unix) or ./install/scheduler_install_tables.cmd (for Windows).
This script executes the sql files in ./db/[dbms]/ to create the database tables.
- Start the JobScheduler
Examples for the Configuration of factory.ini, hibernate.cfg.xml and sos_settings.ini
MySQL
factory.ini:
[spooler] ... db = jdbc -class=com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=scheduler -password=scheduler db_class = SOSMySQLConnection ...
hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
sos_settings.ini:
[configuration] class = SOSMySQLConnection driver = com.mysql.jdbc.Driver url = jdbc:mysql://localhost:3306/scheduler user = scheduler password = scheduler compatibility = normal
MySQL via mariaDB
factory.ini:
[spooler] ... db = jdbc -class=org.mariadb.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=scheduler -password=scheduler db_class = SOSMySQLConnection ...
hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
sos_settings.ini:
[configuration] class = SOSMySQLConnection driver = org.mariadb.jdbc.Driver url = jdbc:mysql://localhost:3306/scheduler user = scheduler password = scheduler compatibility = normal
Oracle
factory.ini:
[spooler] ... db = jdbc -class=oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@localhost:1521:scheduler -user=scheduler -password=scheduler db_class = SOSOracleConnection ...
hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
sos_settings.ini:
[configuration] class = SOSOracleConnection driver = oracle.jdbc.driver.OracleDriver url = jdbc:oracle:thin:@localhost:1521:scheduler user = scheduler password = scheduler compatibility = normal
Microsoft SQL Server
factory.ini:
[spooler] ... db = jdbc -class=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection ...
hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
sos_settings.ini:
[configuration] class = SOSMSSQLConnection driver = com.microsoft.sqlserver.jdbc.SQLServerDriver url = jdbc:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler user = scheduler password = scheduler compatibility = normal
Microsoft SQL Server via jTDS
factory.ini:
[spooler] ... db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection ...
hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
sos_settings.ini:
[configuration] class = SOSMSSQLConnection driver = net.sourceforge.jtds.jdbc.Driver url = jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler user = scheduler password = scheduler compatibility = normal
Microsoft SQL Server via jTDS
factory.ini:
[spooler] ... db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection ...
hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
sos_settings.ini:
[configuration] class = SOSMSSQLConnection driver = net.sourceforge.jtds.jdbc.Driver url = jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler user = scheduler password = scheduler compatibility = normal
- appdata_path/config/factory.ini
For JobScheduler tables like SCHEDULER_HISTORY. See [factory.ini|http://www.sos-berlin.com/doc/en/scheduler.doc/factory_ini_spooler.xml#setting_db]
Example for MySQL
db = jdbc -class=com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=scheduler -password=scheduler db_class = SOSMySQLConnection
Example for MySQL via mariaDB
db = jdbc -class=org.mariadb.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=scheduler -password=scheduler db_class = SOSMySQLConnection
Example for Oracle
db = jdbc -class=oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@localhost:1521:scheduler -user=scheduler -password=scheduler db_class = SOSOracleConnection
Example for Microsoft SQL Server
db = jdbc -class=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection
Example for Microsoft SQL Server via jTDS
db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection
Example for PostgreSQL
db = jdbc -class=org.postgresql.Driver jdbc:postgresql://localhost:5432/scheduler -user=scheduler -password=scheduler db_class = SOSPgSQLConnection
Example for Firebird
db = jdbc -class=org.firebirdsql.jdbc.FBDriver jdbc:firebirdsql://localhost:3050/scheduler -user=scheduler -password=scheduler db_class = SOSFbSQLConnection
Example for DB2
db = jdbc -class=com.ibm.db2.jcc.DB2Driver jdbc:db2://localhost:50000/scheduler:driverType=2;retrieveMessagesFromServerOnGetMessage=true; -user=scheduler -password=scheduler db_class = SOSDB2Connection
Example for Sybase
db = jdbc -class=com.sybase.jdbc3.jdbc.SybDriver jdbc:sybase:Tds:localhost:5000/scheduler -user=scheduler -password=scheduler db_class = SOSSybaseConnection
Example for Sybase via jTDS
db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sybase://localhost:5000/scheduler -user=scheduler -password=scheduler db_class = SOSSybaseConnection
- appdata_path/config/hibernate.cfg.xml
Used by JID and some JITL jobs.
Example for MySQL
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">$\{jdbcConnectionDriver\}</property> <property name="hibernate.connection.password">$\{databasePassword\}</property> <property name="hibernate.connection.url">$\{jdbcConnectionUrl\}</property> <property name="hibernate.connection.username">$\{databaseUser\}</property> <property name="hibernate.dialect">$\{hibernateDialect\}</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
Example for MySQL via mariaDB
db = jdbc -class=org.mariadb.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=scheduler -password=scheduler db_class = SOSMySQLConnection
Example for Oracle
db = jdbc -class=oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@localhost:1521:scheduler -user=scheduler -password=scheduler db_class = SOSOracleConnection
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="hibernate.connection.password">scheduler</property> <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:scheduler</property> <property name="hibernate.connection.username">scheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> </session-factory> </hibernate-configuration>
Example for Microsoft SQL Server
db = jdbc -class=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection
Example for Microsoft SQL Server via jTDS
db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=scheduler -password=scheduler db_class = SOSMSSQLConnection
Example for PostgreSQL
db = jdbc -class=org.postgresql.Driver jdbc:postgresql://localhost:5432/scheduler -user=scheduler -password=scheduler db_class = SOSPgSQLConnection
Example for Firebird
db = jdbc -class=org.firebirdsql.jdbc.FBDriver jdbc:firebirdsql://localhost:3050/scheduler -user=scheduler -password=scheduler db_class = SOSFbSQLConnection
Example for DB2
db = jdbc -class=com.ibm.db2.jcc.DB2Driver jdbc:db2://localhost:50000/scheduler:driverType=2;retrieveMessagesFromServerOnGetMessage=true; -user=scheduler -password=scheduler db_class = SOSDB2Connection
Example for Sybase
db = jdbc -class=com.sybase.jdbc3.jdbc.SybDriver jdbc:sybase:Tds:localhost:5000/scheduler -user=scheduler -password=scheduler db_class = SOSSybaseConnection
Example for Sybase via jTDS
db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sybase://localhost:5000/scheduler -user=scheduler -password=scheduler db_class = SOSSybaseConnection
- appdata_path/config/sos_settings.ini
Used by some JITL jobs.
[configuration] class = SOSOracleConnection driver = oracle.jdbc.driver.OracleDriver url = jdbc:oracle:thin:@dbServer:1521:dbName user = dbUser password = dbPwd compatibility = normal
- install_path/web/custom/custom_inc.php
If you are using the "managed job interface". See Chapter 4.
// database authorization if(!defined('APP_CONNECTION_AUTH')) \{ define ( 'APP_CONNECTION_AUTH', '-db=test -user=scheduler -password=scheduler -host=8of9' ); \}