Login | Register    Search
Sponsors

PASSChapterLogo100.jpg

sql_micro_sm.gif

 Intertech .NET and Java Training | User Group Sponsorship

      
We've Gone Mobile

Now you can stay up on all the Space Coast SQL Users Group happenings... on your Windows Phone.

Chek out a demo of the mobile app here.

Download it for FREE here.

    
 

Space Coast
SQL Users Group

"A collaboration of Database Administrators, Developers and IT Professionals passionate about advancing and sharing their expertise in SQL"

  

                              

    
Group Blog
Apr 20

Written by: Bonnie Allard
4/20/2012 11:36 AM 

Using SQL Server Management Studio run the following querries.
 
 xp_fixeddrives - best feature ever to see what you dealing with.  

DBCC

SQLPerf (Logspace)
will show you how bloated the transaction log     
 
Your results will look something like this
 
 
 
 
 
If you have a large file that only has a small percent used then you can shrink it
The database needs to be put in simple recovery model prior to shrinking the files
Right click on the database , Properties, OptionsRecovery model : change to Simple
 
 
 
This also commits the transactions to the database 
 
Now you need the file name because you never want to shrink the database only the files.
 
Use   EXECsp_helpfile
 
 
 
 
Right click in the cell, select copy
Paste it in the below script, the number is the MB you want to shrink your file size to.
 
DBCC SHRINKFILE('your_file_name',  30
GO
 
 To see the data file size   run EXEC sp_spaceused
 
To get all the databases file size run
EXEC sp_msforeachdb@command1="use [?] exec sp_spaceused"
 
If you don’t have any maintenance plans get some
 
Check out Ola Hallengren for customizable plans

Tags:
  
Group Blog
You must be logged in and have permission to create or edit a blog.
    
Group Blog
    
Group Blog
    
View_Blog
Apr 20

Written by: Bonnie Allard
4/20/2012 11:36 AM 

Using SQL Server Management Studio run the following querries.
 
 xp_fixeddrives - best feature ever to see what you dealing with.  

DBCC

SQLPerf (Logspace)
will show you how bloated the transaction log     
 
Your results will look something like this
 
 
 
 
 
If you have a large file that only has a small percent used then you can shrink it
The database needs to be put in simple recovery model prior to shrinking the files
Right click on the database , Properties, OptionsRecovery model : change to Simple
 
 
 
This also commits the transactions to the database 
 
Now you need the file name because you never want to shrink the database only the files.
 
Use   EXECsp_helpfile
 
 
 
 
Right click in the cell, select copy
Paste it in the below script, the number is the MB you want to shrink your file size to.
 
DBCC SHRINKFILE('your_file_name',  30
GO
 
 To see the data file size   run EXEC sp_spaceused
 
To get all the databases file size run
EXEC sp_msforeachdb@command1="use [?] exec sp_spaceused"
 
If you don’t have any maintenance plans get some
 
Check out Ola Hallengren for customizable plans

Tags:
  
Blog_List
    
New_Blog
    
Search_Blog
    
Blog_Archive