all groups > sql server replication > july 2007 >
You're in the

sql server replication

group:

Moving Distribution mdf/ldf (maintain logical drive/path) ?


Moving Distribution mdf/ldf (maintain logical drive/path) ? Frank Conte
7/27/2007 10:21:34 PM
sql server replication:
Is it possible to move the Distribution mdf/ldf files without completely
breaking transactional replication under SQL 2000 ?

I need to do this so I can get both distribution mdf/ldf files off single
disk volumes (logical drives), and onto RAID arrays for fault tolerance.

Current Setup:

Dist Data File PATH = D:\distribution.mdf
(single physical disk drive)

Dist Log File PATH = E:\distribution.ldf
(single physical disk drive)

Can I...

1 - Prevent any user access to published DB, wait for "No replicated
transaction available" message between Publisher/Subscribers
2- Shut down Log Reader Agent and Distributor Agents
3 - Shut down SQL Server on Distributor (same server as Publisher)
4 - Copy the distribution mdf/ldf files (at the O/S level) to a temp
location
5 - Delete Logical Drives D: and E: in O/S
6 - Create new multi disk arrays in RAID management and assign new logical
drives D: and E:, format, etc..
7 - Copy (again at the O/S level) the distribution mdf/ldf files back to the
new logical drives D: and E: now on the RAID arrays
8 - Start up SQL Server on the Distributor
9 - Resume the Log Reader and Dist Agents

Is my assumption accurate in that so long as I DO NOT in any way alter the
logical drive letter and path to the distribution mdf/ldf files when SQL is
started back up, there should be no issues ? I don't think I want to
detach/attach the distribution DB, (while SQL is running) nor use
backup/restore either.

Is this possible ? If not, is there any other workarounds other than to
delete and recreate the replication setup all over again from scratch and
recreate the Distributor Properties ?

Thanks in advance.

-Frank
Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? Hilary Cotter
7/28/2007 12:00:00 AM
You can do this, but it is not recommended you copy open files in this way.

Some points. You do not have to shut down the log reader or distribution
agents. They will pick up where they left off when they restart. The problem
is that when you shut down SQL Servers, the databases are not always in a
state where you can copy them somewhere else and then re-attach them. The
correct way to do this is to detach and then reattach the distribution
database which cannot be done.

So if you do pursue this, I would do a backup of the distribution database
before the move.


--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? Frank Conte
7/28/2007 12:00:00 AM
Hi Hilary,

Thanks for the quick reply. I think you may have missed my intent to *not*
use detach/attach of the distribution database ?

I will shut down SQL Service at the Publisher/Distributor (same server),
then filecopy at the O/S level the distribution mdf/ldf files to a temp
location, then copy them back to the same logical drive letter and path once
I create them under a new raid array config.

If SQL is not running when I O/S filecopy the distribution mdf/ldf files
around that should be ok right as they won't be *open* files in use by SQL
server ?

They will both end up back at the same exact logical drive letter and path
they were originally *before* I start SQL service back up again.

My thinking is that as far as SQL knows, nothing is changing at all....it's
like I did a reboot of the server and the only difference is that the
logical D: and E: drives that used to be single physical disks respectively
are now logical drives on top of a hardware RAID array so they are fault
tolerant against any single drive failure.

I hope this makes sense ?

Thanks,

Frank

[quoted text, click to view]
Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? Hilary Cotter
7/28/2007 12:17:43 PM
No, I understand perfectly what you are tying to do, and it is probably the
way I would be forced to do it.

I am trying to point out to you the gotcha that database files are sometimes
not always closed correctly on server shutdown. Microsoft recommends if you
are going to move database files you detach them first. This is something
you can't do with the distribution database or published databases.

This is why I am urging you to have current backups.

--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? Frank Conte
7/28/2007 3:31:40 PM
Hi Hilary,

Thanks, I defnitely appreciate the advise and will definitely make a backup
of the Distrbution DB before hand.

I guess where I don't follow entirely is how SQL Server would have any
knowledge that the mdf/ldf files were ever moved if when it starts back up
it finds them in te exact same drive letter and path they were when it was
shutdown ?

Otherwise the risk you noted would seem to apply *anytime* SQL is shutdown
and restarted I would imagine ?

I think I'll also make sure that before I shut down SQL that no processes
are accessing the Distribution DB, which if I manually stop the Dist Agents
once "no replicated transactions are available" appears in EM Repl Monitor
than that would be an additional pre-cautionary step.

In any event, I'm going to be doing this tomorrow on our PROD systems, so
I'll be sure and report back any success/failure of the process.

Thanks again !

-Frank


[quoted text, click to view]
Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? Hilary Cotter
7/28/2007 6:16:55 PM
The caveat has nothing to do with the move itself. Rather the fact that
stopping SQL Server does not leave the databases in a consistent state. This
is the problem with your approach. I don't think you have an alternative.

--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? Frank Conte
7/29/2007 12:00:00 AM
Hi Hilary,

I'm happy to report no issues whatsoever with the process, everything worked
just fine.

Thanks again for your advice and insight !

Regards,

Frank

[quoted text, click to view]
Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? anxcomp NO[at]SPAM gmail.com
8/8/2007 3:51:13 AM
Hello,

I have similar problem, my distribution database and log is configured
at C drive, I have to move this
database and log to another drive D.

May anybody tell me how do this secure, please.

This is production environment so I can't make any mistakes.

SQL Server 2005

--
Regards
Re: Moving Distribution mdf/ldf (maintain logical drive/path) ? anxcomp NO[at]SPAM gmail.com
8/9/2007 9:32:42 AM
I've successfully moved distribution database at my server (SQL
2005).I used ALTER DATABASE more here:

http://groups.google.pl/group/microsoft.public.sqlserver.server/browse_thread/thread/89b28d54a808c91e/6e1bee55a73098f2

--
Regards

AddThis Social Bookmark Button