Showing posts with label Database Ojects. Show all posts
Showing posts with label Database Ojects. Show all posts

Monday, March 5, 2018

java.sql.SQLException: Length of LOB data () to be replicated exceeds configured maximum 65536


We recently come across below database error when working with an application.

java.sql.SQLException: Length of LOB data (65594) to be replicated exceeds configured maximum 65536. Use the stored procedure sp_configure to increase the configured maximum value for max text repl size option, which defaults to 65536.

The maximum value for max text repl size defaults to 65536. We get this error when a truncation data size for any of the replicated text column exceeds the limit.

To check the current max text replication size run below command.

USE <DB Name>;
GO
EXEC sp_configure 'show advanced options', 1 ;
RECONFIGURE ;
GO
EXEC sp_configure 'max text repl size';
GO



Output:-
name                              minimum           maximum    config_value      run_value
max text repl size (B)     -1                      2147483647    65536                   65536

You can set the value to maximum by running below command.
EXEC sp_configure 'show advanced options', 1 ;
RECONFIGURE ;
GO
EXEC sp_configure 'max text repl size', -1 ;
GO
RECONFIGURE;
GO


Note that -1 indicates that there is no limit set for 'max text repl size' other than imposed by the data type.

You can do the same using SSMS
  1. Open SSMS and connect to Server/instance
  2. Right-click on the server/instance name and choose properties
  3. Select “Advanced” options on the properties page.
  4. Under  “Miscellaneous” header  you will see the current value of  
    “Max text replication Size”.
  5. Change the default value from 65536 to -1 or 2147483647 (depending on the SQLserver) and press OK.
 Regards
Satishbabu Gunukula

Wednesday, February 27, 2013

Understanding Indexes in SQL Server

An Index in a database lets you quickly find specific information in a table or indexed view and you can significantly improve the performance of applications and database queries by well-designed indexes to support your queries.

Visit below links to learn about different types of Indexes in SQLServer.

Understanding Indexes in SQL Server
What Should Be Indexed in SQL Server

Indexes A Closer Look in SQL Server

Clustered Indexes in SQL Server

Non-Clustered Indexes in SQL Server

New Index Features in in SQL Server 2012

Understanding SQL Server Database Objects and Data Types

Regards
Satishbabu Gunukula
http://www.oracleracexpert.com

Understand SQL Server Database Objects and Data Types

You will learn about SQL Server Database Objects and Types. Many users benefited from these videos/links and I hope it will be helpful to you.

Understanding Database & Table Normalization

Understanding SQL Server Data Types part 1

Understanding SQL Server Data Types part 2

Creating a Database

Understanding SQL Server Databases

Understanding SQL Server Tables

Understanding Primary Keys in SQL Table

Table Change Gotcha in SQL Server

Understanding SQL Server Schemas

Understanding SQL Server Synonyms

Regards,
Satishbabu Gunukula
http://www.sqlserver-expert.com