Showing posts with label model. Show all posts
Showing posts with label model. Show all posts

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
>

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.com
Check 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@.droptable.co m...
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 at
> 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 at
> the conclusion?
> Example...?
> Thanks.
> --
> Message posted via http://www.droptable.com
>

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
>

Dbowner For The Model Database

How do I change the Database owner for a MODEL database?
When I open the properties for a Model database, it shows "UNKNOWN" as the database owner, and I can't run the command 'sp_changedbowner 'sa' as it's not allowed to run on master, model, and tempdb.
Any help?why would you want to, it's used as the template for future databases created on the server.|||Because I cannot run the sp_helpdb command.