Friday, March 30, 2012

how to make the database size smaller?

my database is 9G! I try to truncate some table to make the database smaller
but it seems it doesn't help, the database size has not changed by truncate
some table, so is there any good method to make the database size smaller? (I
accept some data loss in some table)!!Are you backing up this database?
I would run a transaction log backup and truncate the log when you do.
After that you should be able to shrink the database and remove unused space.
--
~lb
"kei" wrote:
> my database is 9G! I try to truncate some table to make the database smaller
> but it seems it doesn't help, the database size has not changed by truncate
> some table, so is there any good method to make the database size smaller? (I
> accept some data loss in some table)!!|||how to truncate the log?
anyway, the data file type is already 9G.
"lonnye" wrote:
> Are you backing up this database?
> I would run a transaction log backup and truncate the log when you do.
> After that you should be able to shrink the database and remove unused space.
> --
> ~lb
>
> "kei" wrote:
> > my database is 9G! I try to truncate some table to make the database smaller
> > but it seems it doesn't help, the database size has not changed by truncate
> > some table, so is there any good method to make the database size smaller? (I
> > accept some data loss in some table)!!|||I would look at Books Online for more info - check backup log...
Run this code if you want to truncate the transaction log and not keep a
backup of the transaction log. Truncate_only invalidates your transaction log
backup sequence. Take a full backup of your database after you perform backup
log with truncate_only:
BACKUP LOG YOURDATABASE WITH TRUNCATE_ONLY
--
~lb
"kei" wrote:
> how to truncate the log?
> anyway, the data file type is already 9G.
>
> "lonnye" wrote:
> > Are you backing up this database?
> > I would run a transaction log backup and truncate the log when you do.
> > After that you should be able to shrink the database and remove unused space.
> > --
> > ~lb
> >
> >
> > "kei" wrote:
> >
> > > my database is 9G! I try to truncate some table to make the database smaller
> > > but it seems it doesn't help, the database size has not changed by truncate
> > > some table, so is there any good method to make the database size smaller? (I
> > > accept some data loss in some table)!!|||I suggest you read about the DBCC SHRINKFILE command.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"kei" <kei@.discussions.microsoft.com> wrote in message
news:91BDB5F4-7273-4435-BF3F-4DCB16A66C8F@.microsoft.com...
> my database is 9G! I try to truncate some table to make the database smaller
> but it seems it doesn't help, the database size has not changed by truncate
> some table, so is there any good method to make the database size smaller? (I
> accept some data loss in some table)!!

No comments:

Post a Comment