Groups | Blog | Home
all groups > sql server replication > december 2006 >

sql server replication : snapshot.pre file


Marshall
12/18/2006 11:06:32 AM
Hello all,

I have a snapshot publication with several anonymous pulls set up to
replicate several procedures and functions. I notice that the created
snapshot has a file called snapshot.pre that seems to drop all the
functions. I'm not sure why this would be necessary because each .sch
file seems to start by dropping the function before re-creating it.

If the snapshot always ran to completion, I could cope, but
occasionally the sync fails mid-process. I am concerned that the
subscribers could be left in a state without the user-defined
functions.

Am I missing the reason this snapshot.pre file needs to be in the
snapshot? Can I safely edit/delete this file?

Thanks much,
Marshall
Raymond Mak [MSFT]
12/18/2006 4:59:03 PM
Hi Marshall,

On SQL2000, if the snapshot delivery process failed mid-way, the whole
process will be started all over when the distribution agent is restarted so
the function will be dropped (in snapshot.pre) and re-created again. That
said, it is safe to remove\modify the content of the snapshot.pre file (but
not remove the file entirely).

-Raymond
[quoted text, click to view]

Marshall
12/19/2006 11:46:41 AM
Thanks, Raymond.

My subscribers are users with laptops running mobsync (windows
synchronization manager) to replicate on demand. I can't guarantee that
the user will re-start mobsync if they have some sort of connection
failure. I want to be sure that the subscription database is left in
some sort of useable format until they can run mobsync again.

Is there a reason that the snapshot.pre file contains drop statements
for all of my user-defined functions, but nothing else that is in the
publication? I was hoping that there was some modification I could make
to the publication to tell it to stop, but I'm not finding one.

Thanks again for your assistance. Much appreciated.

Marshall


[quoted text, click to view]
Marshall
12/19/2006 11:46:58 AM
Thanks, Raymond.

My subscribers are users with laptops running mobsync (windows
synchronization manager) to replicate on demand. I can't guarantee that
the user will re-start mobsync if they have some sort of connection
failure. I want to be sure that the subscription database is left in
some sort of useable format until they can run mobsync again.

Is there a reason that the snapshot.pre file contains drop statements
for all of my user-defined functions, but nothing else that is in the
publication? I was hoping that there was some modification I could make
to the publication to tell it to stop, but I'm not finding one.

Thanks again for your assistance. Much appreciated.

Marshall


[quoted text, click to view]
Raymond Mak [MSFT]
12/19/2006 12:26:59 PM
The reason why there are drop udf statements in the snapshot.pre script is
that the order required for dropping schema is exactly opposite that of the
order required for creating the schema object, and the reason why we still
have the drop <table|udf|proc> statement at the beginning of each .sch
script is for backward compatibility with downlevel subscribers. That said,
I have to say that dependency handling during replication snapshot
processing is quite broken in SQL2000 which is why a lot of work had been
done to beef that up substantially in SQL2005 transactional\snapshot
replication. It is still not "perfect" (pretty close in SQL2005 sp2 btw),
although I find myself having more problems convincing folks to upgrade.

You can specify a pre-creation command setting of 'none' to prevent your
UDFs from being dropped at the beginning of a snapshot although this will
prevent your UDFs from being refreshed with the delivery of a new snapshot.

-Raymond

[quoted text, click to view]

AddThis Social Bookmark Button