Page tree
Skip to end of metadata
Go to start of metadata

Tested SQL Server Collations:

  • SQL_Latin1_General_CP1_CS_AS
  • SQL_Czech_CP1250_CS_AS

Database create

CREATE DATABASE [midpoint] 
COLLATE SQL_Latin1_General_CP1_CS_AS

ALTER DATABASE "midpoint" SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE "midpoint" SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE "midpoint" SET MULTI_USER;

CREATE LOGIN midpoint WITH PASSWORD = 'password'
USE [midpoint]
CREATE USER [midpoint] FOR LOGIN [midpoint] WITH DEFAULT_SCHEMA=[dbo]
ALTER ROLE [db_owner] ADD MEMBER [midpoint]

Configuration sample

<configuration>
  <midpoint>
    <repository>
      <repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRepositoryFactory</repositoryServiceFactoryClass>
      <database>sqlserver</database>
      <jdbcUsername>midpoint</jdbcUsername>
      <jdbcPassword>password</jdbcPassword>
      <jdbcUrl>jdbc:sqlserver://localhost:1433;database=midpoint</jdbcUrl>
    </repository>
  </midpoint>
</configuration>

Troubleshooting

Current version cannot be determined. The metadata table (m_global_metadata) is missing or inaccessible.

Log snippet:

*******************************************************************************
*** ***
*** Couldn't start midPoint because of a database schema issue. ***
*** ***
*******************************************************************************

Database schema is not compatible with the executing code.

Current version cannot be determined. The metadata table (m_global_metadata) is missing or inaccessible. This indicates the version is below 3.9.
Required version is: 4.0

Reason:

Since version 3.9, midPoint checks for presence of table m_global_metadata and will not start if table is not found.

Resolution:

However, If you have DB wrongly set - missing the ALLOW_SNAPSHOT_ISOLATION option, you will not get usual "SQLServerException: Snapshot isolation transaction failed" but rather confusing error that m_global_metadata table is missing. So you just run "ALTER DATABASE "midpoint" SET ALLOW_SNAPSHOT_ISOLATION ON;" to fix it.

Jira: 

MID-5880 - Getting issue details... STATUS

Driver

Download MS SQL JDBC Driver

When installing the driver, please use sqljdbc4.jar when your application must run on JRE 6.0 or 7.0, even if your application does not use JDBC 4.0 API features. (Quote from (MS) System requirements for the JDBC Driver.)

  • No labels