Showing posts with label snapshot. Show all posts
Showing posts with label snapshot. Show all posts

Wednesday, March 28, 2012

New to merge replication - simple scenario......

I have a product that sits on a main server and wish to implement
functionality to allow salesmen to come along, pick up a snapshot of the
database, go away and maybe modify/add to it and then come back and
"synchronise" their data. I'm reading up on Merge Replication for this
purpose. But anyway, I created a publisher on my server and it went away
and generated a "rowguid" column on all of my tables (my tables all have an
Identity column key field). Now of course my "Inserts" no longer work, as
they expect a GUID. I would have expected SQL Server to automatically
generate a guid for new inserts (in a similar way to it's TIMESTAMP), but it
appears it doesn't, despite the fact I have "(newid())" as the default for
the column. It always inserts the same value:
{00000000-0000-0000-0000-000000000000}.

So, back to basics, now I have a guid field for each record, how do I manage
inserts?

Thanks."Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:d7n9tc$1uu$1$8302bc10@.news.demon.co.uk...
> I have a product that sits on a main server and wish to implement
> functionality to allow salesmen to come along, pick up a snapshot of the
> database, go away and maybe modify/add to it and then come back and
> "synchronise" their data. I'm reading up on Merge Replication for this
> purpose. But anyway, I created a publisher on my server and it went away
> and generated a "rowguid" column on all of my tables (my tables all have
> an Identity column key field). Now of course my "Inserts" no longer work,
> as they expect a GUID. I would have expected SQL Server to automatically
> generate a guid for new inserts (in a similar way to it's TIMESTAMP), but
> it appears it doesn't, despite the fact I have "(newid())" as the default
> for the column. It always inserts the same value:
> {00000000-0000-0000-0000-000000000000}.
> So, back to basics, now I have a guid field for each record, how do I
> manage inserts?
> Thanks.

Good practice is to explicitly name the target columns in all your INSERTs,
eg:

insert into dbo.MyTable (col1, col2)
select col1, col2
from dbo.MyOtherTable

If you do this, then there's no problem - your INSERT works as usual, and
you can ignore the uniqueidentifier column completely. Since there's a
default on it, there's no need to include it in the INSERT.

Simon|||So am I right in thinking that the unique GUID will be created on the field
when data is pushed or pulled - as I say, the newid() seems to produce a
zero'd GUID. I was thinking I am responsible for maintaining the uniqueness
of this ID, but this can't be right.

"Simon Hayes" <sql@.hayes.ch> wrote in message
news:429f41fa$1_3@.news.bluewin.ch...
> "Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
> message news:d7n9tc$1uu$1$8302bc10@.news.demon.co.uk...
>>
>> I have a product that sits on a main server and wish to implement
>> functionality to allow salesmen to come along, pick up a snapshot of the
>> database, go away and maybe modify/add to it and then come back and
>> "synchronise" their data. I'm reading up on Merge Replication for this
>> purpose. But anyway, I created a publisher on my server and it went
>> away and generated a "rowguid" column on all of my tables (my tables all
>> have an Identity column key field). Now of course my "Inserts" no longer
>> work, as they expect a GUID. I would have expected SQL Server to
>> automatically generate a guid for new inserts (in a similar way to it's
>> TIMESTAMP), but it appears it doesn't, despite the fact I have
>> "(newid())" as the default for the column. It always inserts the same
>> value: {00000000-0000-0000-0000-000000000000}.
>>
>> So, back to basics, now I have a guid field for each record, how do I
>> manage inserts?
>>
>> Thanks.
>>
>>
>>
> Good practice is to explicitly name the target columns in all your
> INSERTs, eg:
> insert into dbo.MyTable (col1, col2)
> select col1, col2
> from dbo.MyOtherTable
> If you do this, then there's no problem - your INSERT works as usual, and
> you can ignore the uniqueidentifier column completely. Since there's a
> default on it, there's no need to include it in the INSERT.
> Simon|||"Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:d7nge1$1p7$1$8300dec7@.news.demon.co.uk...
> So am I right in thinking that the unique GUID will be created on the
> field when data is pushed or pulled - as I say, the newid() seems to
> produce a zero'd GUID. I was thinking I am responsible for maintaining
> the uniqueness of this ID, but this can't be right.

<snip
As far as I'm aware, in the case of uniqueidentifier columns added to
support merge replication, it's the replication process that maintains these
values. But I'm not at all an expert in replication, so you might want to
consider posting to microsoft.public.sqlserver.replication if you need more
details.

Simon

Monday, March 12, 2012

New Pull Subscription - Trans Repli - Use old snapshot...

How do I created a new Pull subscription from a transaction replication
publisher without having to run the Sanpshot again?
When I create a new Pull Subscription, it says "Snapshot not ready". After I
run Sanpshot, then it starts.
Running the snapshot forces me to take the production server down for 2
hours, and can not always do this.
Thanks and God Bless,
ThomBeaux
use the concurrent snapshot option. God bless u2.
Hilary Cotter
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
"ThomBeaux" <ThomBeaux@.NoSpam.Com> wrote in message
news:60B3F87F-ED59-4030-B30B-E61B145754C5@.microsoft.com...
> How do I created a new Pull subscription from a transaction replication
> publisher without having to run the Sanpshot again?
> When I create a new Pull Subscription, it says "Snapshot not ready". After
> I
> run Sanpshot, then it starts.
> Running the snapshot forces me to take the production server down for 2
> hours, and can not always do this.
> --
> Thanks and God Bless,
> ThomBeaux
|||What part on the Wizard asks for for the concurrent snapshot optin
Thanks and God Bless,
ThomBeaux
"Hilary Cotter" wrote:

> use the concurrent snapshot option. God bless u2.
> --
> Hilary Cotter
> 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
>
> "ThomBeaux" <ThomBeaux@.NoSpam.Com> wrote in message
> news:60B3F87F-ED59-4030-B30B-E61B145754C5@.microsoft.com...
>
>
|||As well as Hilary's advice, if you are using SQL Server 2005 there is the
option to "initialize with backup". In the CTP SP2 there is also the option
of 'database snapshot' for the sync type AFAIR.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||after creating your publication right click on it and go to the snapshot
tab, you should find it there. Its something about minimize locking during
snapshot generation.
Hilary Cotter
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
"ThomBeaux" <ThomBeaux@.NoSpam.Com> wrote in message
news:EDD53985-2C00-4151-8902-C08AAC5CEE52@.microsoft.com...[vbcol=seagreen]
> What part on the Wizard asks for for the concurrent snapshot optin
> --
> Thanks and God Bless,
> ThomBeaux
>
> "Hilary Cotter" wrote:

new publication deleted before snapshot completed

I just created a new publication and subscription... And was in the middle
of the synchronization when I dropped the publication...
I am now receiving a 'Could not find stored procedure 'sp_MSins_tablename''
for all of the agents replicating to this server/db.
The error code is 2812.
Anyone encounter this and have an easy solution?
Thanks in advance!
~lb
Hi,
You can remove all the entries manually or use sp_removedbreplication
'databaseName' to start all over again.
Hope this helps.
cheers
"Lonnye Blake Bower" wrote:

> I just created a new publication and subscription... And was in the middle
> of the synchronization when I dropped the publication...
> I am now receiving a 'Could not find stored procedure 'sp_MSins_tablename''
> for all of the agents replicating to this server/db.
> The error code is 2812.
> Anyone encounter this and have an easy solution?
> Thanks in advance!
> ~lb
>
>

New Publication - Snapshot Error

Help!
Some genius cancelled a replication job that was very close to completing the Initial Snapshot of a database being replicated (Transactional) from one server to another.
Is the only thing necessary to do a 'Reinitialize' of this publication?
Is there any way around having the tables locked when the Snapshot is being generated?
(This is why the doofus killed the job)
Any help is greatly appreciated!
You might be able to get away with a concurrent snapshot if you are using transactional replication. On your publication properties, clcik the snapshot tab, and select concurrent access during snapshot generation.
Another Snapshot will be generated but there will be far less locking.
If you can kick all your users off the database you can DTS the data over. This is faster than a snapshot.
To get this to work you should
1) create a new database.
2) script out the tables you are replicating, and any other objects you are replicating, and run this script in the new database.
3) publish this database and objects to a second new database on the same server.
4) script out the objects and the stored procedures and then run this in the subscriber.
This way your objects will be the way replication wants them and you will have the necessary replication stored procedures. Then do your DTS and then do a no-sync subscription.
DTS can be twice as fast as a snapshot generation and distribution.
It is critical that you be able to prevent any updates from happening to your publication database while you do this.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"JLS" wrote:

> Help!
> Some genius cancelled a replication job that was very close to completing the Initial Snapshot of a database being replicated (Transactional) from one server to another.
> Is the only thing necessary to do a 'Reinitialize' of this publication?
> Is there any way around having the tables locked when the Snapshot is being generated?
> (This is why the doofus killed the job)
> Any help is greatly appreciated!
|||Thanx!
Any way to buy a copy of your book before August 15?
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:ED801206-889D-42F6-A590-663BC63F3BBA@.microsoft.com...
> You might be able to get away with a concurrent snapshot if you are using
transactional replication. On your publication properties, clcik the
snapshot tab, and select concurrent access during snapshot generation.
> Another Snapshot will be generated but there will be far less locking.
> If you can kick all your users off the database you can DTS the data over.
This is faster than a snapshot.
> To get this to work you should
> 1) create a new database.
> 2) script out the tables you are replicating, and any other objects you
are replicating, and run this script in the new database.
> 3) publish this database and objects to a second new database on the same
server.
> 4) script out the objects and the stored procedures and then run this in
the subscriber.
> This way your objects will be the way replication wants them and you will
have the necessary replication stored procedures. Then do your DTS and then
do a no-sync subscription.
> DTS can be twice as fast as a snapshot generation and distribution.
> It is critical that you be able to prevent any updates from happening to
your publication database while you do this.[vbcol=seagreen]
> --
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
>
> "JLS" wrote:
completing the Initial Snapshot of a database being replicated
(Transactional) from one server to another.[vbcol=seagreen]
being generated?[vbcol=seagreen]
|||no. There may be some proofs out in a month.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"JLS" <jlshoop@.hotmail.com> wrote in message
news:%23qw9qmIWEHA.1380@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Thanx!
> Any way to buy a copy of your book before August 15?
> "Hilary Cotter" <hilaryk@.att.net> wrote in message
> news:ED801206-889D-42F6-A590-663BC63F3BBA@.microsoft.com...
using[vbcol=seagreen]
> transactional replication. On your publication properties, clcik the
> snapshot tab, and select concurrent access during snapshot generation.
over.[vbcol=seagreen]
> This is faster than a snapshot.
> are replicating, and run this script in the new database.
same[vbcol=seagreen]
> server.
> the subscriber.
will
> have the necessary replication stored procedures. Then do your DTS and
then[vbcol=seagreen]
> do a no-sync subscription.
> your publication database while you do this.
> completing the Initial Snapshot of a database being replicated
> (Transactional) from one server to another.
publication?
> being generated?
>

New on Replication

I just started to use SQL Server replication. When I configue the Publisher
and Distributor (they are on same server), the snapshot folder is always
invalid. I was using administrator ID, the folder is located on the local
machine, it's shared. What else I need to change? Please help. Thanks.
Are you connected to a network? You need to be to be able to map a drive to
the snapshot share. I am pretty sure this is your problem. Note you can
install the loopback adapter and get it working that way.
Hilary Cotter
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
"WindWind" <WindWind@.discussions.microsoft.com> wrote in message
news:8CD07DA4-9620-48C8-963C-0183601719D0@.microsoft.com...
>I just started to use SQL Server replication. When I configue the Publisher
> and Distributor (they are on same server), the snapshot folder is always
> invalid. I was using administrator ID, the folder is located on the local
> machine, it's shared. What else I need to change? Please help. Thanks.
|||Thanks for your response.
This server is connected to the network and I am able to map a drive to this
share folder, but when I chose the folder, it just wouldn't allow me to use
this folder as the snapshot share.
"Hilary Cotter" wrote:

> Are you connected to a network? You need to be to be able to map a drive to
> the snapshot share. I am pretty sure this is your problem. Note you can
> install the loopback adapter and get it working that way.
> --
> Hilary Cotter
> 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
> "WindWind" <WindWind@.discussions.microsoft.com> wrote in message
> news:8CD07DA4-9620-48C8-963C-0183601719D0@.microsoft.com...
>
>
|||Check to make sure that the SQL Server agent account on the publisher has
rights to write to the share, and full control of the directory and
subdirectory of the folder underlying this share. By default it will be read
only.
Hilary Cotter
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
"WindWind" <WindWind@.discussions.microsoft.com> wrote in message
news:1C880CED-A2D2-4A73-B3EE-C49A50AFF5A0@.microsoft.com...[vbcol=seagreen]
> Thanks for your response.
> This server is connected to the network and I am able to map a drive to
> this
> share folder, but when I chose the folder, it just wouldn't allow me to
> use
> this folder as the snapshot share.
> "Hilary Cotter" wrote: