How To Log The Transactions Of Publication And Subscription Databases
Oct 24, 2007I am using sql 2005 replication in my application. But how can i log the transactions that are happening in the server and client databases please help me...
I am using sql 2005 replication in my application. But how can i log the transactions that are happening in the server and client databases please help me...
I had a merge subscription expire and now need to synchronize two disparate databases. How do I do so without overwriting the subscriber database with the publication snapshot? Thanks for any help you can give.
View 3 Replies View RelatedBecause of problems trying to alter databases used
for replication my software would need to find out
if a database is a publisher or was repliated (using
T-SQL). Is this possible?
Hi,
I have two SQL 2000 Server running on Windows 2003 Standard Edtion. I am using merge option to replicate database as Transactional option is excluding some tables. Both server are not in Active Directory and I am trying to replicate over the internet. I got following error message while using Merge option:
Error Message:
The subscription to publication 'XXX' is invalid.
Error details:
The subscription to publication 'XXX' is invalid.
(Source: Merge Replication Provider (Agent); Error number: -2147201019)
---------------------------------------------------------------------------------------------------------------
The remote server is not defined as a subscription server.
(Source: x.x.x.x (Data source); Error number: 14010)
---------------------------------------------------------------------------------------------------------------
Any help regarding the same will be appricated. Thanks.
What's the relationship among replication, publication and subscription?
I want to create replication database, what things should I know first?
I've a merge rep running with 4 subscribers for a while. Now I
wanted to add another subscriber and when I open the publisher
in the pull subscription assistant dialog, there are no publications
in it. (even not if i switch to "allow anonymous sub") But every-
thing seems to be alright wirh the publication itself! It even doesn't
work to select the publication in a pull subs. from an other db on the
same server! Any ideas?
Any help will be greatly appreciated!!!
Hi,
Is there any way to find out if "subscription to publication has expired" in advance using RMO?
Is there somewhere that I can tell when the last time either the publication or better yet a subscrition replicated data (in a system table or view maybe)??
I want to set up monitoring to make sure I am aware if something for some reason does not replicate
OH and it is on SQL 2005 enterprise... an
Hi.
First of all, I apologize for my english
I have two publications. Some of the data are the same on the two publications. Both are configured as follow : The identity range management is set to "automatic" and the tracking-level is set to "Column-level tracking". Until there, every things works fine.
But, if i'm deleting one of the publication and if i'm deleting one of the rows that were replicated on the two publications i'm getting the following SQL Exception : "Invalid object name 'dbo.MSmerge_repl_view_1CAD32C4FF904A3CA27518B0C4BFF716_70308DE2261C4EC784C56131902E7D1C'"
If i'm watching the status of the leftover replication through the replication monitor, i get this error message :
"Error messages:
The Publisher failed to allocate a new set of identity ranges for the subscription. This can occur when a Publisher or a republishing Subscriber has run out of identity ranges to allocate to its own Subscribers or when an identity column data type does not support an additional identity range allocation. If a republishing Subscriber has run out of identity ranges, synchronize the republishing Subscriber to obtain more identity ranges before restarting the synchronization. If a Publisher runs out of identit (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199417)
Get help: http://help/MSSQL_REPL-2147199417
The publisher's identity range allocation entry could not be found in MSmerge_identity_range table. (Source: MSSQLServer, Error number: 20663)
Get help: http://help/20663"
I checked the given links but they're useless.
So I tried to reinitialize the subscription with the "use a new snapshot" option enabled without any success either. I did only obtain a new error message :
"The publisher's identity range allocation entry could not be found in MSmerge_identity_range table.
Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 2.
Failed to pr"
I didnt have any idea to correct this issue, so I would appreciate any help.
Thanks.
David.
I am currently investigating how to safely back up the seven related databases that drive Microsoft Team Foundation Server. Microsoft is suspiciously vaigue and inconsistent about how to perform a safe TFS database backup.
This article states "Although SQL Server Management Studio allows you to back up individual databases at a time, restoring from such back ups can cause unexpected results because the databases are related and you risk restoring outdated versions."
Here, that requirement is strengthened (search for text in article 'Backing up Databases') "Because this data is stored in seven related databases, you might want to use marked transactions in the transaction logs of each database. Transaction-log marks help guarantee absolute consistency in the distributed data set."
but then it weakens the case again a few sentences later...
"Databases for Team Foundation Server are loosely coupled; any latency issues generally are limited to relationships between things such as work items and change sets that are created during the backup window."
There are various other TFS administrators with the same worry about backing up the TFS databases - see here and here.
This requirement to back up related databases to a consistent point in time is not new in Microsoft products. It seems that BizTalk server had exactly the same complication. The nice thing for the BizTalk administrators was that Microsoft included a stored procedure to manage backup of related databases in this way. Team Foundation server administrators don't seem to be so lucky.
I've read the documentation for distributed transaction marking but it doesn't give me that high-level overview that I'm looking for. In our installation, all of the seven databases are hosted on the same machine and same instance of SQL Server.
My initial misconception about transaction marking was that I assumed TFS itself would routinely insert marks into the transaction logs of the seven databases during its normal operation, at points in time where it knows that their state is consistent. This doesn't appear to be the case. The explanation of the BizTalk stored procedure indicates that the log mark insertions are initiated by SQL server as a DBA task. It seems that the insertion of these named marks is done just prior to performing database log backups. This makes sense, so presumably once SQL Server is told to make the marks, it waits for a point in time at which all transactions are closed across all related databases before inserting the marks simultaneously.
If I've got that overview correct, then my real problem is that I can't find an example of the T-SQL that would actually do this. In pseudocode I'd expect it to be something like...
begin distributed transaction across (list of 7 databases), timeout 300 seconds
insert transaction log mark 'safe to restore to this point'
end distributed transaction
I suspect that this page will probably end up having all the information on it I need, but after reading it several times I can't quite nail it. If anyone can help then I'd be most grateful.
James
We have our replication environment with a separate SQL 2014 publisher, distributor and subscriber. We have a table named DPSP on 14 databases which is to be published via transactional replication to 1 subscription database.
The source tables are identical in name, schema and clustered index. We have created 14 tables in the subscription database with a suffix to the name (see below):
Each table in the subscription database has its own uniquely named primary key and clustered index:
Below are the settings for one of the published article:
The same process is repeated for each DPSP table created in 14 separate publications. Snapshots are generated and subscriptions created successfully. After some time, the log reader starts to show the following errors in replication monitor:
2015-08-12 21:48:24.156 7 transaction(s) with 11 command(s) were delivered.
2015-08-12 21:49:04.233 5 transaction(s) with 7 command(s) were delivered.
2015-08-12 21:50:04.355 No replicated transactions are available.
2015-08-12 21:50:09.378 13 transaction(s) with 17 command(s) were delivered.
2015-08-12 21:51:12.168 No replicated transactions are available.
2015-08-12 21:52:12.306 No replicated transactions are available.
2015-08-12 21:52:32.337
[Code] ....
Hi, everyone,
I am new in SQL server 2005. I had setup SQL server 2005 P2P replication. Somehow it did not work one of two way replication. I tried to delete the publication. However I could not do it. have the same problem. When I tried to delete the publication, I got the publication " " does not exist.[SQL server error: 20026]. I tried to use sp_droppublication, it gave me error "the database is not enabled for publication". Nevertheless, I can see the publication in MS SQL Management Studio and Publication monitor with OK status. I could not find the distribution database either.
Could you anyone has ideas to delete this publication? I am sorry I am not a programmer. Please give me more detail explanation if you can. Thanks.
Hi there,
I have decided to move all my transaction handling from asp.net to stored procedures in a SQL Server 2000 database. I know the database is capable of rolling back the transactions just like myTransaction.Rollback() in asp.net. But what about exceptions? In asp.net, I am used to doing the following:
<code>Try 'execute commands myTransaction.Commit()Catch ex As Exception Response.Write(ex.Message) myTransaction.Rollback()End Try</code>Will the database inform me of any exceptions (and their messages)? Do I need to put anything explicit in my stored procedure other than rollback transaction?
Any help is greatly appreciated
It seems to me that if a scheduled SSRS report subscription fails ( Status Message - An error has occurred during report processing) , that I actually need to delete the subscription and reconfigure it from scratch. The scheduled job doesn't try to run again automatically (say the next Monday on a weekly Monday schedule).
Is there a way to "reset" a failed subscription without have to recreate the entire subscription?
Thank you
Devon Kyle
28638
SSCE_M_DUPLICATETABLE
Existing subscription already contains table included in the new subscription.
What are the possible causes of this merge replication error?
Could it be caused by a SQL Server Compact Edition User trying to sync their .sdf file after their subscription has already expired on the SQL Server?
Would you expect to see a different message if a SQL Server Compact Edition user tried to sync a subscriber database (.sdf file) with merge replication if it's been longer than the subscription retention period since their last sync?
I have a publication on my SQL Server.
The first time my application syncs with the server it works fine.
If I try to sync again I get "Permission Denied Number 80040E09 NativeErr: 0"
Other publications work fine, it just seems to be this one.
Any ideas?
Hi!
I have a strange error, when I try to create publication
Msg 3933, Level 16, State 1, Procedure sp_MSrepl_addpublication, Line 1222
Cannot promote the transaction to a distributed transaction because there is an active save point in this transaction.
What is it?
P. S. The error arise with all types of replication.
Hello ,
I have a problem with a publication which is a transactional replication on SQL Server 7.0 .
I want to add stored procedure to the existing publication along with the tables . But the Enterprise manager does not allow to select or check the box
against the required stored procedure although it displays when i right click on the publication and select proeprties .
Can i have some help in this regard ? Does anybody knows to add a stored procedure by means of a query .
Is there any other way to modify publication in SQL Server 7.0 although it is possible in SQL Server 2000 .?
Many thanks in advance.
Sandra .
Hi,
I'm use MSSQL2000 SP3 with replication.
I want to know that Can i add new article to existing publication by
Enterprice Manager ?
someone told me that we can do that in older version but not now,right? :confused:
Hi guys.
i had configured a merge replication betwen 2 server and i was running fine. but due to network problems my network admin has changed the ip address and name of the publisher, distributor and subscriber.
what i did. i just drop the publication and now i m trying to create a new one. but i cannt' able to create. i dont' know y.. this is the error i m facing..
Msg 208, Level 16, State 1, Procedure sp_addmergepublication, Line 239
Invalid object name 'dbo.sysmergepublications'.
Msg 21040, Level 11, State 1, Procedure sp_MSaddmergepub_snapshot, Line 65
Publication 'DIS_MASTER_Merge' does not exist.
Msg 20026, Level 16, State 1, Procedure sp_grant_publication_access, Line 176
The publication 'DIS_MASTER_Merge' does not exist.
Msg 20026, Level 16, State 1, Procedure sp_grant_publication_access, Line 176
The publication 'DIS_MASTER_Merge' does not exist.
Msg 20026, Level 16, State 1, Procedure sp_grant_publication_access, Line 176
The publication 'DIS_MASTER_Merge' does not exist.
Msg 20026, Level 16, State 1, Procedure sp_grant_publication_access, Line 176
The publication 'DIS_MASTER_Merge' does not exist.
Msg 20026, Level 16, State 1, Procedure sp_grant_publication_access, Line 176
The publication 'DIS_MASTER_Merge' does not exist.
Msg 208, Level 16, State 1, Procedure sp_changemergepublication, Line 205
Invalid object name 'dbo.sysmergepublications'.
I have been wrestling with this one all day and cannot find anything on MSDN, google, etc.... I have configured replication, but cannot create a new publication either programmatically or using the wizard.
I programmatically did the following:
1. I set up my local server as a distributor, and created a distribution database (@distributor set to server sysname)
execute sp_adddistributor @distributor = @distributor
execute sp_adddistributiondb @database = @distributionDB, @security_mode=1;
2. I registered my local server also as a Publisher (@publisher set to server sysname, @distribution = 'distributor')
SELECT @sql = 'sp_adddistpublisher @publisher = ''' + @publisher +
''', @distribution_db = ''' + @distributionDB +
''', @working_directory = ''' + @directory + ''', @security_mode = 1'
SELECT @sp_executesql = quotename(@distributionDB) + '..sp_executesql '
EXEC @sp_executesql @sql
3. I enabled my local database for transactional replication (@replicationDB)
exec sp_replicationdboption
@dbname = @replicationDB,
@optname = 'publish', @value = 'true
4. I added a logReaderAgent on the ReplicationDB
SELECT @sql = 'sp_addlogreader_agent @publisher_security_mode = 1'
SELECT @sp_executesql = quotename(@replicationDB) + '..sp_executesql
EXEC @sp_executesql @sql
All is well up to this point, no problems, all looks great. When I check the status of things using sp_help repl stored procedures to check on publisher, distributor all looks healthy. Also looks good when I use the SSMS replication interface to check on distributor, publisher, etc. . HOWEVER...... I cannot create any publications.
I tried programmatically, and also by using the wizard.
I keep getting the same error :'Cannot insert the value NULL into column 'pubid', table'.
This is the sql I try to run:
EXEC sp_addpublication
@publication = 'test3333',
@status = N'active',
@allow_push = N'true',
@allow_pull = N'true'
This is the error:
Msg 515, Level 16, State 2, Procedure sp_MSrepl_addpublication, Line 1320
Cannot insert the value NULL into column 'pubid', table 'CypressMaster.dbo.IHpublications'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Msg 14018, Level 16, State 1, Procedure sp_MSrepl_addpublication, Line 1348
Could not create the publication.
If I use the wizard instead of trying to create the publication programmatically, I get this error (just about the same content, but a little different wording):
Creating Publication
- Creating Publication 'NewPublication' (Error)
Messages
* SQL Server could not create publication 'NewPublication'. (New Publication Wizard)
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot insert the value NULL into column 'pubid', table 'CypressMaster.dbo.IHpublications'; column does not allow nulls. INSERT fails.
Could not create the publication.
Object 'NewPublication' does not exist or is not a valid object for this operation.
Changed database context to 'CypressMaster'.
The statement has been terminated. (Microsoft SQL Server, Error: 515)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=515&LinkId=20476
- Adding articles (Stopped)
- Starting the Snapshot Agent (Stopped)
- Generating a script file (Stopped)
hi
I was following the walkthrough "Creating a Mobile Application with SQL Server Mobile" and when I got to the point where you create a "local publication" I couldn't find the link "Local Publication" in my Object Explorer.
I read all the help in books online however id did not tell me how to bring that link there.
I did install the replication component using the CD installation. I have SQL Server 2005 Standard Edition and Visual Studio 2005
I also found the help "Using the Publication Wizard to Create a Publication" but did not know where to locate or start the wizard.
any help will be appreciated.
When go to set up a new publication I get the below error:
TITLE: New Publication Wizard
------------------------------
SQL Server is unable to connect to server 'LEICS-DC1'.
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2050.00&EvtSrc=Microsoft.SqlServer.Management.UI.PubWizardErrorSR&EvtID=CantConnect&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, ''. (Replication.Utilities)
------------------------------
BUTTONS:
OK
------------------------------
I am specfing the server name but it still brings back the same error, the message at the bottom also stats to try and connect to '' which of course is impossible.
This is a domain controller if that makes any difference, SQL 2005 SP2, Win 2003 STD.
Thanks
Hi,
I've come across this one before in one of the threads, unfortunately for me the author managed to figure it out for his/her self and there for no answer was posted, so can anybody help PLEASE???
Creating Publication
- Creating Publication 'SQLMobile' (Error)
Messages
* SQL Server could not create publication 'SQLMobile'. (New Publication Wizard)
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Invalid object name 'dbo.sysmergepublications'.
Publication 'SQLMobile' does not exist.
Changed database context to 'SQLMobile'. (Microsoft SQL Server, Error: 208)
Its been created via UI
on SQL2005
the distributor is correctly installed
i also have not tried creating a publication on any other database.....this is the first.
Any Ideas?
Dear Readers,Is it possible, like in Access, to link to tables in other SQL databases that are on the same server? I have a query that I originally had in Access that queered from multiply databases. It did this by having those other tables in the other databases linked to the database that had the query.
Hello ,
I want to drop a table from a publication , so that i can copy some data from another server . After the copy , i want to add the article or the table back again to the publication without making any changes to the subscribers configuration .
Is it really possible on SQL 7.0 ? Right now it does not allow me to copy the data to the published table or even drop the article (table) and it says that the article is published for replication and cannot be dropped or modified .
The table is configured for transactional replication .
I will have to drop the entire publication and create all the subcribers again .
Any help in this regard please .
Sameer
We have a publication from database a to database b. Database a containts table1 to be published to databasae b. Database b contains a publication of table1 to database c. When we go to rerun the publication from database a it errors saying cannot drop table1 since it is part of database b's publication. how do you do this.
Thanks in Advance,
Phillip M. Triocli
Hi,
I disabled a merge publication on my server. I then ran sp_removedbreplication to clean the system tables. Thats fine. When I recreate a new publication on my server now, I still get the red x on my publisher node in my replcation monitor from the error I was getting before. Evenm though this publication is error free. Is it saving an srror flag in one of the sytem tabbles
Any ideas on this?
Thanks
Hi,
I'm using DMO (SQLOLE65.dll) to programmatically replicate selected publications. The Publication object supports a property called Enabled, which can be set to FALSE. I'm setting the enabled property to TRUE for those publications that need be replicated, and make the others FALSE. Still, all publications get replicated. [I give DoAlter to commit the changes i made.]
Any solution,Please mail me ASAP to venkateswaranb@synectics.soft.net
Thanks,
Venkat
Hi,
I tried to run the following script from SQL2005 server A (publisher) from Database 'TestDB' to SQL2005 server B
(subscriber) database 'TestDB'
-------------------------------------------
exec sp_addsubscription @publication = N'publish_TestDB_FromCA', @subscriber = N'subscriberTest', @destination_db = N'TestDB', @subscription_type = N'Push', @sync_type = N'automatic', @article = N'all',
@update_mode = N'read only', @subscriber_type = 0
with following error:
Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addsubscription, Line 252
This database is not enabled for publication.
Any idea?
Thanks
David
Hi,
I would like to know the procedure to be followed to add a table to the existing publication. The subcriber doesn't have the object yet. I have data in the source table and I want to add this table in a existing publication for transactional replication. Any advise is appreciated.
Thanks,
Ravi
We have to add some hardware and I was wondering if someone could provide a stepwise tip to do it .
It is a 3 Server Environment Pub/Dist/Sub
All three running under SQL2K
Here is what I am planning.
a. Uncheck the Enable in Distributed Agent for each replication
b. Wait for all replications to complete
c. Shut down Publisher ? Or do I have to do something else before that.
Please explain a little .
Thanks
I have a case of SQL Server 2005 production db's publication which does not have either Log reader, snapshot or distribution agents.
I need to modify primary key in one of the tables, and existing publication does not allow this.
When I try to start snapshot job in GUI I am getting of course error:
"Could not find the regular snapshot job for the spicified publication. Supply either @job_id or @job_name to identify the job, error 20678."
Is there any way to erase it with system st procs or SQL?
Help is greatly appreciated.