SQLTeam.com | Weblogs | Forums

SQL server C drive is full


#1

I tried to 1- Empty the recycle bin
2- run the below script but nothing is change : (
"
-- check free space

EXEC master..xp_fixeddrives

--drive MB free


--C 0 <------------- HELP !!!!!

--F 115360

--G 253473

-- lets recycle the SQL Errorlog a few times to claim some space back

EXEC sp_cycle_errorlog WAITFOR DELAY '00:00:02'

GO

EXEC sp_cycle_errorlog WAITFOR DELAY '00:00:02'

GO

EXEC sp_cycle_errorlog WAITFOR DELAY '00:00:02'

GO

EXEC sp_cycle_errorlog WAITFOR DELAY '00:00:02'

GO

EXEC sp_cycle_errorlog WAITFOR DELAY '00:00:02'

GO

EXEC sp_cycle_errorlog WAITFOR DELAY '00:00:02'

GO

EXEC sp_cycle_errorlog

GO

-- check free space again

EXEC master..xp_fixeddrives

--drive MB free


--C 2500

--F 115360

--G 253477
"

What I have to do ?
Thanks in advanced


#2

Try using a product like SpaceMonger to find what is taking the most space.
If your database use the c: drive for data and transaction logs you might consider moving one or both.
Hope this helps.


#3

I think the C drive contains the system Databases , Users and Program files .
So I have to move the users folder for example to another partition ? or what ?
I'm actually don't have experience in SQL servers

Thanks a lot


#4

I am not the best teacher, however you might try the following to show where the databases are located:

SELECT DB_Name(R1.database_id) AS DatabaseName, 
   R1.physical_name AS DatabaseFile, L1.physical_name AS LogFile 
FROM sys.master_files R1 
INNER JOIN sys.master_files L1 ON R1.database_id = L1.database_id AND L1.[type] = 1 
WHERE R1.[type] = 0;

#5

Have you ever cleared job and/or backup history on MSDB?


#6

No, I haven't .. How can I do it please ? and are there any circumstances when applying this solution?

and what about "clear out old stack dumps and crash dumps" ?

Many Thanks.


#7

Google is your friend here. Make sure that you read about and fully understand sp_purge_jobhistory .
https://www.google.com/?gws_rd=ssl#q=how+to+delete+job+history+in+sql+server

As for the old stack and crash dumps as well as the Windows Events and Error logs, you'll need to look those up, as well, because there's just too much to post on a forum post.