October 9, 2012 at 2:41 am
what is the process of shrink DB and shrink file ?
October 9, 2012 at 2:45 am
either\or not both
Lookup DBCC SHRINKDATABASE and DBCC SHRINKFILE. You'll see this a million times on here, why do you want to shrink the database or its files?
They'll likely only grow again and both operations are expensive.
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
October 9, 2012 at 7:21 am
Is this for a production db. If so I wouldn't shrink the db and there are considerations to take into account when shrinkung the logfile many people advise not to. is the db part of any log shipping?
SQl 2005
Shrink LOG
USE database_name
GO
DBCC SHRINKFILE(2,1)
BACKUP LOG database_name WITH TRUNCATE_ONLY
DBCC SHRINKFILE(2,1)
Make sure log file is file 2 first.
Sql 2008
USE <dbname>;
GO
DBCC SHRINKFILE (<logfile logicalname>.,100);
GO
I would back up the db straight after if it is in full recovery mode and you are backing up T-log files on a regular basis
October 9, 2012 at 8:52 am
Tanaji Chougale (10/9/2012)
what is the process of shrink DB and shrink file ?
Please refer the site fo rmore info....
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply