0% found this document useful (0 votes)
9 views5 pages

Pre-Migration activities

The document provides instructions for configuring the maximum server memory settings in SQL Server, including a script to check the current memory settings and calculate recommended values based on the physical memory available. It also includes steps to determine the installed versions of the .NET Framework on a computer and how to check and format data disk block sizes. Additionally, it outlines how to set the endpoint owner to SA for high availability endpoints.

Uploaded by

Kaushik Majumder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Pre-Migration activities

The document provides instructions for configuring the maximum server memory settings in SQL Server, including a script to check the current memory settings and calculate recommended values based on the physical memory available. It also includes steps to determine the installed versions of the .NET Framework on a computer and how to check and format data disk block sizes. Additionally, it outlines how to set the endpoint owner to SA for high availability endpoints.

Uploaded by

Kaushik Majumder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

MAX Server Memory settings

From SSMS, query window, run


exec sp_configure 'max server memory'
-- check the "config_value" this number needs to folow the table found Max server memory
above on page 13 chapter 1

-- for example, to set max server memory to 6Gb on a server with 8Gb physical memory
exec sp_configure 'max server memory', 6144
reconfigure with override

Script to check Max memory Setting


--exec sp_configure 'max server memory'

DECLARE
@memInMachine DECIMAL(9,2)
,@memOsBase DECIMAL(9,2)
,@memOs4_16GB DECIMAL(9,2)
,@memOsOver_16GB DECIMAL(9,2)
,@memOsTot DECIMAL(9,2)
,@memForSql DECIMAL(9,2)
,@CurrentMem DECIMAL(9,2)
,@sql VARCHAR(1000)

CREATE TABLE #mem(mem DECIMAL(9,2))

--Get current mem setting----------------------------------------------------------------------------------------------


SET @CurrentMem = (SELECT CAST(value AS INT)/1024. FROM sys.configurations WHERE name = 'max
server memory (MB)')

--Get memory in machine------------------------------------------------------------------------------------------------


IF CAST(LEFT(CAST(SERVERPROPERTY('ResourceVersion') AS VARCHAR(20)), 1) AS INT) = 9
SET @sql = 'SELECT physical_memory_in_bytes/(1024*1024*1024.) FROM sys.dm_os_sys_info'
ELSE
IF CAST(LEFT(CAST(SERVERPROPERTY('ResourceVersion') AS VARCHAR(20)), 2) AS INT) >= 11
SET @sql = 'SELECT physical_memory_kb/(1024*1024.) FROM sys.dm_os_sys_info'
ELSE
SET @sql = 'SELECT physical_memory_in_bytes/(1024*1024*1024.) FROM sys.dm_os_sys_info'

SET @sql = 'DECLARE @mem decimal(9,2) SET @mem = (' + @sql + ') INSERT INTO #mem(mem)
VALUES(@mem)'
PRINT @sql
EXEC(@sql)
SET @memInMachine = (SELECT MAX(mem) FROM #mem)

--Calculate recommended memory setting---------------------------------------------------------------------------------


SET @memOsBase = 1

SET @memOs4_16GB =
CASE
WHEN @memInMachine <= 4 THEN 0
WHEN @memInMachine > 4 AND @memInMachine <= 16 THEN (@memInMachine - 4) / 4
WHEN @memInMachine >= 16 THEN 3
END

SET @memOsOver_16GB =
CASE
WHEN @memInMachine <= 16 THEN 0
ELSE (@memInMachine - 16) / 8
END

SET @memOsTot = @memOsBase + @memOs4_16GB + @memOsOver_16GB


SET @memForSql = @memInMachine - @memOsTot

--Output findings------------------------------------------------------------------------------------------------------
SELECT
@CurrentMem AS CurrentMemConfig
, @memInMachine AS MemInMachine
, @memOsTot AS MemForOS
, @memForSql AS memForSql
,'EXEC sp_configure ''max server memory'', ' + CAST(CAST(@memForSql * 1024 AS INT) AS VARCHAR(10))
+ ' RECONFIGURE' AS CommandToExecute
,'Assumes dedicated instance. Only use the value after you verify it is reasonable.' AS
Comment----------------------------------------------------------------------

CheckHadrEnpointOwner

To make END point owner as SA

SELECT p.name, e.* FROM sys.endpoints e


inner join sys.server_principals p on e.principal_id = p.principal_id

Alter Authorization on endpoint::hadr_endpoint to [SA]

How to: Determine Which .NET Framework Versions Are Installed


2017-8-9 11 min to read Contributors

Users can install and run multiple versions of the .NET Framework on their computers. When you develop or
deploy your app, you might need to know which .NET Framework versions are installed on the user’s
computer. Note that the .NET Framework consists of two main components, which are versioned separately:

 A set of assemblies, which are collections of types and resources that provide the functionality for your
apps. The .NET Framework and assemblies share the same version number.
 The common language runtime (CLR), which manages and executes your app's code. The CLR is
identified by its own version number (see Versions and Dependencies).
To get an accurate list of the .NET Framework versions installed on a computer, you can view the registry or
query the registry in code:

Viewing the registry (versions 1-4)


Viewing the registry (version 4.5 and later)
Using code to query the registry (versions 1-4)
Using code to query the registry (version 4.5 and later)
Using PowerShell to query the registry (version 4.5 and later)

To find the CLR version, you can use a tool or code:

Using the Clrver tool


Using code to query the System.Environment class

For information about detecting the installed updates for each version of the .NET Framework, see How to:
Determine Which .NET Framework Updates Are Installed. For information about installing the .NET
Framework, see Install the .NET Framework for developers.

To find .NET Framework versions by viewing the registry (.NET Framework 1-4)

1. On the Start menu, choose Run.


2. In the Open box, enter regedit.exe.

You must have administrative credentials to run regedit.exe.

3. In the Registry Editor, open the following subkey:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

The installed versions are listed under the NDP subkey. The version number is stored in the Version
entry. For the .NET Framework 4 the Version entry is under the Client or Full subkey (under NDP), or
under both subkeys.

Note

The "NET Framework Setup" folder in the registry does not begin with a period.

To find .NET Framework versions by viewing the registry (.NET Framework 4.5 and
later)

1. On the Start menu, choose Run.


2. In the Open box, enter regedit.exe.

You must have administrative credentials to run regedit.exe.

3. In the Registry Editor, open the following subkey:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

Note that the path to the Full subkey includes the subkey Net Framework rather than .NET Framework.
Note

If the Full subkey is not present, then you do not have the .NET Framework 4.5 or later installed.

Check for a DWORD value named Release. The existence of the Release DWORD indicates that
the .NET Framework 4.5 or newer has been installed on that computer.

The value of the Release DWORD indicates which version of the .NET Framework is installed.

Value of the Release DWORD Version


378389 .NET Framework 4.5
.NET Framework 4.5.1 installed with Windows 8.1 or Windows
378675
Server 2012 R2
.NET Framework 4.5.1 installed on Windows 8, Windows 7
378758
SP1, or Windows Vista SP2
379893 .NET Framework 4.5.2
On Windows 10 systems: 393295
.NET Framework 4.6
On all other OS versions: 393297
On Windows 10 November Update
systems: 394254
.NET Framework 4.6.1
On all other OS versions: 394271
On Windows 10 Anniversary Update:
394802
.NET Framework 4.6.2
On all other OS versions: 394806
On Windows 10 Creators Update: .N
460798
Value of the Release DWORD Version
On all other OS versions: 460805

wmic product get description | findstr /C:".NET Framework"

Step 0: Validate data disk block size


1. Format all SAN Data Drives (after D: ) to NTFS 64KB (cluster size). For drives housing snapshot
folders, leave the cluster size at 4KB (default) i.e. Snapshot = R:\
2. Click Start, Click Run, Type cmd in the Open box, and then press ENTER.
3. At the command prompt, type
wmic volume get name,blocksize
and then press ENTER.
4. Expected results
BlockSize Name
4096 C:\
4096 D:\
65536 T:\
65536 S:\
65536 I:\
65536 J:\
65536 K:\
65536 L:\

5. These results need to be reformatted with the proper blocksize.


BlockSize Name
4096 C:\
4096 D:\
4096 I:\
4096 J:\
4096 K:\
4096 L:\
4096 S:\
4096 T:\
a. To correct the block size, you need to reformat the drive. Reformat the drive will erase all
the data on the drive. Before running this command ensure there is no data on each of the
drives you will reformat.
b. FORMAT from a command prompt or use disk management. – all data will be lost.
c. From command
i. format I: /A:64k /Q
ii. format J: /A:64k /Q
iii. format K: /A:64k /Q
iv. format L /A:64k /Q
v. format S: /A:64k /Q
vi. format T: /A:64k /Q

You might also like