No Managed Connections. Steps to enable Read Committed Snapshot Isolation- MSSQL

No Managed Connections. Steps to enable Read Committed Snapshot Isolation- MSSQL

Enabling Read Committed Snapshot Isolation in MS SQL server
In MS SQL environments enabling 'Read committed Snapshot isolation (RCSI)' is the first step in handling application server performance and crash issues.

What is RCSI?
  

Since databases handle multiple transactions in parallel, there has to be a mechanism to handle concurrent reads and writes in the database. For example, if one transaction is running a update query and other transaction is executing a select query then, whether the select query should be able to see the newly updated value or the old value? Or should the select query transaction wait till the update query transaction completes? These are some of the questions that are answered based on the concurrency model that is being used. There are 2 concurrency models.
1. Optimistic concurrency control  
2. Pessimistic concurrency control  

In pessimistic model, transactions lock the rows that they are reading or modifying so that other transactions have to wait till this transaction completes to access the rows.

In optimistic model, the rows are not locked. Two transactions can simultaneously read/update a row. Only if there are any conflicting updates identified, then one of the transactions is rolled back. Since there is no locks involved in this model, this performs much better than the former.  

Postgres database by default has optimistic model. SQL server on the other hand was originally designed using pessimistic model but due to performance problems in it an option was later provided in SQL server to enable optimistic concurrency control. This is called read committed snapshot isolation.

How to verify / enable RCSI  

To check whether RCSI has been enabled:  

SELECT is_read_committed_snapshot_on FROM sys.databases WHERE [name] = '<db_name>'
If this returns 1 then RCSI is enabled. If not, follow the below instructions to enable it.  

Instructions to enable RCSI:   

This process might take considerable amount of time to complete. Please do this on a weekend / during off hours as it requires downtime.  
   
1. Shut down the ServiceDesk Plus service. If any other application (maybe reporting tools) connects to servicedesk database, you need to stop them too.  

2. Please login to SQL Management studio and execute the below queries...  

      i. take the database offline
USE master 
GO 
ALTER DATABASE <db_name> SET OFFLINE WITH ROLLBACK IMMEDIATE 
GO

      ii. enable read committed snapshot  
ALTER DATABASE <db_name> SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE 
GO

      iii. bring database back online  
USE master
 GO
 ALTER DATABASE <db_name> SET ONLINE 
GO

3. Please verify whether RCSI is enabled using the query mentioned at the top. You may start ServiceDesk Plus now.  


Reference:  

Understanding RCSI :  

How to take database offline and bring it back online :   

    • Related Articles

    • Performance issues and NMC's post upgrade to 9306. (XSSMigrationSchedule , cleanSoftwareCIs)

      Team,  We are recently facing performance and crash (NMC) issues after upgrading to recent versions (9306 and above). Seems like there are few new schedules introduced which might be causing the issue.  Two of them are "CleansoftwareCIs" and ...
    • Steps to be followed for FOS Crash Issue

      Kindly enable the access logger of Tomcat of the product. This can be done by modifying the <MASTER_prod_home>/conf/server.xml file. Have a BACKUP of this file by creating a COPY of it before doing any modifications. 1) Search for "access log" string ...
    • Upgrade failure from 9009 to 9200

      Error trace: [com.adventnet.servicedesk.updatemgr.util.SDPostProcessor] [INFO] : Problem during installation of patch {0}java.sql.SQLException: Cannot find the object "PgSQLErrorCode" because it does not exist or you do not have permissions. Cause: ...
    • How to address Performance issue ?

      Application will face the performance issue because of couple of reasons. 1. Application is not tuned properly. - To fix this - Please refer this tuning steps and do it. 2. Email debug present under Admin -> Mail server settings is enabled for mail ...
    • Skip forced backup before upgrade

      Please ensure there is a recent VM backup/snapshot or a valid SQL backup or PGSQL backup that was taken just before the upgrade and then skip application backup. For 9000 Upgrade: Edit the batch file called 'Updatemanager.bat' found under ...