Showing posts with label monitor. Show all posts
Showing posts with label monitor. Show all posts

Monday, March 26, 2012

Is this possible? Monitor replication from VB 6.0

I have a client with approximately 30 laptops all running SQL Server
2000 (databse is about 13 gigabytes, this is _not_ MSDE). They have a
legacy application written in VB 6.0.
The decision has been made to change their replication model.
Replication between a "central" SQL Server database and the laptops
used to be triggered through the application whenever the laptop user
chose to. Now they are going to use a two-part method, so that the
user's logs are replicated whenever they connect to the central server,
and product data (which can be huge) will be scheduled in stages
overnight. The VB application will have no control over when they
replicate. The logs will use Merge replication and the product data
will use Transactional replication.
The problem is they expect the application to continue to monitor the
replication "progress" in both scenarios. I have gotten them to accept
that their progress bars will go away, that there will only be an item
in their status bars that it is running (or not).
I have figured out a way to monitor that Merge replication is going on
by watching the MSmerge_history and MSmerge_agents tables in the
Distribution database, but I am not sure that even this will continue
to work once the laptops stop using the ActiveX MS SQL Merge Control to
trigger replication, and it will not work at all for Transactional
replication.
Does anyone have a way (or have a suggestion that might lead to a way)
as to how I can tell from VB whether replication is in progress against
the local SQL Server database? If you believe this is impossible, I
would appreciate hearing that as well.
Thanks,
Austin
Have you looked at the status event?
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
"AustinMN" <tacooper260@.hotmail.com> wrote in message
news:1126531606.616225.228610@.g14g2000cwa.googlegr oups.com...
> I have a client with approximately 30 laptops all running SQL Server
> 2000 (databse is about 13 gigabytes, this is _not_ MSDE). They have a
> legacy application written in VB 6.0.
> The decision has been made to change their replication model.
> Replication between a "central" SQL Server database and the laptops
> used to be triggered through the application whenever the laptop user
> chose to. Now they are going to use a two-part method, so that the
> user's logs are replicated whenever they connect to the central server,
> and product data (which can be huge) will be scheduled in stages
> overnight. The VB application will have no control over when they
> replicate. The logs will use Merge replication and the product data
> will use Transactional replication.
> The problem is they expect the application to continue to monitor the
> replication "progress" in both scenarios. I have gotten them to accept
> that their progress bars will go away, that there will only be an item
> in their status bars that it is running (or not).
> I have figured out a way to monitor that Merge replication is going on
> by watching the MSmerge_history and MSmerge_agents tables in the
> Distribution database, but I am not sure that even this will continue
> to work once the laptops stop using the ActiveX MS SQL Merge Control to
> trigger replication, and it will not work at all for Transactional
> replication.
> Does anyone have a way (or have a suggestion that might lead to a way)
> as to how I can tell from VB whether replication is in progress against
> the local SQL Server database? If you believe this is impossible, I
> would appreciate hearing that as well.
> Thanks,
> Austin
>
|||Hilary Cotter wrote
> Have you looked at the status event?
Yes, I have. The Status event applies to the ActiveX replication
components, whicb are being removed from the application. It only reports
on replication started by the components, so is useless for replication
initiated by the Distributor/Publisher database.
Austin
You programmed with 1s and 0s? We only had 0s!
There are no X characters in my address
> --
> 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
> "AustinMN" <tacooper260@.hotmail.com> wrote in message
> news:1126531606.616225.228610@.g14g2000cwa.googlegr oups.com...
>
|||"AustinMN" <tacooper260@.hotmail.com> wrote in message
news:1126531606.616225.228610@.g14g2000cwa.googlegr oups.com...
>I have a client with approximately 30 laptops all running SQL Server
> The problem is they expect the application to continue to monitor the
> replication "progress" in both scenarios. I have gotten them to accept
> that their progress bars will go away, that there will only be an item
> in their status bars that it is running (or not).
> I have figured out a way to monitor that Merge replication is going on
> by watching the MSmerge_history and MSmerge_agents tables in the
> Distribution database, but I am not sure that even this will continue
> to work once the laptops stop using the ActiveX MS SQL Merge Control to
> trigger replication, and it will not work at all for Transactional
> replication.
> Does anyone have a way (or have a suggestion that might lead to a way)
> as to how I can tell from VB whether replication is in progress against
> the local SQL Server database? If you believe this is impossible, I
> would appreciate hearing that as well.
>
My experience is with Oracle. With Oracle Enterprise Manager, you can see a list
of current connections (which I do fairly often), and you can see lists or logs
of recent changes (which I don't do much). It seems like there would have to be
something similar in SQL Server. Activity at the level of replication can't be
completely hidden. It is just a matter of finding out which thing to look
for...Maybe you could even detect the running process on the laptop with an API
call?

Monday, March 12, 2012

Is there merge monitor sample in vb.net?

Hello,

We are a vb.net shop and while some of us know a little C# it's not enough. Is there a sample solution for the monitoring of replication in vb.net? I know about the sales one but it's in c#. Thanks.

Please refer to the Books On line link

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/repref9/html/b323da02-fadf-443c-8ba7-0cc050250e2d.htm

which will point to every replication step through RMO programming and sample code is written in VB, C#, C++, J#, etc.

Thanks

|||

Yunjing,

Thanks for the response. Unfortunetly I am rather new to raiseevents. Is there a way someone could convert this to vb.net so I can try and understand it? I am basically looking for a progress bar and text output during the sync progress in vb.net as the SalesOrder sample does in c#. Here is what I have in vb.net but am not sure if it's correct. I also have an error when trying to call the agent.status. I got snippets from the salesorder sample c# solution

Public Delegate Sub SyncWhenConnectedStatus(ByVal sender As Object, ByVal eventArgs As StatusEventArgs)
Public Event Status As SyncWhenConnectedStatus

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
...other code...
Dim subscription As MergePullSubscription
Dim agent As MergeSynchronizationAgent
...other code...
agent.Status += New AgentCore.StatusEventHandler(AddressOf Sync_Status)

**cannot build

**Error 1 'Public Event Status(sender As Object, e As Microsoft.SqlServer.Replication.StatusEventArgs)' is an event, and cannot be called Directly. Use a 'RaiseEvent' statement to raise an event.

agent.Synchronize()
end sub

**Not sure if I am doing this correct either

Private Sub Sync_Status(ByVal sender As Object, ByVal e As StatusEventArgs)
' Update the Synchronization Status form.
txtOutput.AppendText(e.Message.ToString() + Environment.NewLine)

' Call the Status event to update the main form
' if sync when connected is used.
RaiseEvent Status(sender, e)
'If Not Status Is Nothing Then
' RaiseEvent Status(sender, e)
'End If
Application.DoEvents()
End Sub