Welcome back. You now have SQL Server and SSMS installed. Next, you will configure one of the most important
“DBA foundations” that prevents performance and operational problems later:
clean, intentional file locations.
Many SQL Server environments run poorly because everything is thrown onto the C: drive with default paths.
In real DBA work, you plan where your data files, log files, tempdb files, and backups live—because they have
different I/O patterns and different risk profiles.
Lesson description: You will learn what SQL Server data, log, tempdb, and backup files do,
why their I/O patterns differ, and why DBAs separate them.
You will build a clean folder layout for your lab, configure SQL Server default paths,
move tempdb to the correct location safely, and validate that new databases and tempdb are using your intended directories.
You will finish with a checklist you can reuse for future installations.
Data files store the actual table and index pages. They experience mixed reads and writes and can be random I/O heavy.
Transaction log files store the record of changes. Log writes are mostly sequential.
Log performance is extremely sensitive to storage latency.
tempdb is a shared system database used for:
sorts, hash joins, temp tables, table variables, row versioning, and internal worktables.
tempdb can become a major bottleneck under load.
Backup files are your recovery lifeline. Their location matters for restore speed and for protecting data from loss.
DBAs separate file locations to achieve:
DBA reality: In production, these often map to separate disks or storage tiers.
In your lab, you can still separate by folders (and optionally separate virtual disks if you want advanced realism).
This is easiest and still teaches correct DBA habits.
You can add additional virtual disks to your VM and assign them drive letters (D:, E:, F:).
This is closer to production design but requires more setup.
Course recommendation: Start with Option A.
If you want to challenge yourself later, upgrade to Option B.
Create these folders (adjust drive letters if you have multiple disks).
If you only have C:, this layout is still valuable:
C:\SQLData\ — user database data filesC:\SQLLog\ — user database log filesC:\SQLTempDB\ — tempdb data and log filesC:\SQLBackups\ — backup filesDBA note: If you created C:\DBA\ earlier, you can also place these under a consistent structure.
But for realism, DBAs often keep SQL file locations separate from “documentation folders.”
SQL Server has “default” locations used when you create new databases without specifying paths explicitly.
You want defaults to be correct so you don’t accidentally create databases on the wrong drive.
C:\SQLData\C:\SQLLog\C:\SQLBackups\DBA note: Some changes may require service restart to fully apply.
SELECT
SERVERPROPERTY('InstanceDefaultDataPath') AS InstanceDefaultDataPath,
SERVERPROPERTY('InstanceDefaultLogPath') AS InstanceDefaultLogPath;
Backup default path is not surfaced the same way in all versions,
so you will validate backup behavior by creating a test backup in the next practice step.
tempdb is recreated on startup. That makes it “safe” to move by updating file paths and restarting SQL Server.
You do not copy tempdb files manually while SQL Server is running.
USE tempdb;
GO
SELECT
name,
type_desc,
physical_name
FROM sys.database_files
ORDER BY type_desc, name;
Adjust the file names if your instance uses different naming.
These names are common defaults:
tempdev (data) and templog (log).
USE master; GO -- Move tempdb data file ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'C:\SQLTempDB\tempdb.mdf'); GO -- Move tempdb log file ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'C:\SQLTempDB\templog.ldf'); GO
Restart the SQL Server service (not just SSMS).
You can do it via:
After restart, tempdb will be recreated in the new location.
USE tempdb;
GO
SELECT
name,
type_desc,
physical_name
FROM sys.database_files
ORDER BY type_desc, name;
If you see C:\SQLTempDB\ paths, you succeeded.
The #1 cause is missing folder permissions or folder not existing.
Fix by confirming:
C:\SQLTempDB\ existsDBA rule: Create directories first, then change SQL configuration, then restart.
CREATE DATABASE DBALab_TestPaths; GO
SELECT
DB_NAME(database_id) AS DatabaseName,
name AS LogicalName,
type_desc,
physical_name
FROM sys.master_files
WHERE DB_NAME(database_id) = 'DBALab_TestPaths'
ORDER BY type_desc, name;
You should see data files in C:\SQLData\ and log files in C:\SQLLog\.
DROP DATABASE DBALab_TestPaths; GO
Run a test backup and confirm the file lands in your backup directory:
-- Create a small test DB for backup validation CREATE DATABASE DBALab_BackupTest; GO BACKUP DATABASE DBALab_BackupTest TO DISK = 'C:\SQLBackups\DBALab_BackupTest_FULL.bak' WITH INIT, COMPRESSION, CHECKSUM, STATS = 5; GO DROP DATABASE DBALab_BackupTest; GO
Confirm the backup file exists at:
C:\SQLBackups\DBALab_BackupTest_FULL.bak
DBA habit: Always include CHECKSUM and prefer COMPRESSION when available.
In production, the OS drive must remain stable even if databases grow unexpectedly.
In a lab, you may be limited to one disk, but the habit of separation is still correct.
Many performance incidents are tempdb incidents.
DBAs plan tempdb storage and file configuration intentionally.
(You will learn advanced tempdb tuning later.)
In real environments, backups should also be copied off the server.
A backup stored on the same server is not a disaster recovery plan.
C:\SQLData\, C:\SQLLog\, C:\SQLTempDB\, C:\SQLBackups\C:\SQLTempDB\ using ALTER DATABASE and restart SQL Server.C:\DBA\Logs\file-path-validation.txtNext, you will combine everything from this section into a clean, professional installation checklist
that you can reuse for future servers and show in interviews as proof of operational discipline.
Not a member yet? Register now
Are you a member? Login now