VS Shell installation has failed with exit code 1638

-> SQL Server 2016 installation failed with below error,

TITLE: Microsoft SQL Server 2016 Setup
——————————
The following error has occurred:
VS Shell installation has failed with exit code 1638.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.5026.0&EvtType=0x5B39C8B9%25401434%25403
——————————
BUTTONS:
OK
——————————

-> In my case, all components completed fine except Integration Services. Below was the error found during setup for Integration services,

Action required:
Use the following information to resolve the error, and then try the setup process again.
Feature failure reason:
An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Error details:
§ Error installing Microsoft Visual C++ 2015 Redistributable
VS Shell installation has failed with exit code 1638.
Error code: 1638
Log file: C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20191119_153017\VCRuntime140_x64_Cpu64_1.log
Visit http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.5026.0&EvtType=VCRuntime140_x64%40Install%400×1638 to get help on troubleshooting.
Product Update:
Product Update has successfully applied KB 4052908 <http://support.microsoft.com/?id=4052908&gt;. These updates have set the patch level of the Setup operation to 13.2.5026.0.

-> Above error is pretty clear that it is not able to install Microsoft Visual C++ 2015 Redistributable.

-> Details.txt contained below message/error,

(04) 2019-11-19 15:42:11 Slp: The directory monitor thread is interrupted due to the following exception while monitoring the notifications for directory ‘C:\Program Files\Microsoft SQL Server\’
(04) 2019-11-19 15:42:11 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(04) 2019-11-19 15:42:11 Slp: Inner exceptions are being indented
(04) 2019-11-19 15:42:11 Slp:
(04) 2019-11-19 15:42:11 Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException
(04) 2019-11-19 15:42:11 Slp: Message:
(04) 2019-11-19 15:42:11 Slp: The directory monitor thread is interrupted. Message: ‘The directory monitor thread is interrupted due to a StopMonitor call.’
(04) 2019-11-19 15:42:11 Slp: HResult : 0x86a40016
(04) 2019-11-19 15:42:11 Slp: FacilityCode : 1700 (6a4)
(04) 2019-11-19 15:42:11 Slp: ErrorCode : 22 (0016)
(04) 2019-11-19 15:42:11 Slp: Data:
(04) 2019-11-19 15:42:11 Slp: ErrorMessage = The directory monitor thread is interrupted due to a StopMonitor call.
(04) 2019-11-19 15:42:11 Slp: WatsonData = Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException@22
(04) 2019-11-19 15:42:11 Slp: Stack:
(04) 2019-11-19 15:42:11 Slp: at Microsoft.SqlServer.Configuration.Sco.DirectoryMonitor.Monitor()

-> Tried this article. But Integration Services installation failed again with same error.

-> Checked Add/Remove programs for list of “Microsoft Visual C++ ….” installation and I could see Visual C++ 2013, 2015, 2017 Redistributable  installed.

-> I was installing SQL Server 2016 on a new server with no other SQL Server instances. So i thought of uninstalling Microsoft Visual C++ 2015, 2017 Redistributable both X64, X86 and start the install again. But, I couldn’t uninstall from Add/Remove programs.

-> When I click on Microsoft Visual C++ 2015, 2017 Redistributable and clicked on Modify or Uninstall, nothing happened. Couldn’t see any uninstall/Modify dialog box coming up. I even tried that after restarting the server, but no luck.

-> Executed below from administrative command prompt.


"C:\ProgramData\Package Cache\{80586c77-db42-44bb-bfc8-7aebbb220c00}\VC_redist.x64.exe" /uninstall

"C:\ProgramData\Package Cache\{3ee5e5bb-b7cc-4556-8861-a00a82977d6c}\VC_redist.x64.exe" /uninstall

"C:\ProgramData\Package Cache\{206898cc-4b41-4d98-ac28-9f9ae57f91fe}\VC_redist.x86.exe" /uninstall

"C:\ProgramData\Package Cache\{6c6356fe-cbfa-4944-9bed-a9e99f45cb7a}\VC_redist.x64.exe" /uninstall

-> Please note that, I performed above action as this was a new database server and had no worries of any existing SQL Server instances.

-> Rebooted the server and performed the SQL Server Integration Services install again and this time it installed just fine.

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.

Removing IAM page %S_PGID failed because someone else is using the object that this IAM page belongs to

-> I was executing DBCC SHRINKFILE as an one time operation on a huge data file to move its data into 4 additional data files using below command,

USE [Financedb]
GO

DBCC SHRINKFILE (N'Finance_Data' , EMPTYFILE)
GO

-> I received below error when executing above command,

Msg 1119, Level 16, State 1, Line 20
Removing IAM page (3:5940460) failed because someone else is using the object that this IAM page belongs to.

-> I executed DBCC CHECKDB and there were no errors,

DBCC results for ‘Financedb‘.
.
.
CHECKDB found 0 allocation errors and 0 consistency errors in database Financedb.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

-> This is not a corruption issue. I restarted SQL Services and executed below command and it ran through.

USE [Financedb]
GO
DBCC SHRINKFILE (N'Finance_Data' , EMPTYFILE)
GO

Msg 2555, Level 16, State 1, Line 20
Cannot move all contents of file “Finance_Data” to other places to complete the emptyfile operation.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

-> Above message is due to the fact that System objects cannot be moved.

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.

MYSQL Linked server in SQL Server

-> Download the installation file of MySQL Connector/ODBC 5.3 from https://dev.mysql.com/downloads/connector/odbc/5.3.html.

Blog77_1Blog77_2Blog77_3Blog77_4Blog77_5

-> Once installed, create a System DSN in ODBC Data Sources (64-bit) as below,

Blog77_6Blog77_7Blog77_8Blog77_9

-> Select the required database and test the connection to ensure it works.

-> Once the datasource is created. Create a linked server as below,

Blog77_10Blog77_11

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.