Thanks to Sean Gallardy who answered this over on the Microsoft Forum
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a6cbeb89-bc99-491c-8c2f-9937d5ddfa6a/inmemory-table-on-sql-2014-ha-cluster-not-queriable-on-secondary-nodes?forum=sqldisasterrecovery
I've reproduced the answer from the above link below: -
That's not correct, they can absolutely be read from a readable secondary, assuming:
The in memory table was made with Durability = schema_and_data
A checkpoint has run on the primary
The proper isolation level is used
I can easily get this to work, here is a repro:
1. Create Database on primary and put in AG
CREATE DATABASE [Test1]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Test1',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\Test1.mdf' ,
SIZE = 4096KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ),
FILEGROUP [IMOLTP] CONTAINS MEMORY_OPTIMIZED_DATA DEFAULT
( NAME = N'imoltp_dir',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\imoltp_dir' ,
MAXSIZE = UNLIMITED)
LOG ON
( NAME = N'Test1_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\Test1_log.ldf' , SIZE = 1280KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
- Create the IM Table and populate
CREATE TABLE dbo.IMOLTP
(
C1 INT NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = 1000)
)
WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA)
INSERT INTO dbo.IMOLTP(C1) VALUES (1), (2), (3)
GO
CHECKPOINT
SELECT * FROM dbo.IMOLTP
- Read from a READABLE secondary
Use Test1
GO
SELECT * FROM dbo.IMOLTP
GO
It works just fine for me on: Microsoft SQL Server 2014 (SP2-CU3) (KB3204388) - 12.0.5538.0 (X64)
-Sean