Skip to main content

[SQL] Temp DB folder move to new drive

Check current tempdb file location and status. Rerun this after moving the location to check. 

Use master

GO


SELECT 

name AS [LogicalName]

,physical_name AS [Location]

,state_desc AS [Status]

FROM sys.master_files

WHERE database_id = DB_ID(N'tempdb');

GO 



Try to move C:\MSSQL\DATA location. 

MSSQL 2008 version code


USE master;

GO


ALTER DATABASE tempdb 

MODIFY FILE (NAME = tempdb, FILENAME = 'C:\MSSQL\DATA\tempdb.mdf');

GO


ALTER DATABASE tempdb 

MODIFY FILE (NAME = templog, FILENAME = 'C:\MSSQL\DATA\templog.ldf');

GO




MSSQL 2014 and after version

USE master;

GO


ALTER DATABASE tempdb 

MODIFY FILE (NAME = tempdev, FILENAME = 'C:\MSSQL\DATA\tempdb.mdf');

GO


ALTER DATABASE tempdb 

MODIFY FILE (NAME = templog, FILENAME = 'C:\MSSQL\DATA\templog.ldf');

GO


" The new path will be used the next time the database is started. " will show after run. 

Restart your MSSQL. and check with file location. 


Comments

Popular posts from this blog

[Cisco] command and CDR log backup by FTP (gw-accounting file)

Below command has been tested with ISR4331 devices.  1. check Cisco device file size command :  a. show current folder dir flash:  b. show all folder and files dir flash 2. check file only start with "cdr." dir flash:cdr.* 3. Remove file (Add option [ /recursive /force]  when you delete file is not recovering free space) delete /recursive /force  flash:cdr.* 4. check subfolder file dir flash:\tracelogs 5. example for log back to ftp https://www.cisco.com/c/en/us/td/docs/ios/voice/cdr/developer/manual/cdrdev/cdrcsv.html#marker-1163166 enable conf t gw-accounting file primary ftp 192.168.1.51/cisco/cdr username cisco password xxxxx secondary sftp 192.168.1.52/cisco/cdr username cisco password xxxxx acct-template callhistory-detail maximum buffer-size  30 maximum retry-count 3 (note : if these setting is not working. check these area, FTP password can not be used @ and some of special characters for this command. Second, ftp location is case sensitive. Please...

Vmware ESXi Raid change from 0 to 6

    Back up  with NAS or other method Check disk for windows server 192.168.1.250   raid from 0 to  6 instruction https://www.dell.com/support/kbdoc/en-us/000129246/dell-poweredge-how-to-change-the-raid-level-of-a-virtual-disk Purchase below to prepare before starting this.  https://workdone.shop/products/x7k8w 4-Pack 3.5-inch Hard Drive Caddy WH5D2   purchase Brand: Seagate IronWolf Pro Model: ST8000NT001 Qty : 3 (2 for Raid 1, 1 for old HDD  replacement ) https://www.newegg.com/seagate-ironwolf-pro-st8000nt001-8tb/p/N82E16822185077

[SharePoint] Versioning Settings menu location for sharepoint 2013

  https://support.microsoft.com/en-gb/office/enable-and-configure-versioning-for-a-list-or-library-1555d642-23ee-446a-990a-bcab618c7a37#OfficeVersion=2016,_2013 1. From top menu Select "PAGE" 2. Select "Library Settings" 3. Select "Versioning settings" 4. Versioning Settings are listed.