Temp db verplaatsen en initiale size aanpassen

Temp db verplaatsen en initiale size aanpassen

Wat bleek, de tempdb stond nog op de C drive en was ook nog een vol gelopen. Hieronder de stappen om deze te verplaatsen. Ik heb voor deze SharePoint omgeving gekozen voor een initial size van 400 MB , maar ook dat is afhankelijk van het gebruik .

 

— step 1 controle huidige locatie

SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N’tempdb’);

— step 2 Move temp log naar E

use master
GO
Alter database tempdb
modify file (name = templog, filename = ‘E:\MSSQL10_50.MSSQLSERVER\MSSQL\Data\templog.ldf’)
GO

— FAILOVER of MSSQLservice herstarten daarna stap 3 (Stop and restart the instance of SQL Server.)

— step 3 controle of het is gelukt

SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N’tempdb’);

—STEP 4. Delete the templog.ldf files from the original location.

— Initial size aanpassen:
— hertstart de server met
sqlservr -c -f
— sql server started in minimum configuration mode with a tempdb size of 1MB

Optimal TempDB data file sizes can be calculated using the following formula1

[MAX DB SIZE (KB)] X [.25] / [# CORES] = DATA FILE SIZE (KB)

http://www.t1shopper.com/tools/calculate/file-size/result/?size=250000&unit=kilobytes