Azure DB improvements

Making it easy to use the benchmark with Azure SQL DB
This commit is contained in:
Jos de Bruijn
2016-10-20 09:52:54 -07:00
parent bd0596bc30
commit 2c6336a11b
4 changed files with 57 additions and 40 deletions
@@ -1,28 +1,36 @@
USE master
GO
-- With Azure SQL Database, make sure to connect to a database with name InMemDB
-- With SQL Server, make sure SQL Server authentication is enabled, and the sa account is active
-- create main database files; for large-scale workloads, add additional containers to the DiskBased_fg filegroup
CREATE DATABASE DiskBasedDB
ON PRIMARY
( NAME = DiskBasedDB_root,
FILENAME = 'D:\Data\DiskBasedDB_root.mdf',
SIZE = 8MB,
FILEGROWTH = 10),
FILEGROUP DiskBased_fg
( NAME = DiskBasedDB_1,
FILENAME = 'D:\Data\DiskBasedDB_1'),
( NAME = DiskBasedDB_2,
FILENAME = 'D:\Data\DiskBasedDB_2')
LOG ON
( NAME = DiskBasedDB_log,
FILENAME = 'E:\Log\DiskBasedDB_LogDiskBasedDB_log.ldf',
SIZE = 1000MB,
FILEGROWTH = 10)
COLLATE Latin1_General_BIN2
IF SERVERPROPERTY('EngineEdition') != 5
BEGIN
DECLARE @sql nvarchar(max) = N'
CREATE DATABASE DiskBasedDB
ON PRIMARY
( NAME = DiskBasedDB_root,
FILENAME = ''D:\Data\DiskBasedDB_root.mdf'',
SIZE = 8MB,
FILEGROWTH = 10),
FILEGROUP DiskBased_fg
( NAME = DiskBasedDB_1,
FILENAME = ''D:\Data\DiskBasedDB_1''),
( NAME = DiskBasedDB_2,
FILENAME = ''D:\Data\DiskBasedDB_2'')
LOG ON
( NAME = DiskBasedDB_log,
FILENAME = ''E:\Log\DiskBasedDB_LogDiskBasedDB_log.ldf'',
SIZE = 1000MB,
FILEGROWTH = 10)
ALTER AUTHORIZATION ON DATABASE::DiskBasedDB TO sa
'
EXEC sp_executesql @sql
END
GO
USE DiskBasedDB
GO
ALTER AUTHORIZATION ON DATABASE::DiskBasedDB TO sa
ALTER DATABASE CURRENT COLLATE Latin1_General_BIN2
GO
@@ -1,5 +1,6 @@
-------------------------------------------
-- version 0.0.0-1007
-- for Azure SQL DB, replace all occurrences of "ON DiskBased_fg" with ""
-------------------------------------------
USE DiskBasedDB
@@ -1,30 +1,38 @@
USE master
GO
-- With Azure SQL Database, make sure to connect to a database with name InMemDB
-- With SQL Server, make sure SQL Server authentication is enabled, and the sa account is active
-- create main database files; for large-scale workloads, add additional containers in the InMem_fg filegroup
CREATE DATABASE InMemDB
ON PRIMARY
( NAME = InMemDB_root,
FILENAME = 'D:\Data\InMem_root.mdf',
SIZE = 8MB,
FILEGROWTH = 10),
FILEGROUP InMem_fg CONTAINS MEMORY_OPTIMIZED_DATA
( NAME = InMemDB_1,
FILENAME = 'D:\Data\InMem_1')
LOG ON
( NAME = InMemDB_log,
FILENAME = 'E:\Log\InMem_log.ldf',
SIZE = 1000MB,
FILEGROWTH = 10)
COLLATE Latin1_General_BIN2
IF SERVERPROPERTY('EngineEdition') != 5
BEGIN
DECLARE @sql nvarchar(max) = N'
CREATE DATABASE InMemDB
ON PRIMARY
( NAME = InMemDB_root,
FILENAME = ''D:\Data\InMem_root.mdf'',
SIZE = 8MB,
FILEGROWTH = 10),
FILEGROUP InMem_fg CONTAINS MEMORY_OPTIMIZED_DATA
( NAME = InMemDB_1,
FILENAME = ''D:\Data\InMem_1'')
LOG ON
( NAME = InMemDB_log,
FILENAME = ''E:\Log\InMem_log.ldf'',
SIZE = 1000MB,
FILEGROWTH = 10)
ALTER AUTHORIZATION ON DATABASE::InMemDB TO sa
'
EXEC sp_executesql @sql
END
GO
USE InMemDB
GO
ALTER DATABASE CURRENT COLLATE Latin1_General_BIN2
GO
/** For memory-optimized tables, automatically map all lower isolation levels (including READ COMMITTED) to SNAPSHOT **/
ALTER DATABASE CURRENT SET MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = ON
GO
ALTER AUTHORIZATION ON DATABASE::InMemDB TO sa
GO
@@ -1,6 +1,6 @@
-------------------------------------------
-- version 0.0.0-1006
-- update hash index bucket counts based on scale factor. The script was created for scale factor 10.
-- update hash index bucket counts based on scale factor. The script was created for scale factor 100, which corresponds to an in-memory footprint ~20GB.
-------------------------------------------
USE InMemDB