Wednesday, March 7, 2012

moving primary log file

hi,
i'm running out of space on my local drive. the db that i am working on has
one log file. i'd like to move it to a network drive. is that allowed?
i've gotten an error message to the contrary when i tried this w/ a test db.
also, how do a i move a primary log file for a database?
thank you
matthewI would try sp_detach_db/ sp_attach_db.
"matthew c. harad" <matthewcharad@.discussions.microsoft.com> wrote in
message news:3FD18944-59E5-48EE-A306-A35C93329FD9@.microsoft.com...
> hi,
> i'm running out of space on my local drive. the db that i am working on
has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test
db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew|||Hi
You can't put it onto a "normal" network drive, but if you have a SAN that
is ok. You may want to detach the database (sp_detach_db) and attach just the
data file to create a new (smaller) log file see sp_attach_single_file_db in
books online. To keep the existing one you can use sp_attach_db specifying
the new location of the log, or backup/restore the database using the MOVE
clause (or changing the location in the Advanced tab in EM).
John
"matthew c. harad" wrote:
> hi,
> i'm running out of space on my local drive. the db that i am working on has
> one log file. i'd like to move it to a network drive. is that allowed?
> i've gotten an error message to the contrary when i tried this w/ a test db.
> also, how do a i move a primary log file for a database?
> thank you
> matthew

No comments:

Post a Comment