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

Is read-only access still allowed for a last replica that become the primary database (replica)?

$
0
0
I am planning to setup the SQL Server 2014 with AlwaysOn with a AG containing 1 db as primary replica and 1 db as secondary replica. The primary one will have read-only routing to read-only secondary replica. I have a client that will use "ApplicationIntent" as read-only and will point to the AG Listener. So when the client read the data, it should go to the read-only secondary replica. Now I want to know if my primary replica is failed, and failed over to the secondary replica, which become primary now, what happened to my client read-only connection. Since I have not define any read-only routing for the original secondary replica, will the db that just become primary still accept the read-only request?

Violation of Primary Key in Merge Replication

$
0
0

I have one Publisher and one Subscriber. They haveUK (Col1, Col2), PK is col1 + col2, and the MERGE REPLICATION adds a ROWGUID. Sometimes they insert the same row when they are offline ( they generate the same UK, it's not IDENTITY column), because of it, they generate different ROWGUID for the same row. Then, when I run the JOB for Merge Replication, I have a PRIMARY KEY violationI need to use the UK instead of ROWGUID. It is possible?

Example:

Table_1 (Publisher)
Name: John (UK)
ID: 1234 (UK)
ROWGUID: xxxxx (Created by Merge Replication)

Table_1 (Subscriber)
Name: John (UK)
ID: 1234 (UK)
ROWGUID: yyyyy (Created by Merge Replication)


Stored procedure on replicated database

$
0
0

Hi All,

It is possible possible to created stored procedures on replicated database which are not in main database?

Thanks,

Ram.


Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.

Broken replication - fixing gone wrong

$
0
0

Hi everyone

I'm not exactly an expert on SQL so bear with me if I'm having some trouble explaining or if it is unclear.

My situation is that I have a productive SQL Server 2012 (11.0.3) with several databases. It used to have a working replication which didn't work anymore at some point. We tried to fix it to no avail. So at some point we thought that deleting all the tables and everything related to replication from all the databases and then redo it from the start would be a good idea.

Problem is, we can't even open any dialogs related to replication after that. For example creating a new publication fails with:

Invalid object name 'IHpublications'.

Could not use view or function 'dbo.syspublications' because of binding errors.

After a while I figured out that this message wasn't from the master db's System Views but from one of my databases. At some point this database ended up in the the system databases folder instead of right in the databases folder as they normally would. We managed to move it back but I guess this view might have been added at that time.

So I guess that I should get rid of this view (there are some others that my other databases don't have), to make it work again. Does anybody have an idea what I could do? I can't rename the view I get an error (15001), haven't tried to delete it but I'm afraid making more changes now.

That was a stupid series of events, I really hope someone has an idea how to fix it.

Any help highly appreciated

Philip

Need to replicate multiple databases (publications) to one central subscriber

$
0
0

Hi Everyone,

We need to replicate multiple databases (publications) to one central subscriber. The schema of those articles are identical in all publications and also the primary keys in publications do not have any overlap. Is this possible?If yes is there any specific thaing that I should consider for it's implementation? Should each publication has it's own dedicated ditributer or all of them can share one distributer?

Thanks

Aspet


A.G

could not execute 'sp_replcmds' on server

$
0
0
Same problem but my server is not in a domain. It is in a workgroup.

Does initial snapshot process lock tables when setting up transactional replication?

$
0
0
When you configure SQL 2012 Transaction Replication, does SQL Server place any locks on
the tables (the ones you have selected to publish) when it generates the initial snapshot files?
I have some tables (articles) that have 2M+ rows and I don't want this snapshot process
to cause any performance issues in production.  If the tables are being locked for 
the duration of the initial snapshot process, then I want to do this off peak hours.  

Can someone clairfy this?

Thanks!

Transactional replication removal sequence

$
0
0
I have been researching on the proper steps or sequence to follow to completely remove SQL Server 2012
Transactional Replication.  I have read articles about using SSMS as well as using replication stored procedures
and some procedures use SQLCMD or just regular TSQL executed in SSMS.  I have also read articles where
people said all you really need is connect to the Publisher instance, find the publication you want
to remove and choose "Delete" and everything will be taken care of behind the scene.  I'm not sure about
this yet. I have three SQL servers that participate in transactional replication.  SQL-P (publisher), 
SQL-D (distributor) and SQL-S (subscriber).  Do I need to connect to the distributor instance and the
subscriber instance when removing transactional replication or is it just really connecting to the
publisher and click delete on the publication?  I need someone to clarify for this for me and point
me to the right steps.  I want everything gone including any metadata, systems tables, distributions db
and any other replication objects created during the initial configuration.

Thanks!

Seeking for transactional replication setup and troubleshooting

$
0
0

Dear All,

I am new to mssql and I am about to setup a replication. I had setup one transactional replication successful. However, the developer said a table data missing from primary after I setup the transactional replication. I need some advice if the subscriber could make changes to publisher?

The primary/publisher database version is 

Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)  Copyright (c) 1988-2008 Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

The standby/subscriber database version is 

Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)  Copyright (c) 1988-2008 Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

May I know if anyway i could stop anyone make changes to subscriber (if subscriber could make changes and revert the changes and apply into primary/publisher)

I setup the replication based on the URL below:
http://www.sql-server-performance.com/2010/transactional-replication-2008-r2/

I need help here.

1. Did subscriber could make changes and affect the primary? (example delete tables and data)

2. How to prevent other access to make changes other than publisher system user?

3. Any license required for my standby/subscriber?

4. any patching required for my databases as both seems very outdated version?

5. anything i missing or did not raise up in above questions

SQL Server 2012 Std - Merge Replication - Deadlocks

$
0
0

Hi,

I have a merge replication between 2 SQL serve r2012 std sp2. The merge agent keeps getting deadlocked and killed. It seems that procedures fired by triggers and sp_msmakegeneration are locking each other out. What can be done to fix this ?

An example:

Deadlock graph					<deadlock-list><deadlock victim="process1f0284cf8"><process-list><process id="process1f0284cf8" taskpriority="5" logused="368936" waitresource="KEY: 15:72057594074824704 (8b2843006660)" waittime="885" ownerId="24546267" transactionname="user_transaction" lasttranstarted="2015-08-11T12:24:18.290" XDES="0x1fd2a23a8" lockMode="U" schedulerid="4" kpid="4616" status="suspended" spid="123" sbid="0" ecid="0" priority="-5" trancount="2" lastbatchstarted="2015-08-11T12:24:16.763" lastbatchcompleted="2015-08-11T12:24:16.757" lastattention="1900-01-01T00:00:00.757" clientapp="Replication Merge Agent" hostname="DT-SVT-SQL-02" hostpid="5092" loginname="INSTREAM\sqlrepltest" isolationlevel="read committed (2)" xactid="24546267" currentdb="15" lockTimeout="4294967295" clientoption1="673384544" clientoption2="128024"><executionStack><frame procname="mssqlsystemresource.sys.sp_MSmakegeneration" line="337" stmtstart="29568" stmtend="29880" sqlhandle="0x0300ff7fa885d0f933812f012ba3000001000000000000000000000000000000000000000000000000000000">
update dbo.MSmerge_contents with (rowlock) set generation = @target_gen
                where generation = @gen and tablenick = @art_nick     </frame></executionStack><inputbuf>
Proc [Database Id = 32767 Object Id = -103774808]    </inputbuf></process><process id="process279bb9c38" taskpriority="0" logused="11788" waitresource="KEY: 15:72057594074890240 (4d59435678e9)" waittime="2910" ownerId="24547029" transactionname="tx_tran" lasttranstarted="2015-08-11T12:24:18.703" XDES="0x1f7e176a8" lockMode="X" schedulerid="4" kpid="3600" status="suspended" spid="122" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2015-08-11T12:24:18.630" lastbatchcompleted="2015-08-11T12:24:18.630" lastattention="1900-01-01T00:00:00.630" clientapp=".Net SqlClient Data Provider" hostname="DT-SVT-TRA-02" hostpid="50156" loginname="INSTREAM\svctestprovregi" isolationlevel="read committed (2)" xactid="24547029" currentdb="15" lockTimeout="4294967295" clientoption1="673316896" clientoption2="128024"><executionStack><frame procname="iTRANS.dbo.MSmerge_upd_A8EC7E7BF7E44623A7AF6C3061D10DB1" line="65" stmtstart="4694" stmtend="5756" sqlhandle="0x03000f00362460098f0ebb00f1a4000000000000000000000000000000000000000000000000000000000000">
update [dbo].[MSmerge_ctsv_A8EC7E7BF7E44623A7AF6C3061D10DB1] with (rowlock)
			set lineage = { fn UPDATELINEAGE(lineage, @replnick, @oldmaxversion+1) },
				generation = @newgen,
				partchangegen = case when (@partchange = 1 or @joinchange = 1) then @newgen else partchangegen end,

					colv1 = NULL
			FROM inserted as I JOIN [dbo].[MSmerge_ctsv_A8EC7E7BF7E44623A7AF6C3061D10DB1] as V with (rowlock)
			ON (I.rowguidcol=V.rowguid)
			and V.tablenick = @tablenick
			option (force order, loop join)     </frame><frame procname="iTRANS.dbo.s_msg_conv_process_host_tx" line="138" stmtstart="14682" stmtend="16412" sqlhandle="0x03000f0096d4167fcc43a100f1a4000001000000000000000000000000000000000000000000000000000000">
update msg_conversation set
			host_tx_msg_id = @tx_msg_id,
			host_tx_style = @tx_tx_style,
			host_tx_version = @tx_tx_version,
			host_tx_type = @tx_tx_type,
			host_tx_msg_status = 4,						--msg_status 4 = Acknowledged
			host_tx_dt = getUTCDate(),
			host_tx_msg_count = isnull(host_tx_msg_count, 0) + 1,
			host_tx_reference = @host_tx_reference,
			host_router_ack_msg_id = @ack_msg_id,
			host_router_ack_msg_count = isnull(host_router_ack_msg_count, 0) + 1,
			host_router_ack_dt = getUTCDate(),
			host_router_client_tx_msg_id = @tx_msg_id,			-- NOTE!!! only diff from update above, is this line.
			host_router_client_tx_dt = getUTCDate(),
			client_outcome_id = @client_outcome_id,
			host_outcome_id = @host_outcome_id,
			last_event_id= @last_event_id,
			last_event_dt = getUTCDate()
			where
			msg_conv_id = @msg_conv_id     </frame></executionStack><inputbuf>
Proc [Database Id = 15 Object Id = 2132202646]    </inputbuf></process></process-list><resource-list><keylock hobtid="72057594074824704" dbid="15" objectname="iTRANS.dbo.MSmerge_contents" indexname="uc1SycContents" id="lock23cd21900" mode="X" associatedObjectId="72057594074824704"><owner-list><owner id="process279bb9c38" mode="X"/></owner-list><waiter-list><waiter id="process1f0284cf8" mode="U" requestType="wait"/></waiter-list></keylock><keylock hobtid="72057594074890240" dbid="15" objectname="iTRANS.dbo.MSmerge_contents" indexname="nc2MSmerge_contents" id="lock2139a4a80" mode="U" associatedObjectId="72057594074890240"><owner-list><owner id="process1f0284cf8" mode="U"/></owner-list><waiter-list><waiter id="process279bb9c38" mode="X" requestType="wait"/></waiter-list></keylock></resource-list></deadlock></deadlock-list>
					sa			25	2015-08-11 12:24:21.733

Regards,

Olivier

WebSyncDiagAccess

$
0
0

Am trying to get replication going over https.

Have set up iis and everything seems to be ok but when I navigate to https://server/folder/replisapi.dll?diag I get the following text in the browser.

Access Denied because of no WebSyncDiagAccess.

The account I am using has read and execute permissions on replisapi.dll, I have checked everything I can think of and have searched and searched but can not find any reference to "Access Denied because of no WebSyncDiagAccess." anywhere.

Anyone have any ideas?

Thanks,
Denton

Web replication replisapi.dll overflow bug

$
0
0

Good day, guys.

I've set up web replication of my database, some articles exceeds 4GB in size.

So, web replication never ends, I ran ProcMonitor on my IIS machine, and found that w3wp cannot read my first large article, operation "Read File" gets to the offset 4294901760 and starts over from 0. Seems as unsigned int32 overflow.

replisapi.dll version is 2011.110.3000.0

Have it been fixed in further releases?

Explanation for important reserved space

$
0
0

I am analysing a database

I didn't understand why reserved space is more important then used space ?

Any explication ? can I get 400 GO ?

What is the best maintenance plan ?

Login failed for user 'DOMAIN\user' (error 4060) despite DistributorSecurityMode 0

$
0
0

Hello all,

I'm a bit at a loss here. We're having a SQL Server on which one small db is replicated to a large number of other servers. Server Agent is running under LocalSystem (I know ...) and the snapshot agent is configured to use that account as well.
Subscription type is push, transactional replication.

Two days ago, adding of a new subscription failed (i.e. stalled) and the snapshot agent stopped working. Running it from cmd brought up error 14080 (Server doe not exist or you don't have permission ... System Language is German). Running from commandline with -DistributorSecuyrityMode 0 and the sa credentials worked. Changing the task to 0 and adding the credentials made the snapshot agent work again.

In the evening, the server was restarted and voila, the original configuration with SecurityMode 1 started to work again. Newly added subscriptions didn't synchronise, though. While trying to figure out why, the Snapshot agent stopped again.

Now, from cmd, weg get 14080 again with Securitymode 1, but "Login failed for user 'DOMAIN\user'" (error 4060) with SM 0?! Bummer ...

In the meantime, we were notified that a backup job (also using local system) also stopped, so I'm not really sure if it's an replication related problem at all.

I'd really appreciate if someone could point me in the right direction - I suspect I'm really missing something blatantly obvious, but I'm stuck now.

TIA,

Chris

Fast update script

$
0
0

How can I acelerate the following script

update tset[OC]=r.[OC]from[dbo].[Vente] tinnerjoin[dbo].[OC] ron t.[Date Time]between r.[DATE DEBUT]and r.[DATE FIN]

Merge Replication Error, looking for advice

$
0
0
Hello All, I have a weird issue that has sprung up on a not so common configuration

cliffs
started a new job recently
a lot of the stuff set up was done a fair amount of time ago
still exploring configurations / setups
come into work today to find merge replication failing and peeling back the layers of the onion have let to one road block after another.


Basics
Publisher / distributor = 2008r2 sp3
subscriber = 2012 sp2

subscriber is also part of an availability group

This past weekend there was a failover (windows patching) and now the merge replication is pointing to the new primary and failing.

After discussing with the other DBA he enlighted me to the following (which goes through the steps of fixing the broken subscription)

https://msdn.microsoft.com/en-us/library/hh882436.aspx

Going through the steps listed, I find another issue when using the GUI ("for merge publications, the subscriber must not exceed the version of the publisher).

SO...that was a little shock, since this has been apparently functioning for quite some time, and I have no idea how it was originally set up as that wasn't documented and the person doesn't work here (ever heard that one before!!!)

I can, however add the subscription via t-sql without error and it looks like it starts working again...but here is the weird part.


I add the subscription, then run the snapshot agent, then start the synchronization...replication starts the application of the snapshot, and it looks like it makes it all the way through the process...the row counts match at each end...

Then it appears at the end of the sync tasks, it has an issue and blows up with the following error


2015-09-08 15:42:26.194 The merge process was unable to deliver the snapshot to the Subscriber.
If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.


shortly followed by:

Message: Cannot find the object 'MSmerge_ctsv_FFC1150006B248139828C108E0C87137', because it does not exist or you do not have permission.

it is a push subscription, I cannot for the life of me figure out if this is a windows permissions error or something database related...or now the fact that this current set up shouldn't have ever worked based on the GUI error I got.


Any help or comments are appreciated.

Thanks in advance,

Lee

Transactional Replication - Invalid object sysprocesses

$
0
0

I have transactional replication.

publisher - sql server 2008 r2 enterprise

distributor - sql server 2014 standard

subscriber - sql server 2008  R2 enterprise

Distribution Agent has below error message constantly for few hours and it stops.

I have to start distribution agent manually. I have found this on

https://support.microsoft.com/en-us/kb/934188 for SQL 2005. is this bug in SQL server 2008 R2.

Thanks.

Command attempted:

<dir>

select spid, blocked, lastwaittype from sysprocesses where '~80~~84~~86~~87~~89~~90~~92~~95~' like '%~' + cast (spid as nvarchar)+ '~%' and '~80~~84~~86~~87~~89~~90~~92~~95~' like '%~' + cast (blocked as nvarchar)+ '~%'
(Transaction sequence number: 0x000745580000497C002400000000, Command ID: 5)

</dir>

Error messages:

<dir>

Invalid object name 'sysprocesses'. (Source: MSSQLServer, Error number: 208)
Get help: http://help/208

Invalid object name 'sysprocesses'. (Source: MSSQLServer, Error number: 208)
Get help: http://help/208

</dir>

Question regarding CDC

$
0
0

Good morning,

I've been asked a question about CDC which I cant find any information about online.  (Or perhaps I'm missing something).

We use CDC to capture change data throughout the day and then use some stored procedures/SSIS packages to play through the net changes onto our reporting server. 

I've been asked by a third party what locks get put on the LDF file when the CDC service scans through it and have not found anything about this.

Does anybody know?

Regards,

Andy

XML parsing: line 1, character 38, unable to switch the encoding

$
0
0
I am using SSMA tool for migrating Oracle DB to SQL server 2012. I have problem in migrating XMLTYPE data which is stored in oracle with UTF-8 encoding. I want to migrate this data to SQL Server (to column with data type XML) with UTF-16 encoding ( I understand SQL server doesnot support UTF-8 encoding). When I try to migrate I am getting error messge- XML parsing: line 1, character 38, unable to switch the encoding. 

The Process is running and is waiting for a response from the server

$
0
0

Hi All,

We transactional replication, push subscription configured.

Today we are receiving errors in log reader agent and they are as follows:

Agent is retrying after an error. 7 retries attempted. See agent job history in the jobs folder for more details.

The process could not execute 'sp_replcmds' on server 'xxx'

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

When check log reuse waits it's showing replication, log backup is running fine dbcc sqlperf (logspace) is showing 99% used. Seems log is not truncating after log backup.

Please suggest and let us know if need any further details.


Grateful to your time and support. Regards, Shiva

Viewing all 4054 articles
Browse latest View live




Latest Images