Quantcast
Channel: SQL Server Replication forum
Viewing all 4054 articles
Browse latest View live

Merge Replication - Client Type ReadOnly Prohibit Changes at Subscriber Subscription -Delete Operation Failure on Subscriber reported as "This failure can be caused by a constraint violation. Unable to synchronize the row...".

0
0

Hi all,

The merge replication on the table in question works fine for Updates and Inserts which I can see in replication monitor but when deletes occur I get this error when merge replication tries to delete the row on the subscriber.

Please note that below is a screenshot showing that referenced objects for deletions are correct and I have verified that the objects are present etc , all of that look Ok.

I tracked through the objects and tried to manually recall replication to deleted the row on the subscriber with the call

exec

[dbo].[MSmerge_del_sp_F76ED4C8192B4AA26845A21483954514]1,null,'820f2006-1529-e511-9403-40f2e9249f9a'

and that went through with no error and it looks like replication is no longer retrying to run the delete and subsequently causing another conflict to tick for this row.

My question is, having a look at the tombstone records below (Publisher is first and then the Subscriber) given that the generation and lineage are different, is this the cause?

Like I said Inserts and Updates go through to the subscriber with No issue and work fine, its just when delete operations get called it seems that this error gets raised.

Any advice appreciated.

Kind regards,

Matt







"Copy default value specifications" set to false, but new columns get a default anyway

0
0

I am using SQL Server 2012 transactional replication. I have set the article properties so that "Copy default value specifications" is false.

I added a new column that has a default value specified to an existing table in the Publisher database and then re-ran the replication snapshot. The default value specification was replicated to the Subscriber database for the new column. None of the previously existing columns that have defaults in the Publisher database have defaults specified in the Subscriber database, only the new column.

I had also created a new table with columns that have default values specified. The columns in that table do not have a default specified, as I would expect.

Is there something I am missing? Why would the new column in the existing table have the default specification replicated to the Subscriber database?

Thank you,

Ron Rice


Ron Rice

sp_MSins_dbo is being deleted by another publisher in central subscriber replication model

0
0

I have a Central Subscriber Replication Model, where many publishers pouring in one central database.

I got the following error:

Could not find stored procedure 'sp_MSins_dboSomeTable'

so I recreated that stored procedure using script generated by  "sp_scriptinsproc" and the replication runs successfully after that.

However, and out of the blue, every time I create the 'sp_MSins_dboSomeTable' procedure, it got deleted after one minute of creating it!!!

I used Default Trace to find who is deleting that SP and I found that another publisher in this same model is deleting it.

WHY?!! and How can I fix it ?

Merge replication error "The snapshot for this publication has become obsolete" in SQL Server 2005

0
0

Hi Experts,

Need you're help to figure out this error we are facing for many of our publishers while viewing in replication monitor:

The snapshot for this publication has become obsolete. The snapshot agent needs to be run again before the subscription can be synchronized. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147198698)

Actually , the issue started as their respective replication jobs REPL-SNAPSHOT were failed. We ran the job after fixing and it was successful.

However we still see the above error in replication monitor:

Now how subscription can be synchronized once above snaphsot job has ran:

Note: We have the pull subscription enabled and web synchronization has been enabled in the publication properties and thus i  blve i am unable to see the option of view sync status from publisher?

Any help would be appreciated as i am completely new with this sort of replication?

Thanks


Synchronizing Data Error 28560 in the wizard when creating a subscription to my database

0
0

Hello,

 

Search on the net got nothing useful..

 

Here is the error i get when trying to synchronize with my publication datatbase with my new subscription in Sql Server management studio.

 

New Subscription Wizard

- Beginning Synchronization (Success)

- Synchronizing Data (100%) (Error)
       
Messages
       
* The identity column must be either an integer or big integer data type and cannot be NULL.
       
HRESULT 0x80004005 (25551)
       
       
The SQL statement failed to execute. If this occurred while using merge replication, this is an internal error. If this occurred while using RDA, then the SQL statement is invalid either on the PULL statement or on the SubmitSQL statement. [ SQL statement = CREATE TABLE "ACTIVITY" ( "ACY_ID" numeric ( 18 , 0 ) IDENTITY ( 1 , 1 ) NOT NULL , "ACY_DESCR" nvarchar ( 250 ) NOT NULL , "ACY_INACTIVE" bit NOT NULL , "COM_ID" numeric ( 18 , 0 ) NOT NULL , "COM_ID_INCLUDED" nvarchar ( 150 ) NULL , "rowguid" uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT "MSmerge_df_rowguid_F9E82E2858A34FF68E6250906F8DFB7D" DEFAULT ( NEWID ( ) ) )  ]

        HRESULT 0x80004005 (28560)
       
       
* The operation could not be completed.
       

- Finalizing Synchronization (Stopped)

- Saving Subscription Properties (Stopped)

 

 

 

I tried 3 times and it always stop on this table ACTIVITY.

 

It run for about 30 minutes. This is a on database of 4MB.

 

Some help would be very appreciate

 

Thanks

 

Stephane

Replication configuration issues

0
0

Hi Team,

While I try to configure replication getting below error message:

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, "servername". (Replication.Utilities)

Note: SQL server instance names shows different in sql server configuration manager and SSMS

sql server instance name in  configuration manager: 2di3100\sqlserverprod ,

but i run the query in SSMS SELECT @@SERVERNAME it shows: 2di3100\plugin.

how to fix this issues please help me with steps.

 


View Replication fails "Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber"

0
0

Hi,

I have some issue when replicating a view (transactional replication).

I have following objects on publisher:

Table: [Metadataschema].[Entity]
View: [dbo].[EntityLogicalView]

the view definition is:

create view [dbo].[EntityLogicalView] as (SELECT * FROM [Entity] WHERE OverwriteTime = 0)

this is what I get when I run "Script View as Create". The same query is used by the replication.

Unfortunately this query fails on the subscriber "Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber". I cannot even runt his query manually on the subscriber, it only works when I change it like this:

create view [dbo].[EntityLogicalView] as (SELECT * FROM [Metadataschema].[Entity] WHERE OverwriteTime = 0)
Is there any way to get this working? Can I change the creation scripts used by the replication or force publisher to include schema names in all objects?

Using replication for central management

0
0

I'm trying to come up with some good ways of centrally managing several SQL Server instances potentially spread over several physical boxes and virtual machines.

One thing that is often useful is a set of common stored procedures and functions. You could think of this as analagous to a dll used my many applications. I can see a place for both a general functional library (for things like splitting strings on commas, a table of integers, a calendar table, etc) as well as an administration library (for things like index maintenance, backups, etc). Often these routines cannot be called from anything but the local instance due to the nature of the operations involved, so they must be created on each instance.

It would obviously be advantageous to ensure the consistency of these libraries across the servers that might make use of them. A database on each instance to contain the procedures and functions (a Library database) could have a dba schema and a dev schema containing the appropriate objects. This database could be created  and modified on a single server and then the objects pushed to all other instances by way of replication, ensuring all library databases are always up to date and in synch.

Does anyone use a model like this? Does anyone have another suggestion for the management of shared functionality over multiple instances?


Changing transactional replication subscriber settings

0
0

Hi,

We have plenty of one way transactional replication publishers and pull subscribers. Publishers are configured with correct FTP snapshot settings, but subscribers are not. We would like to configure all subscribers to download snapshot from FTP server. Is this the correct command we should use? 

EXEC sp_change_subscription_properties
@publisher = 'pubserver',
@publisher_db = 'publisher_db',
@publication = 'publication',
@ftp_address = 'ftp.comp.com',
@ftp_port = '21',
@ftp_login = 'domain\user',
@ftp_password = 'passw@rd'

Thanks

Comparing settings for many publications

0
0

Hi,

We have many transactional publications, and would like to have identical settings on each of them. Is any way to compare settings of these publications using script?

Thanks

Heterogeneous Replication with a truncated table

0
0

Hello all!

I am at a true standstill with an issue and I do not know enough about replication to be able to come to a solid solution. At the moment I am replicating ~20 tables from Oracle to Sql Server 2012, and until now everything has been working perfectly. Some tables are using transactional replication, and others are using snapshot- based on need and use. 

I have recently been informed that the current performance of the snapshot replicated tables is not acceptable. Right now, a snapshot is being moved every hour- but I am now being told that the application the data is used often enough, that the amount of time from when the tables are empties, until they are refilled (the whole process takes < 1 minute from start to finish) is unacceptable and users are noticing that the data is not there.

I am stuck because these tables they are referring to, are truncated nightly in Oracle, which means transactional replication won't work here. What I am wondering is if there is a way to work around this? Perhaps by truncating my tables at about the same time so when they reload the table in Oracle it is replicated over to SQL as well. This sounds super messy, and would heavily depend upon the nightly truncating job starting & ending at about the same time every night. 

I was wondering if anyone had ever faced this issue and found a viable work around? or if they even had any ideas. I have thought about things like re-initializing the subscription each morning, scheduling the log reader agent to start/stop at specific times, and matching the truncation but have not found any documentation to suggest that these solutions would even work in the first place.

Any/all insight would be greatly appreciated! I have been stuck on this issue for weeks now and think I have exhausted all of my own possible solutions

Indexed Views - Clustered Index is NOT replicated (not scripted by the snapshot agent)

0
0
Using SQL 2005 SP2.
I have a publication that contains indexed views, and some other objects that query the indexed view using WITH (NOEXPAND). Currently replication fails because the CLUSTERED INDEX on the view is NOT replicated. I've experimented with various schema options but nothing changes. The view is replicated but not the clustered index on that view.

I've seen some discussion on replicating indexed views to a table, but I would like to replicate indexed view schema fully. (Including the clustered index on that view).
Is there a way to make this work?

Thanks.

Merge Replication with FTP (Pull)

0
0

Hello,

I'm currently testing Merge replicaiton.

I need to have at least one Subscriber wich do not have TCP/IP port open for it's SQL Server Instance.

I have configured my Publisher to deploy snaphot in a ftp. But my Pull Subscriber can't get the initial snapshot (with the DB schema).

On the Publisher Replication Monitor I have these error:

Error messages:

The schema script '' could not be propagated to the subscriber.

(Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)

Get help: http://help/MSSQL_REPL-2147201001

The process could not connect to FTP site 'ftp.XXXX.XX' using port 21.

(Source: MSSQL_REPL, Error number: MSSQL_REPL20032)

Get help: http://help/MSSQL_REPL20032

220 Microsoft FTP Service

550 No such host is known.  

(Source: MSSQL_REPL, Error number: MSSQL_REPL12003)

Get help: http://help/MSSQL_REPL12003


I can't see where the error is

(I have configure an other Subscriber (in Push) with port open which work perfectly)

Thanks for you help


Replicate Image from SqlServer 2005 to Oracle12c

0
0

Hi,

I am trying to replicate a table that is containing an image from SqlServer 2005 to Oracle12c but i am getting an error when the distribution agent tries to apply the initial snapshot: "ORA-00932: inconsistent datatypes: expected file got binary". I did the same test between sql server 2005 and oracle 11g and it worked.

The problem is only with tables that have images, if it is only text, it works. (afte i am recreating MSREPL7

CREATE TABLE SCHEMA.MSREPL7
(
PUBSRV    VARCHAR2(128 BYTE),
PUBDB     VARCHAR2(128 BYTE),
PUBLCN    VARCHAR2(128 BYTE),
INDAGENT  NUMBER(1),
SUBTYPE   NUMBER(10),
DSTAGENT  VARCHAR2(100 BYTE),
TIMECOL   DATE,
DESCR     VARCHAR2(255 BYTE),
XACTTS    RAW(16),
UPDMODE   NUMBER(3),
AGENTID   RAW(16),
SUBGUID   RAW(16),
SUBID     RAW(16),
IMMSYNC   NUMBER(1)
))


SQL 2005 Replication to Oracle 11g

0
0
I am setting replication between a SQL 2005 server as a publisher and Oracle 11g as a subscriber.
Connectivity to the Oracle server works fine.
When the subscriber is initialized, table MSREPL7 is created in the Oracle Server.
I get the following error:

ORA-00932: inconsistent datatypes: expected NUMBER got BINARY (Source: MSSQL_REPL_ORACLE, Error number: 932).

My guess is that the problem is when SQL tries to insert data in the MSREPL7 table.

By reading some posts in Microsoft, they suggest to execute the following stored procedures:

sp_MSrepl_DropDatatypeMappings and sp_MSrepl_CreateDatatypeMappings.

I did that, but it didn't work.

Other posts state that SQL 2005 doesn't work with Oracle 11g.

Is there somebody out there with the same problem, and who knows what to do to fix?

Thanks all for your help.

The process is running and is waiting for a response from the server.

0
0

I have an issue with transaction replication. Even though I take tx log backups once every 5 mins in one of our test environments I have noticed the tx log of the subscirber database has grown huge (200GB). The amount of free space is 1%. It has taken up all the space on the drive. In the replcation montior I noticed that in "publisher to distributor history" there are a bunch of below messages and retries

The process is running and is waiting for a response from the server.

and in the "Distributor to Subscriber History"
No replicated transactions are available.

and Undistributed commands are 0.

My initial thoughts were to check if there are any open transactions and when I run the dbcc openTran() I get the below information:

Transaction information for database 'dbname'.

Replicated Transaction Information:
        Oldest distributed LSN     : (308515:1083:76)
        Oldest non-distributed LSN : (308515:1187:8)

Assuming its a big transaction I reduced the -ReadBatchSize from 500 to 15 in the logreaderagent and restarted the agent profile job. But I dont see any difference as of now. The EXEC Sp_browsereplcmds  returns 0 rows. So does the SELECT TOP 1 publisher_database_id 
FROM msrepl_commands. 0 rows.

querying the msrepl_errors order by time desc returns me 

Query timeout expired
The process could not execute 'sp_replcmds' on 'DBserver'.

It kind of puts me in a situation where I cannot investigate further.

Experts need your inputs on whats going on here.

Table migration from one database to another database

0
0

hello experts,

i want to move table from one database to another database in same instance, table should migrated with complete data,with same column data type, all constraints like PK,FK unique key, check, identity, permissions has to be there.. which is the right way to achieve this.

please help!!


SQL Server DBA

Removing orphaned distribution database.

0
0

Hello Sir,

 

Sorry for this direct approach. I have been a huge follower of your blogs since the time I started my carrier some 8 years back. You have been a great mentor and source of information for many like myself.

 

Recently, I joined a new organization

and after sometime I found that there was a distribution database on our production server but no associated publisher or subscriber.

I tried to locate the .mdf and .ldf files for the same but found out that the underlying SAN was replaced without copying the files across.

 

Although we don’t replication, but the distribution database has got stuck in the management studio.

Whatever I do , ( I have tried many things) I get the below error . I even tried the following using the DAC

 

usemaster

go

alterdatabase distribution setoffline;

dropdatabase distribution

 

“The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000056000 in file 'E:\XXX_Replication\Data\distribution.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. “

                                                                                                                  Please help me in removing this distribution database from the management studio.

Generate Snapshot - Update Statistics on multiple tables (that I didn't add)

0
0

Hi,

We have 3 SQL instances as below.

- SQL 2014 is publisher

- SQL 2014 is distributor (remote distributor)

- SQL 2012 is subscriber

Then, when I add the new table into the existing publication, I found that the snapshot agent do the update statistics on multiple tables even some tables has already added into the publication before.

so that, Does the snapshot agent do the update statistics 

1. only the new table that we will add 

OR

2. update random tables

Thank you. :)

Merge replication: Files in snapshot folder are locked

0
0

We have a merge publication with 100 pull subscriptions (partitioned snapshots).

Since a while we have errors generating the snapshots.

Replication-Replication Snapshot Subsystem: agent ... failed. 
The replication agent failed to remove the file system object '\\...\20151129040020', 
reason: The directory is not empty.

When we look with computer management we can see that in these folders some files are open by the proxy-account which is used to create the snapshot. (sessions of 1, 2, ... days)

Untill we close these files manually these locks stay in place which prevents cleanup of these old snapshot folders. 

Viewing all 4054 articles
Browse latest View live




Latest Images