March 7, 2007 at 12:16 pm
Hello Experts
I am new to SQL Server; Can i carry out the shrinking using Right Click or by command when the database is NOT in Single-User mode?
I will take a database back up and log file backup prior to this.
Thanks
March 8, 2007 at 2:50 am
Hi
Yes
You can use this from SQL Query Analyzer...
use master
BACKUP LOG YOUR_DATABASE_NAME WITH TRUNCATE_ONLY
use YOUR_DATABASE_NAME
dbcc shrinkfile (YOUR_LOG_NAME, 0)
Its a good idea to take a backup first...
March 8, 2007 at 12:10 pm
Why are you saying "use master" prior to BACKUP LOG YOUR_DATABASE_NAME WITH TRUNCATE_ONLY? I don't understand this part.. what is the role of the master database here? Last time i tried the following set of commands
- use my_db
- backup log my_db with truncate_only
- dbcc shrinkfile(my_log_file_id_number,size_to_shrink_in_MB)
Did i miss something?
Thanks
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy