Friday, September 14, 2018

Exception: Length of LOB data (96550) to be replicated exceeds configured maximum 65536.

We got below exception recently as Lengh of LOB data to be replicated increased the configured limit 65536

Exception Thrown In InboundMessageProcessor ProcessExternalXML Method with [Error]: Internal Xml Parser Failed. Aborting Database Transaction. Current XML Node <FIInvocationSynchronousEvent>, Depth 1.

[InternalXMLParser Error]: Failed to execute business component method. Assembly: FlexNet.SVL.BusinessFacade.Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=33f692327842122b, Class: FlexNet.SVL.BusinessFacade.Utility.TableAction, MethodName: TableUpdate, Exception: Length of LOB data (96550) 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. A configured value of -1 indicates no limit, other that the limit imposed by the data type.
The statement has been terminated.

Run below command to find the falue

select * from sys.configurations
where name like 'max text repl size%';
GO

You can configure the ‘max text repl size’ to unlimited by using below command
EXEC sp_configure 'max text repl size', -1 ;
RECONFIGURE;
GO

You should be able to see updated value now.
select * from sys.configurations
where name like 'max text repl size%';
GO


I see few users complained that’s this setting lost, you can use ‘OVERRIDE’ option.
EXEC sys.sp_configure N'max text repl size (B)', N'-1'
GO
RECONFIGURE WITH OVERRIDE
GO

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

Thursday, September 6, 2018

Database "Not synchronizing / suspect" in Always On High Availability Groups

We recently configured Always On with 2 secondary servers. One secondary is synchronous commit and another with Asynchronous commit.

We are running log backup but noticed that secondary couldn’t redo the log at secondary and kept on piling the log and the drive got full.

Run below command to see what log is not clearing out
SELECT name, log_reuse_wait_desc FROM sys.databases WHERE name = 'HRDB';

Name    log_reuse_wait_desc
--------  -------------------------------
HRDB    AVAILABILITY_REPLICA

For short term add space or you might have to remove database from AlwaysOn Group and add it back. 

In the log we see “Could not redo log record” message 

Could not redo log record (40557:30625:14), for transaction ID (0:196794283), on page (1:1033), allocation unit 72058591529205760, database 'HRDB' (database ID 7). Page: LSN = (40557:30379:326), allocation unit = 72058646460891136, type = 10. Log: OpCode = 7, context 10, PrevPageLSN: (40557:30625:12). Restore from a backup of the database, or repair the database.

After troubleshooting it looks like a Bug and need to apply Cumulative patch

https://support.microsoft.com/en-us/help/3173471/fix-could-not-redo-log-record-error-and-replica-is-suspended-in-sql-se

Thanks
Satishbabu Gunukula
http://www.sqlserver-expert.com

Tuesday, May 1, 2018

How to determine SQLServer Edition

There are many ways you can find the SQLServer edition and version

Please find few methods

1. Connect to SQLServer Instance and run below command
Select @@version

2. Use a SQL Script
Refer link https://gallery.technet.microsoft.com/Determining-which-version-af0f16f6

3. Using Power Shell
Refer link
https://gallery.technet.microsoft.com/Determining-the-version-of-62136c05

4. Open SQL Server Configuration Manager
  • Highlight SQLServer Services 
  •  Go to Properties à Advanced 
  •  Brose to “Stock keeping unit name” and “Version” 
Thanks
Satishbabu Gunukula

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

Thursday, February 8, 2018

The multi-part identifier "syncobj_" could not be bound


We recently got the below error while executing the a procedure on SQLServer

The multi-part identifier "syncobj_0x3946443335424338.DF_286" could not be bound. (Tested Started By)
Processing...           TAB(13) Complaints 2 - V_TAB_13
The multi-part identifier "syncobj_0x3946443335424338.DF_455" could not be bound. (Test Completed By)
Processing...           TAB(14) Complaints 3 - V_TAB_14
The multi-part identifier "syncobj_0x3946443335424338.DF_280" could not be bound. (Test Submitted By)
Processing...           TAB(15) ASR - V_TAB_15
The multi-part identifier "syncobj_0x3946443335424338.DF_445" could not be bound. (Test Approved By)

The error is confusing becoz the “syncobj_” are related to replication snapshot. Why the procedure calling those objects.

After investigation found that user querying column info from  information_schema.columns in the procedure and there is no filter.

We have added a filter “table_name not like 'syncobj%' " to exclude the “syncobj_” and the procedure is working fine without any issues.

The issue has been resolved.

Thanks,
Satishbabu Gunukula
http://sqlserver-expert.com



Wednesday, January 10, 2018

Cluster network name resource failed to create its associated computer object in domain

Users might receive below error during the SQLServer failover cluster installation.

Cluster network name resource SQLINST1' failed to create its associated computer object in domain ‘test.domain.com' for the following reason: Unable to create computer account.

The text for the associated error code is: Access is denied.

Please work with your domain administrator to ensure that:
- The cluster identity 'SQLCLUSTER$' can create computer objects. By default all computer objects are created in the 'Computers' container; consult the domain administrator if this location has been changed.
- The quota for computer objects has not been reached.
- If there is an existing computer object, verify the Cluster Identity 'SQLCLUSTER$' has 'Full Control' permission to that computer object using the Active Directory Users and Computers tool.


You will receive above error because the user that you are running the installation does not have proper privileages to create computer object in the domain.

Ask your system admin either grant the permissions or create the computer object in advance. Once your System admin creates the computer object, you retry the installation and It should work successfully.

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

The action 'Move' did not complete

User might see below error when trying to failover the SQLServer instance from one node to another node. User might have recently installed a SQLServer cluster which has more than 1 node.

SQL Server cluster failover fails with Error Code: 0x80071398



The main reason for this error is the node where you are trying to failover might NOT the owner.

You need to verify all nodes in the Cluster are selected as Owenrs under “SQLServer Virtual Name” properties. As you see below screen shot, 2 nodes are not not part of the cluster . Once you check the box you will be able to failover SUCCESSFULLY without any issues.





Thanks
Satishbabu Gunukula
https://sqlserver-expert.com

Friday, December 23, 2016

error while loading shared libraries: libodbc.so.1

When working with UNIXODBC to connect to Microsoft SQLServer received following error

ERROR Database connection TEST: ADBC error 'Internal error         16  has occured'

I receive below error when using isql-v to test the connection

error while loading shared libraries: libodbc.so.1: cannot open shared object file: No such file or directory

I found that soft links are missing and after creating below links everything started working

Issue resolved after creating below soft links
# ln -s /usr/lib64/libodbc.so.2.0.0 /usr/lib64/libodbc.so.1
# ln -s /usr/lib64/libodbcinst.so.2.0.0 /usr/lib64/libodbcinst.so.1

Regards.
Satishbabu Gunukula

Monday, October 17, 2016

[01000][unixODBC][Driver Manager]Can't open lib

I was testing unixODBC configuration to connect to SQLServer Database and received below error message

$ isql -v test_ds test_username test_password
[01000][unixODBC][Driver Manager]Can't open lib '/u01/boxi/app/testsrv/sap_bobj/enterprise_xi40/linux_x64/odbc/lib/CRsqls24.so' : file not found
[ISQL]ERROR: Could not SQLConnect


It looks like path does not exists, lets verify

ls: cannot access /u01/boxi/app/testsrv/sap_bobj/enterprise_xi40/linux_x64/odbc/lib/CRsqls24.so: No such file or directory

The patch does not exist, so update the correct path in odbc.ini and ran “isql –v” to test the connectivity

$ isql -v test_ds test_username test_password
[01000][unixODBC][Driver Manager]Can't open lib '/u01/boxi/app/testsrv/sap_bobj/enterprise_xi40/linux_x64/odbc/7.0.1/lib/CRsqls26.so' : file not found
[ISQL]ERROR: Could not SQLConnect


After updating correct library path, I still see same error. It looks like the environment variables might not set properly. I have verified the LD_LIBRARY_PATH and I see that path does not have right lib info.

After updating LD_LIBRARY_PATH with right library path I was able to connect successfully.

$ isql -v test_ds test_username test_password 
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> quit

Regards,
Satishbabu Gunukula


Friday, October 7, 2016

Error converting data type varchar to numeric

I was working on an ETL load and I come across below error when loading data from one table another table.

Error converting data type varchar to numeric

I see that the source table has data type VARCHAR and Target table has data type INTEGER

Source Table: Employee_X
EMPLOYEE_ID VARCHAR(50)
EMPLOYEE_NAME VARCHAR(50)
COSTCODE VARCHAR(50)

Target Table: Employee_Y
EMPLOYEE_ID INT
EMPLOYEE_NAME VARCHAR2 (50)
COSTCODE INT

I have used CAST function in the insert command and able to load data successfully

Insert into Employee_Y (EMPLOYEE_ID, EMPLOYEE_NAME, COSTCODE)
SELECT cast(EMPLOYEE _ID as INT) as EMPLOYEE_ID,
               EMPLOYEE_NAME,
               cast(COSTCODE as INT) as COSTCODE,
FROM Employee_X;

Regards
Satishbabu Gunukula


Wednesday, February 17, 2016

VIEW SERVER STATE permission was denied on object ‘server’, database ‘master’.

With one of the application I have seen below error when working with SQL Server

VIEW SERVER STATE permission was denied on object ‘server’, database ‘master’ ( Microsoft SQL Server , Error: 300)

The issue is user don’t have VIEW SERVER STATE permission. Note that this will allow an auditing process to view all data or all database states on the instance of SQL Server.

The below command should solve the issue, but before you grant make sure you understand the implications of granting the below permission.

USE MASTER
GO
GRANT VIEW SERVER STATE TO <username>


Regards,
Satishbabu Gunukula



Wednesday, September 30, 2015

The cluster resource 'SQL Server (SQL2014)' could not be brought online due to an error bringing the dependency resource 'SQL Network Name (SQL2014)'


Users will face this common issue during SQL Server Failover Cluster installation. Note that SQL Server Engine service is always dependent on Network Name resource. The network resource failure can result the SQL Server resource not coming online.

User may see below messages in system log

Cluster network name resource 'SQL Network Name (SQL2014)' failed to create its associated computer object in domain sqlserver-expert.com' during: Resource online.

The text for the associated error code is: Access is denied.

Please work with your domain administrator to ensure that:
- The cluster identity 'SQL2014$' has Create Computer Objects permissions. By default all computer
objects are created in the same container as the cluster identity 'SQL2014$'.
- The quota for computer objects has not been reached.
- If there is an existing computer object, verify the Cluster Identity 'SQL2014$' has 'Full Control' permission to that computer object using the Active Directory Users and Computers tool.

The main cause for this error is insufficient permission to create computer objects. You have two options to resolve this error.

1. Ask your Windows Admin to grant permission “Read all properties” and “Create Computer Objects to the CNO via the container.

Or

2. Ask your Windows Admin to create required computer objects.

You can refer below link for more info

http://blogs.msdn.com/b/psssql/archive/2013/09/30/error-during-installation-of-an-sql-server-failover-cluster-instance.aspx

Regards,
Satishbabu Gunukula

Monday, September 14, 2015

User domain\user does not have required permissions during SSRS configuration

I have installed SQL Server Reporting Services and configuration went smoothly. But I have received below error while trying to open the Repots URL i.e http://servername/Reports

User domain\user does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed

Below posts helped me to resolve the issue.

https://social.msdn.microsoft.com/forums/sqlserver/en-US/9b5a8763-84ce-46d0-b011-067ad39223d1/does-not-have-required-permissions

https://social.technet.microsoft.com/Forums/systemcenter/en-US/313e2166-1956-4dd0-a694-0b506e1ddba9/srs-reporting-permission-error

I hope this will help for you.

Regards,
Satishbabu Gunukula



Thursday, September 10, 2015

Uninstall SQLServer Reporting Services

Reporting Service feature can be uninstalled though Control Panel, Program and Features. When you uninstall reporting service, the RS configuration files, database files, content and repots left in place. User need to cleanup manually.

To uninstall Reporting Services Native mode follow the steps

1. Control Panel, Click ‘Programs and Features’

2. Select ‘Microsoft SQL Server 2014 (64bit)’ click Uninstall/Change à Select Remove Option

3. Select the instance to remove from


4. Next screen select the Reporting Service that you want to remove


5. Complete the removal process.

Regards,
Satishbabu Gunukula

Tuesday, September 1, 2015

There are no SQL Server instances or shared features that can be updated on this computer


Recently I have installed a new instance (SQL Server 2008 ) on a 2 node SQL Server cluster. When I am trying to apply Cumulative update 7 for SP2, the check box is grayed out and not able to select the check box for newly created instance and received following error

There are no SQL Server instances or shared features that can be updated on this computer.

I didn’t not receive any error during the instance creation, didn’t see any error messages in the event viewer. It looks the issue is with version, need to find the version information.

When I click on the instance to find the version information, I see a version miss match message in the description.

The version of SQL Server instance TEST does not match the version expected by the SQL Server upgrade. The installed SQL Server product version is 10.1.2531.0, and the expected SQL Server version is 10.2.4000.0


 It is very clear that before installing the Cumulative update 7 for SP2, we need to bring the version up to 10.2.4000.0.

I have installed SP2 first and I was able to apply Cumulative update 7 for SP2 successfully.

Regards,
Satishbabu Gunukula

Tuesday, July 21, 2015

Free e-Book: Microsoft System Center: Optimizing Service Manager

This fee e-Book "Microsoft System Center: Optimizing Service Manager" written by Rushi Faldu, Manish Raval, Brandon Linton, Kaushal Pandey and series editor Mitch Tulloch

This book delivers a focused drilldown on using Configuration Manager for queries and custom reporting, with scenario-based guidance for deployment success. Written by experts on the Microsoft System Center team and with Microsoft MVP Mitch Tulloch as series editor, this title provides concise, from-the-field guidance as you step through key concepts and tasks.

You can download the e-Book 

1. PDF version of this title here
2. The EPUB format is here and Mobi for Kindle file here
Regards,
Satishbabu Gunukula
http://www.sqlserver-expert.com

Thursday, July 9, 2015

Introducing Windows 10 for IT Professionals, Preview Edition

This fee e-Book "Introducing Windows 10 for IT Professionals" written by Ed Bott .

Get a head start evaluating Windows 10—with early technical insights from award-winning journalist and Windows expert Ed Bott. This guide introduces new features and capabilities, providing a practical, high-level overview for IT professionals ready to begin deployment planning now. This book is a preview, a work in progress about a work in progress. It offers a snapshot of the Windows 10 Technical Preview as of April 2015, on the eve of the BUILD Developers’ Conference in San Francisco.

Chapter 1: An overview of Windows 10 Technical Preview
 

Chapter 2: The Windows 10 user experience

Chapter 3: Installing and deploying the Windows 10 Technical Preview

Chapter 4: Security in Windows 10

Chapter 5: Deploying and managing Windows Store apps

Chapter 6: Web browsing and Windows 10

Chapter 7: Windows 10 networking
 

Chapter 8: Visualization and remote access

Chapter 9: Backup and recovery options in Windows 10

Chapter 10: Windows 10 on phones and small tablets


You can download the e-Book 

1. PDF version of this title here
2. The EPUB format is here and Mobi for Kindle file here


Regards

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

Thursday, May 14, 2015

Free e-Book: Introducing Microsoft SQL Server 2014

This fee e-Book "Introducing Microsoft SQL Server 2014" – by Ross Mistry and Stacia Misner .

Microsoft SQL Server 2014 is the next generation of Microsoft’s information platform, with new features that deliver faster performance, expand capabilities in the cloud, and provide powerful business insights.

In this book, we explain how SQL Server 2014 incorporates in-memory technology to boost performance in online transaction processing (OLTP) and data-warehouse solutions. We also describe how it eases the transition from on-premises solutions to the cloud with added support for hybrid environments.

SQL Server 2014 continues to include components that support analysis, although no major new features for business intelligence were included in this release. However, several advances of note have been made in related technologies such as Microsoft Excel 2013, Power BI for Office 365, HDInsight, and PolyBase, and we describe these advances in this book as well.

The book includes below chapters:

Database AdministrationChapter 1: SQL Server 2014 editions and engine enhancements
Chapter 2: In-Memory OLTP investments
Chapter 3: High-availability, hybrid-cloud, and backups enhancements

Business intelligence DevelopmentChapter 4: Exploring self-service BI in Microsoft Excel 2013
Chapter 5: Introducing Power BI for Office 365
Chapter 6: Big Data Solutions

You can download the e-Book 

1. PDF version of this title here
2. The EPUB format is here and Mobi for Kindle file here

Regards
Satishbabu Gunukula