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.sqlmonster.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 SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
message news:4308fa21ddaf4db6b1242ec457edac5e@.SQLMonster.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.sqlmonster.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 SQLMonster.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 at
> the conclusion?
> Example...?
> Thanks.
> --
> Message posted via http://www.sqlmonster.com
>|||Wow, that's easy. Thanks guys...
--
Message posted via http://www.sqlmonster.com|||See "alter database" in BOL.
Example:
use master
go
alter database northwind
set recovery bulk_logged
go
AMB
"The Gekkster via SQLMonster.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 at
> the conclusion?
> Example...?
> Thanks.
> --
> Message posted via http://www.sqlmonster.com
>

No comments:

Post a Comment