第一个问题会报错,我试图创建一个大表直接报错。
Msg 701, Level 17, State 137, Line 37
There is insufficient system memory in resource pool 'default' to run this query.
第二个问题我创建成功后
CREATE TABLE Destination1
(
--See the section on bucket_count for more details on setting the bucket count.
col1 INT NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT = 1000000),
col2 varchar(1000) NOT NULL,
col3 varchar(1000) NOT NULL
) WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA)
GO
尝试插入数据(数据库最大内存设置为300M)执行一段时间之后数据库连接直接断开了
看数据库错误日志
2013-06-30 18:13:18.08 spid38s Error: 802, Severity: 17, State: 0.
2013-06-30 18:13:18.08 spid38s There is insufficient memory available in the buffer pool.
看起来内存不够,所以直接连都连不进去了。打算尝试重启看看能不能解决这个问题,结果更绝,SQL Server直接起不来了:
13-06-30 18:23:55.23 Logon Error: 17188, Severity: 16, State: 1.
2013-06-30 18:23:55.23 Logon SQL Server cannot accept new connections, because it is shutting down. The connection has been closed. [CLIENT: <local machine>]
再重启一次:
2013-06-30 18:30:40.98 spid23s Error: 41316, Severity: 23, State: 4.
2013-06-30 18:30:40.98 spid23s Restore operation failed for database 'Hekaton_Demo'.
13-06-30 18:23:55.23 Logon Error: 17188, Severity: 16, State: 1.
2013-06-30 18:23:55.23 Logon SQL Server cannot accept new connections, because it is shutting down. The connection has been closed. [CLIENT: <local machine>]
除了这些就是一大堆 DBCC MEMORYSTATS的状态,这样在正式环境中还不搞死人啊,没办法只得删除数据库重启。
不知道SQL Server是如何判断这个80%的,找找文档研究一下。