-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index optimize procedure with update statistics on memory optimized tables fails #821
Comments
Hi, Script call: @databases = 'DB', @FragmentationLow = NULL , @FragmentationMedium = NULL , @FragmentationHigh = NULL , @UpdateStatistics = 'ALL' , @OnlyModifiedStatistics = N'Y' , @LogToTable = N'Y'; Result: |
Hi, It's necessary to add in code of optimize: "AND tables.is_memory_optimized = 0"
|
I am not able to reproduce this issue. Does anyone have a repro with the latest version of IndexOptimize and the latest Service Pack and Cumulative Update Package? |
Yes, this happens since IndexOptimize is typically in another database than the objects to be stats-updated. If it touches in-memory objects there, it won't work because more than one database involved (db where IndexOptimize was created and the user database to be updated). We had to exclude in-memory objects as described above as a hotfix. Maybe there is a better solution though. |
solution provided by |
Description of the issue
Date and time: 2024-09-19 09:30:44
Server: SQLServer\Instance1
Version: 16.0.4085.2
Edition: Enterprise Edition: Core-based Licensing (64-bit)
Platform: Windows
Procedure: [DbaTools].[dbo].[IndexOptimize]
Parameters: @databases = 'DB', @FragmentationLow = NULL, @FragmentationMedium = NULL, @FragmentationHigh = NULL, @FragmentationLevel1 = 5, @FragmentationLevel2 = 30, @MinNumberOfPages = 1000, @MaxNumberOfPages = NULL, @SortInTempdb = 'N', @MaxDOP = NULL, @FillFactor = NULL, @PadIndex = NULL, @LOBCompaction = 'Y', @UpdateStatistics = 'ALL', @OnlyModifiedStatistics = 'Y', @StatisticsModificationLevel = NULL, @StatisticsSample = NULL, @StatisticsResample = 'N', @PartitionLevel = 'Y', @MSShippedObjects = 'N', @indexes = NULL, @Timelimit = 600, @delay = NULL, @WaitAtLowPriorityMaxDuration = NULL, @WaitAtLowPriorityAbortAfterWait = NULL, @Resumable = 'N', @AvailabilityGroups = NULL, @LockTimeout = NULL, @LockMessageSeverity = 16, @StringDelimiter = ',', @DatabaseOrder = NULL, @DatabasesInParallel = 'N', @ExecuteAsUser = NULL, @LogToTable = 'N', @execute = 'Y'
Version: 2022-12-03 17:23:44
Source: https://ola.hallengren.com
Date and time: 2024-09-19 09:30:44
Database: [DB]
State: ONLINE
Standby: No
Updateability: READ_WRITE
User access: MULTI_USER
Recovery model: SIMPLE
Is accessible: Yes
Msg 41317, Level 16, State 0, Line 1
A user transaction that accesses memory optimized tables or natively compiled modules cannot access more than one user database or databases model and msdb, and it cannot write to master.
Completion time: 2024-09-19T09:30:47.0307071+02:00
SQL Server version and edition
Execute
SELECT @@VERSION
Version: 16.0.4085.2
Edition: Enterprise Edition: Core-based Licensing (64-bit)
Version of the script
--// Source: https://ola.hallengren.com //--
--// License: https://ola.hallengren.com/license.html //--
--// GitHub: https://github.com/olahallengren/sql-server-maintenance-solution //--
--// Version: 2022-12-03 17:23:44 //--
What command are you executing?
EXECUTE dbo.IndexOptimize
@databases = 'SentryOne',
@FragmentationLow = NULL,
@FragmentationMedium = NULL,
@FragmentationHigh = NULL,
@UpdateStatistics = 'ALL',
@OnlyModifiedStatistics = 'Y',
@Timelimit = 600
What output are you getting?
Msg 41317, Level 16, State 0, Line 1
A user transaction that accesses memory optimized tables or natively compiled modules cannot access more than one user database or databases model and msdb, and it cannot write to master.
The text was updated successfully, but these errors were encountered: