Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEWBIE Question - running a DBCC command 1

Status
Not open for further replies.

Dauphy

IS-IT--Management
Nov 8, 2001
111
CA
I am very, very new at SQL Server 8. I have a 26 GB transaction log file. I have read and researched this and I know I have to run a trans-sql statement as follows
DBCC SHRINKFILE(filename,size). However, here is probably the dumbest question ever. Where do I run this command??? I've read it is a database console command and don't know how to access the database console. Please help. Thank you.

 
Query Analyzer.

Before you can shrink the transaction log you will probably need to backup the log or truncate the log.

If you need to keep the transaction log history then backup the log, and schedule regular backups of the transaction log.

If you don't need to keep the transaction log then truncate the log with:
Code:
backup log [i]YourDatabase[/i] with truncate_only
Then shrink the log. After that you can change the recovery model of the database from full to simple.

After all this is done a full backup of the database is recommended.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Thank you... I just needed a little guiding hand to get me started.
 
No problem.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top