Index

Approved versions of SQL Server

To check the approved versions of Microsoft SQL Server, go to the Portability matrix

As of the Liquid (1.6.5) update, it is no longer necessary to perform any database compatibility commands.

However, if you have a previous update, you must go to the Microsoft SQL Server Management Studio and define the database compatibility level for SQL Server 2012, by running the following command:

ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL = 110

If you do not run the command, the platform’s startup process will be blocked.


Database creation

TOTVS Fluig Platform requires a database with Latin1_General_CI_AS encoding. To create the database with this characteristic, log in to SQL Server with the user that will be used by Fluig and run the following SQL command:

CREATE DATABASE database_name COLLATE Latin1_General_CI_AS;

Where database_name is the name of the database to be created.


Another alternative for the creation of the database is to use the Microsoft SQL Server Management Studio, following these steps:

Connect to the SQL Server instance through Microsoft SQL Server Management Studio, and then right-click the Databases folder and select the New Database...option.

When the wizard screen opens, select the General option in Select a page. Then, enter the desired name for the database in the Database name field and select the user that will be used by Fluig in the Owner field.

Next, select the Options option in Select a page. Then, select the Latin1_General_CI_AS value in the Grouping field.

Finally, find the option The Confirmed Reading Snapshot is Active and change its value to True. Click the OK button to finish and create the database.


Database configuration

After creating the database, you need to perform the following checks:


Database Owner

The user used by TOTVS Fluig Platform to connect to the database should be the owner (db_owner) of the database used by Fluig. To check which user is the database owner, run the following SQL command:


 SELECT suser_sname(owner_sid) FROM sys.databases WHERE name = 'database_name';

Where database_name is the name of the database to query the owner.

If the database owner is not the user used by Fluig to connect to the database, run the following T-SQL command to define this user as owner (db_owner):

  USE database_name EXEC sp_changedbowner 'user_name';

Where database_name is the database name and user_name is the user who will become the database owner.


Changing the isolation level

To check if the isolation option READ_COMMITTED_SNAPSHOT is enabled for the database, run the following SQL command: 


 SELECT is_read_committed_snapshot_on FROM sys.databases WHERE name= 'database_name';

Where database_name is the name of the database to query the owner.


If the return of the previous query is the value 0, you need to run the following SQL command:

ALTER DATABASE database_name SET READ_COMMITTED_SNAPSHOT ON;

Where database_name is the name of the database to be used for Fluig.


This SQL Server standard isolation level change operation is performed automatically by Fluig. However, it is important to pay attention to the following factor:

When creating the database, a change action is run on the database. It is normal to see some error messages in the log, in the case of a standard process for update. The situation will be normalized at the end of the operation.

As soon as the Fluig server is up, we recommend restarting it.

SQL Server 2014

If you use SQL Server 2014 or higher, you need to change the file <INSTALL_FLUIG>\jboss\bin\standalone.conf.bat (standalone.conf in Linux environments) and add the following line:

set "JAVA_OPTS=%JAVA_OPTS% -Dhibernate.dialect=org.hibernate.dialect.SQLServer2008Dialect"