Tuesday, March 6, 2012
Accumulating snapshot folder
I found that my testing server is accumulating shapshot folder in repldata. Everytime, we refresh the tables (snapshot publication), a new folder created without the old folders. And I found that there is at most 1 snapshot folder remain in production server. Any parameter to adjust the retention period of the snapshot folder? Thanks in advanceWhat version of SQL Server are you using?|||MSSQL2005 SP2|||Retention setting can be adjusted in publication property.
accumulating shapshot folder in repldata
I found that my testing server is accumulating shapshot folder in repldata.
Everytime, we refresh the tables (snapshot publication), a new folder created
without the old folders. And I found that there is at most 1 snapshot
folder remain in production server. Any parameter to adjust the retention
period of the snapshot folder? Thanks in advance
It is normal to create a date stamped snapshot folder within your main
publication snapshot folder, for example within here
C:\Program Files\Microsoft SQL
Server\MSSQL.2\MSSQL\repldata\unc\Publisher_P2P1_P 2P1
These are normally cleaned up by one of the clean up jobs.
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
"stephanie" <stephanie@.discussions.microsoft.com> wrote in message
news:24DD103F-DFB5-4331-B04C-B2E3E9ECBB12@.microsoft.com...
> Hi all,
> I found that my testing server is accumulating shapshot folder in
> repldata.
> Everytime, we refresh the tables (snapshot publication), a new folder
> created
> without the old folders. And I found that there is at most 1 snapshot
> folder remain in production server. Any parameter to adjust the retention
> period of the snapshot folder? Thanks in advance
|||This should remain until the distribution retention period is reached (named
subscriber not yet initialized or anonymous subscribers enabled) or all
subscribers have been initialized. After that the cleanup agent will delete
the folder.
Paul Ibison
|||I found the distribution transaction retention is 1-12 hrs only and there is
2 snapshot folders generated more than 1 weeks ago. Any idea? Thanks a lot.
"Paul Ibison" wrote:
> This should remain until the distribution retention period is reached (named
> subscriber not yet initialized or anonymous subscribers enabled) or all
> subscribers have been initialized. After that the cleanup agent will delete
> the folder.
> Paul Ibison
Saturday, February 25, 2012
Account problem when creating a new publication
merge replication to work, but when I try to create a new publisher, when I
select the option to make SQL Server on my laptop its own distributor, I
then get an error msg. saying I've chosen a local system account, and
replication will not work. It then sends me to a publications properties
form to select a new account. I have no other accounts, this is just run
from my laptop. Can some kind soul help me and tell me what I need to do
to get this working?
My end result is to be able to get merge replication set up so I can sync.
with a handheld device using SQL Server 2000 CE.
Thanks in advance for any assistance.
The account that SQL Server and the Agent need to run in something other
than a Local account.
"DaveM" <nosebop@.yahoo.com> wrote in message
news:OFNJHikLFHA.2824@.TK2MSFTNGP10.phx.gbl...
> I've got SQL Server Developer installed on my laptop. I'm trying to get
> merge replication to work, but when I try to create a new publisher, when
I
> select the option to make SQL Server on my laptop its own distributor, I
> then get an error msg. saying I've chosen a local system account, and
> replication will not work. It then sends me to a publications properties
> form to select a new account. I have no other accounts, this is just
run
> from my laptop. Can some kind soul help me and tell me what I need to do
> to get this working?
> My end result is to be able to get merge replication set up so I can sync.
> with a handheld device using SQL Server 2000 CE.
> Thanks in advance for any assistance.
>
>
Sunday, February 19, 2012
Accessing System.Data.SqlServerCe Namespace
Hi there,
Background: I've created an application to run on windows mobile 5.0 devices. It replicates to a publication on a server. To do this it goes through ASP.net. This creates the database on the Mobile Devices.
Issue: Problem is the initial download of the database is taking 2hours plus to replicate (create) for the first time. So I'm trying to create the .sdf file on the server, zip it, and send it across to the handheld. All subsequent replications take about 5 minutes.
Question: Does anyone know how, or have examples for creating a Mobile CE database on the server. I need to create it using ASP.net and go through a pre-existing publication where a hostname used for filtering.
http://msdn2.microsoft.com/en-us/library/ms173009.aspx explains how to create this in SQL Server Management Stuidio. How do you do the same thing over ASP?
Can this be done using SMO? How do you create a SQLServerCompactEdition database using normal .NET Framework? Thanks for your help!!
Is it possible to access System.Data.SqlServerCe namespace without using the .NET Compact Framework?
So if I wanted to access the assembly in a VB.NET Windows App inside the .NET Framework, is this possible?
|||Yes, SQL CE 3.1 allows you to do that. There’s a special version of SQL CE provider for desktop framework.
|||You can run code like in this sample (http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlcereplication.synchronize.aspxon your web server. create the file to the local file system and zip it. Then give the device the URL to the .zip file and your .NET Compact Framework app can the download the .zip file using HttpWebRequest class and unzip.
|||So the problem i was having was in using an assembly that came with the compact framework. The System.Data.SqlServerCE.dll file is located in at least two places on my machine. One in the CE and one in the Common folder...both have the same name and version number.
I changed the reference from pointing at the CE version to the normal version and it cleared up the problem. Thanks for the responses, I'm still not sure what the differences in the assemblies are.
Sunday, February 12, 2012
Accessing publication properties from Visual Basic (VB6)
I have an existing application that checks a few things before it
launches another application. One thing that the application needs to
check is the subscription properties of both the local database and the
remote (LAN) server.
I've stumbled upon some properties but I am trying to fit in the last
ones and I can't seem to find the right code to accomplish this... Can
anyone shine a little light on this please ?
The following code queries the SQL Server (remote) to get (some of) the
properties of the replicated database. What I would like to fit in
after the 'state' are the properties that you can retrieve with the
EnumAllSubscriptions function. However, I can't seem to find the right
object (sample code) to retrieve those (or I'm just overlooking the
obvious)...
Here is (part of) the code I'm using to query the publication on the
remote server :
Dim oMergePublication As SQLDMO.MergePublication2
Dim oSubscription As SQLDMO.MergeSubscription2
Me.lstPublications.Clear
For Each oReplicationDatabase In
objSQLSERVER.Replication.ReplicationDatabases
If oReplicationDatabase.Name = Me.txtSQLServerDatabase.Text
Then
For Each oMergePublication In
oReplicationDatabase.MergePublications
bFoundReplicated = True
Me.lstPublications.AddItem "Database replicated as
'" & oMergePublication.Name & "'"
For Each oSubscription In
oMergePublication.MergeSubscriptions
Me.lstPublications.AddItem " - subscriber
:" & oSubscription.Subscriber
Me.lstPublications.AddItem " - local
DB :" & oSubscription.SubscriptionDB
Me.lstPublications.AddItem " -
state :" & GetReplStatus(oSubscription.Status)
Next
Next
'For Each osubscriber In oReplicationDatabase.
'Next
End If
Next
Set oReplicationDatabase = Nothing
Set oMergePublication = Nothing
After this, I also want to check the local DB (=pulled subscription)
and show some of the properties (from EnumAllSubscriptions). For
example to warn the user about the need to synchronise (last_updated
value)...
Any help appreciated,
Many thanks
GB
--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise. <snapI'm not sure what you're asking - do you mean that you know that
EnumAllScubscriptions will return the information you need, but you
don't know how to manipulate a SQL-DMO QueryResults object? If so, then
you need to iterate over it, and use the GetColumn% methods to return
the data in the format you want - in this case, GetColumnString is
probably the best one to use.
This is a simple VBScript example of using a QueryResults object:
Option Explicit
Dim oSrv, res, c, r
Set oSrv = WScript.CreateObject("SQLDMO.SqlServer2")
oSrv.LoginSecure = True
oSrv.Name = "MyServer"
oSrv.Connect
Set res = oSrv.ExecuteWithResults("select * from sysobjects")
For r = 1 To res.Rows
For c = 1 To res.Columns
If res.ColumnName(c) = "name" Then
WScript.Echo res.GetColumnString(r, c)
End If
Next
Next
If this isn't helpful, you might get a better answer in
microsoft.public.sqlserver.replication.
Simon|||Sort of Simon,
I'm having difficulty to get the returnset from EnumAllSubscriptions in
a workable object. It just returns nothing or won't compile.
In the code I've added, I managed to get the right call for the
EnumAllSubscriptions but I'm not sure on the syntax it requires. Like :
Dim oSubscription as SQLDMO.Subscriber2
Dim oSubscriptionData as SQLDMO.<??>
For each oSubscriptiondata in
oSubscription.EnumAllSubscribers(SQLDMOSubscriptio n_All)
OR do I need to make something like
Dim Result
Dim oSubscription as SQLDMO.Subscriber2
Result = oSubscription.EnumAllSubscribers(SQLDMOSubscriptio n_All)
and then walk that Result for the correct data
Thanks anyway. I'll give this a try in the .repication group.
GB
Simon Hayes bracht volgend ide uit :
> I'm not sure what you're asking - do you mean that you know that
> EnumAllScubscriptions will return the information you need, but you
> don't know how to manipulate a SQL-DMO QueryResults object? If so, then
> you need to iterate over it, and use the GetColumn% methods to return
> the data in the format you want - in this case, GetColumnString is
> probably the best one to use.
> This is a simple VBScript example of using a QueryResults object:
> Option Explicit
> Dim oSrv, res, c, r
> Set oSrv = WScript.CreateObject("SQLDMO.SqlServer2")
> oSrv.LoginSecure = True
> oSrv.Name = "MyServer"
> oSrv.Connect
> Set res = oSrv.ExecuteWithResults("select * from sysobjects")
> For r = 1 To res.Rows
> For c = 1 To res.Columns
> If res.ColumnName(c) = "name" Then
> WScript.Echo res.GetColumnString(r, c)
> End If
> Next
> Next
>
> If this isn't helpful, you might get a better answer in
> microsoft.public.sqlserver.replication.
> Simon
--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise. <snap