Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:mssql_database_support [2019/01/29 08:01] kotisovam [MsSQL: Run CzechIdM with MsSQL database] |
tutorial:adm:mssql_database_support [2019/05/06 11:53] kopro [Develop CzechIdM with MsSQL and a docker] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== MsSQL: Run CzechIdM with MsSQL database ====== | ====== MsSQL: Run CzechIdM with MsSQL database ====== | ||
+ | {{tag> sqlserver sql mssql install database supported drivers}} | ||
The tutorial describes how to run CzechIdM with a Microsoft SQL Server. When following the tutorials [[tutorial: | The tutorial describes how to run CzechIdM with a Microsoft SQL Server. When following the tutorials [[tutorial: | ||
Line 5: | Line 6: | ||
<note important> | <note important> | ||
+ | <note important> | ||
+ | |||
+ | ----- | ||
+ | ALTER DATABASE bcv\_idm\_storage SET READ\_COMMITTED\_SNAPSHOT ON; | ||
+ | |||
+ | ALTER DATABASE bcv\_idm\_storage SET ALLOW\_SNAPSHOT\_ISOLATION ON; | ||
+ | ----- | ||
+ | |||
+ | Otherwise you risk deadlock on database.</ | ||
===== Setup MsSQL with CzechIdM ===== | ===== Setup MsSQL with CzechIdM ===== | ||
==== Create database ==== | ==== Create database ==== | ||
- | There is script for setup database for CzechIdM. Please follow these instructions. If you skip some query CzechIdM | + | There is a script for setting up a database for CzechIdM. Please follow these instructions. If you omit any of the statements, |
<code sql> | <code sql> | ||
-- create database | -- create database | ||
Line 17: | Line 27: | ||
ALTER DATABASE bcv_idm_storage SET READ_COMMITTED_SNAPSHOT ON; | ALTER DATABASE bcv_idm_storage SET READ_COMMITTED_SNAPSHOT ON; | ||
GO | GO | ||
- | -- allow snapshot isolation - setting | + | -- allow snapshot isolation - setting |
ALTER DATABASE bcv_idm_storage SET ALLOW_SNAPSHOT_ISOLATION ON; | ALTER DATABASE bcv_idm_storage SET ALLOW_SNAPSHOT_ISOLATION ON; | ||
GO | GO | ||
Line 23: | Line 33: | ||
USE bcv_idm_storage; | USE bcv_idm_storage; | ||
GO | GO | ||
- | -- create login, login is used for connect | + | -- create login, login is used for connecting |
CREATE LOGIN idmadmin WITH PASSWORD = ' | CREATE LOGIN idmadmin WITH PASSWORD = ' | ||
GO | GO | ||
- | -- create user, user will be used for connect to database | + | -- create |
CREATE USER idmadmin FOR LOGIN idmadmin; | CREATE USER idmadmin FOR LOGIN idmadmin; | ||
GO | GO | ||
- | -- create schema | + | -- create |
CREATE SCHEMA bcv_idm_storage AUTHORIZATION idmadmin; | CREATE SCHEMA bcv_idm_storage AUTHORIZATION idmadmin; | ||
GO | GO | ||
- | -- set default schema | + | -- set a default schema |
ALTER USER idmadmin WITH DEFAULT_SCHEMA = bcv_idm_storage; | ALTER USER idmadmin WITH DEFAULT_SCHEMA = bcv_idm_storage; | ||
GO | GO | ||
- | -- grant permision | + | -- grant permission |
GRANT ALTER, CONTROL, CREATE SEQUENCE, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, TAKE OWNERSHIP, UPDATE, VIEW CHANGE TRACKING, VIEW DEFINITION ON SCHEMA:: | GRANT ALTER, CONTROL, CREATE SEQUENCE, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, TAKE OWNERSHIP, UPDATE, VIEW CHANGE TRACKING, VIEW DEFINITION ON SCHEMA:: | ||
GO | GO | ||
Line 46: | Line 56: | ||
</ | </ | ||
- | ==== Download JDBC driver ==== | + | ==== Download |
- | Please download JDBC driver for MsSQL. For example: [[http:// | + | Please download |
- | The driver | + | The driver must be placed for example into */ |
==== Add connection to property file (application.properties) ==== | ==== Add connection to property file (application.properties) ==== | ||
- | Is required add correct | + | The correct |
Example settings: | Example settings: | ||
Line 66: | Line 76: | ||
</ | </ | ||
- | Example use JDBC driver [[http:// | + | An example of using a JDBC driver [[http:// |
- | ==== Setup scheduler | + | ==== Scheduler setup (quartz.properties) ==== |
- | For full example please visit github page with [[https:// | + | For full example please visit the github page with [[https:// |
- | There is two propeties that is different: | + | There are two propeties that are different: |
<code properties> | <code properties> | ||
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.MSSQLDelegate | org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.MSSQLDelegate | ||
Line 87: | Line 97: | ||
* *Not fully tested* [[https:// | * *Not fully tested* [[https:// | ||
- | ===== Not Supported | + | ===== Not supported |
* [[https:// | * [[https:// | ||
- | ===== Develop CzechIdM with MsSQL and Docker | + | ===== Develop CzechIdM with MsSQL and a docker |
+ | Beware this is recommended only for develop. | ||
- | Run lasted MsSQL database (change SA-PASSWORD): | + | Run lasted MsSQL database (change |
$ docker run --name=test-mssql -e ' | $ docker run --name=test-mssql -e ' | ||
- | Copy initial script (init script is described | + | Copy the initial script (init script is described |
$ docker cp import.sql test-mssql:/ | $ docker cp import.sql test-mssql:/ | ||
- | Run init script in docker (change SA-PASSWORD): | + | Run the init script in the docker (change SA-PASSWORD): |
$ docker exec test-mssql / | $ docker exec test-mssql / | ||