Friday, February 24, 2012

dbreindex and change recovery model

Borrowing from Example 'E' in BOL for DBCC SHOWCONTIG (and modified to use
DBREINDEX), is there a way to programmtically change the db recovery model
to bulk-logged before this process runs, and then change it back to full at
the conclusion?
Example...?
Thanks.
Message posted via http://www.droptable.comCheck out ALTER DATABASE in the BOL.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"The Gekkster via droptable.com" <forum@.nospam.droptable.com> wrote in
message news:4308fa21ddaf4db6b1242ec457edac5e@.SQ
droptable.com...
Borrowing from Example 'E' in BOL for DBCC SHOWCONTIG (and modified to use
DBREINDEX), is there a way to programmtically change the db recovery model
to bulk-logged before this process runs, and then change it back to full at
the conclusion?
Example...?
Thanks.
Message posted via http://www.droptable.com|||Yes
before...
alter database YourDatabase set Recovery BULK_LOGGED
after
alter database YourDatabase set Recovery Simple
or
alter database YourDatabase set Recovery Full
Depending on your cup of tea...
Enjoy
Peter
"The Gekkster via droptable.com" wrote:

> Borrowing from Example 'E' in BOL for DBCC SHOWCONTIG (and modified to use
> DBREINDEX), is there a way to programmtically change the db recovery model
> to bulk-logged before this process runs, and then change it back to full a
t
> the conclusion?
> Example...?
> Thanks.
> --
> Message posted via http://www.droptable.com
>|||Wow, that's easy. Thanks guys...
Message posted via http://www.droptable.com|||See "alter database" in BOL.
Example:
use master
go
alter database northwind
set recovery bulk_logged
go
AMB
"The Gekkster via droptable.com" wrote:

> Borrowing from Example 'E' in BOL for DBCC SHOWCONTIG (and modified to use
> DBREINDEX), is there a way to programmtically change the db recovery model
> to bulk-logged before this process runs, and then change it back to full a
t
> the conclusion?
> Example...?
> Thanks.
> --
> Message posted via http://www.droptable.com
>

No comments:

Post a Comment