Quantcast
Channel: SQL Server Replication forum

sp_MSunmarkreplinfo blocking queries

$
0
0

I'm investigating the slowdown of a system and am finding sp_MSunmarkreplinfo is blocking.

It is trying to get a schema modify lock but is being blocked by other things. This is then blocking a lot of other processes on the system that are trying to get schema shared locks. It is different SPs that are blocking sp_MSunmarkreplinfo so I don't think there is anything that can be done about that.

I would have thought that sp_MSunmarkreplinfo is only called when removing a table from replication? Should I be looking for someone/something that is trying to alter replication or is this sometimes called as part of the replication processing?


Configure Publication error when using remote distributor

$
0
0

hi,all

i have added servername\repl_logreader,servername\repl_snapshot  in sqlserver Logins.. and done everything for creating publications

using remote distributor:

int the last step in Publication wizad,erros happen as follows:

Proxy "servername\repl_logreader" is not a valid Windows user.Changed database context to "publication db"

mark: there is nothing errors when using local distributor

Transactional Replication - Snapshot Agent can not start when using remote distributor

$
0
0

Hi everyone,

i created a transactional replication (SQL Server 2019) with two different servers.

there are in different domain.

Server 1 should only be the Publisher.
Server 2 should be the Distributor and the Subscriber.

In server2.  I configured the distributor and added server1's ip and server name as publisher


In server1. I finished New Publication settings. Main steps as follows:

using server2 ip as distributor.

using SQL Server Agent  in Agent Security settings


but i can't start Snapshot Agent and Log Reader Agent..

errors:

why?

Transactional replication failing with connection was forcibly closed

$
0
0

Hi,

I have pull transactional replication setup. When there is a little load of transactions it starts failing with below error.

Agent message code 10054. TCP Provider: An existing connection was forcibly closed by the remote host.

All server (pub\sub and dist) are on SQL 2016 SP2.  Have other replication setup also between the servers but only one particular distributor agent is failing. Have verified the connection status between the serve when we encounter the error, network drivers are also up to date. No such auto close property is on.

What could be the possible reason and solution for the same?

Error messages:
TCP Provider: An existing connection was forcibly closed by the remote host. (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054
TCP Provider: An existing connection was forcibly closed by the remote host. (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054
Communication link failure (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054
TCP Provider: An existing connection was forcibly closed by the remote host. (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054
Communication link failure (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054
Protocol error in TDS stream (Source: MSSQLServer, Error number: HY000)
Get help: http://help/HY000

And Some time:

Message
2020-06-30 02:52:51.043 Copyright (c) 2016 Microsoft Corporation
2020-06-30 02:52:51.043 Microsoft SQL Server Replication Agent: distrib
2020-06-30 02:52:51.043
2020-06-30 02:52:51.043 The timestamps prepended to the output lines are expressed in terms of UTC time.
2020-06-30 02:52:51.043 User-specified agent parameter values:
            -Publisher SERVERS1
            -PublisherDB XYZ_DBSchema
            -Publication XYZ_Reporting_REPL
            -Distributor SERVERS2
            -SubscriptionType 1
            -Subscriber SERVERS1
            -SubscriberSecurityMode 1
            -SubscriberDB XYZ_Reporting
            -Continuous
            -XJOBID 0xB5B1C0883E31AB4CBA4638D9DE82779A
            -XJOBNAME SERVERS1-XYZ_DBSche-XYZ_Reporting_-SERVERS1-XYZ_Reporting-0CF91B86-EBE3-4360-98FE-506C20656804
            -XSTEPID 1
            -XSUBSYSTEM Distribution
            -XSERVER SERVERS1
            -XCMDLINE 0
            -XCancelEventHandle 0000000000001DF4
            -XParentProcessHandle 0000000000001AAC
2020-06-30 02:52:51.043 Startup Delay: 4595 (msecs)
2020-06-30 02:52:55.652 Connecting to Subscriber 'SERVERS1'
2020-06-30 02:52:55.668 Connecting to Distributor 'SERVERS2'
2020-06-30 02:52:56.293 Parameter values obtained from agent profile:
            -bcpbatchsize 2147473647
            -commitbatchsize 100
            -commitbatchthreshold 1000
            -historyverboselevel 1
            -keepalivemessageinterval 300
            -logintimeout 15
            -maxbcpthreads 1
            -maxdeliveredtransactions 0
            -pollinginterval 5000
            -querytimeout 1800
            -skiperrors
            -transactionsperhistory 100
2020-06-30 02:52:56.605 Initializing
2020-06-30 02:53:04.199 101 transaction(s) with 3062 command(s) were delivered.
2020-06-30 02:53:04.652 100 transaction(s) with 194 command(s) were delivered.
2020-06-30 02:53:04.918 100 transaction(s) with 214 command(s) were delivered.
2020-06-30 02:53:13.168 Agent message code 10054. TCP Provider: An existing connection was forcibly closed by the remote host.
2020-06-30 02:53:13.308 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  10054
Message: TCP Provider: An existing connection was forcibly closed by the remote host.
2020-06-30 02:53:13.340 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  10054
Message: Communication link failure
2020-06-30 02:53:13.371 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  10054
Message: TCP Provider: An existing connection was forcibly closed by the remote host.
2020-06-30 02:53:13.402 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  10054
Message: Communication link failure
2020-06-30 02:53:13.434 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  10054
Message: TCP Provider: An existing connection was forcibly closed by the remote host.
2020-06-30 02:53:13.480 The agent failed with a 'Retry' status. Try to run the agent at a later time.

Thank you,

Udham Singh


Replication Monitor 18.5x not connecting automatically to all publishers

$
0
0

Our sysadmin approved a WSUS push of SSMS 18.5 last week.   I believe I had been running 17.92.  My normal morning routine starts with launching SSMS and starting Replication Monitor (RM).  

When I did that RM connected to only one server, the one I was connected to when I started it.   I have over 30 publishers scattered all over the world.  It now takes better than 15 minutes to do what used to be done automatically in under 2 minutes.

All the publishers have the "Connect automatically when Replication Monitor starts" option selected.

I have tried removing several publishers and re-adding them, turning the autoconnect option off and back on, temporarily disabling the A/V suite, and rebooting the PC the customary three times.

This sure looks like a bug to me.

Anyone know of a workaround to get this working again?

TCP Provider: An existing connection was forcibly closed by the remote host. (Source: MSSQLServer, Error number: 10054) Get help: http://help/10054

$
0
0

Hi Team,

we have 1 replication setup on production server.Publisher and distribution are on same server and subscriber is at other end.

We are getting above error lots of time. Data has been transfer from publisher to distribution but it is not transferring from distribution to subscriber.Replication monitor showing around 25262718 pending from distribution to subscriber.

Error Messages :-

TCP Provider: An existing connection was forcibly closed by the remote host. (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054
Communication link failure (Source: MSSQLServer, Error number: 10054)
Get help: http://help/10054

Thanks 

Aniket N

What if schema replication changes are disabled in snapshot replication.

$
0
0

I want to know if new table and columns along with data, will be replicated to subscriber database if I have disabled schema replication in publication ? It's snapshot replication. 

Thanks

V Jay 

Why am I unable to skip a transaction in SQL Server 2017 transactional replication using the sp_setsubscriptionxactseqno stored procedure?

$
0
0

I have a transaction number of a transaction that is throwing the following error:

Command attempted: if @@trancount > 0 rollback tran

(Transaction sequence number: 0x00036322000B2628000100000000, Command ID: 1) Error messages: The row was not found at the Subscriber when applying the replicated
(null) command for Table '(null)' with Primary Key(s): (null)
(Source: MSSQLServer, Error number: 20598) Get help: http://help/20598 The row was not found at
the Subscriber when applying the replicated (null) command for Table '(null)'
with Primary Key(s): (null) (Source: MSSQLServer, Error number: 20598)
Get help: http://help/20598

When I execute the following:

sp_setsubscriptionxactseqno@publisher = ''  
        ,@publisher_db = ''  
        , @publication = 'ALL'  
        , @xact_seqno = 0x00036322000B2628000100000000

in order to skip the offending transaction and then try to sync up the subscription, it doesn't skip the transaction, instead it keeps throwing the same error.

When I execute the following:

USE distribution 
GO

DECLARE @PublisherServer  VARCHAR(50), 
        @PublicationDB    VARCHAR(50), 
        @SubscriberServer VARCHAR(50), 
        @SubscriberDB     VARCHAR(50), 
        @PublicationName  VARCHAR(50) 

SET @PublisherServer = '' 
SET @PublicationDB = '' 
SET @SubscriberServer = '' 
SET @SubscriberDB = '' 
SET @PublicationName = '' EXEC Sp_helpsubscriptionerrors 
  @PublisherServer, 
  @PublicationDB, 
  @PublicationName, 
  @SubscriberServer, 
  @SubscriberDB

I get 1,860 rows back all being:

id  time    error_type_id   source_type_id  source_name error_code  error_text  xact_seqno  command_id  session_id
23326   2020-07-15 15:52:27.640 0   0   MSSQL_ENG   20598   The row was not found at the Subscriber when applying the replicated (null) command for Table '(null)' with Primary Key(s): (null)  0x00036322000B2628000100000000  1   0
23326   2020-07-15 15:52:27.640 0   1   MSSQL_ENG       if @@trancount > 0 rollback tran    0x00036322000B2628000100000000  1   0
23326   2020-07-15 15:52:27.640 0   0   MSSQL_ENG   20598   The row was not found at the Subscriber when applying the replicated (null) command for Table '(null)' with Primary Key(s): (null)  0x00036322000B2628000100000000  1   0
23322   2020-07-15 15:50:09.100 0   1   MSSQL_ENG       if @@trancount > 0 rollback tran    0x00036322000B2628000100000000  1   0
23322   2020-07-15 15:50:09.100 0   0   MSSQL_ENG   20598   The row was not found at the Subscriber when applying the replicated (null) command for Table '(null)' with Primary Key(s): (null)  0x00036322000B2628000100000000  1   0
23322   2020-07-15 15:50:09.083 0   0   MSSQL_ENG   20598   The row was not found at the Subscriber when applying the replicated (null) command for Table '(null)' with Primary Key(s): (null)  0x00036322000B2628000100000000  1   0
23318   2020-07-15 15:47:45.423 0   0   MSSQL_ENG   20598   The row was not found at the Subscriber when applying the replicated (null) command for Table '(null)' with Primary Key(s): (null)  0x00036322000B2628000100000000  1   0

Why am I unable to skip that transaction? What am I missing?

EDIT:

I have tried to re-initialize the subscription, but it won't re-initialize.
I manually attempt to start the 'Snapshot Agent' job from the 'Agents' tab and receive the following:

Status: Completed
Job: Snapshot Agent
Last Start Time: 7/16/2020 7:07:43 AM
Duration: 00:00:01
Last Action: [0%] A snapshot was not generated because no subscriptions needed initialization.

I marked two subscriptions for re-initialization and received the above.
Below is a screenshot of the subscription listing:

Subscription Listing

But, even when I try to manually start the snapshot job, I receive the following:

Agents Listing

I don't understand what's going on. What am I doing wrong or missing?



Change Tracking Performance

$
0
0

We have a large production system and implemented change tracking 8 days ago with a retention policy of 3 days.  The syscommittab is currently at 332 million records and climbing.  We have SQL 2008 SP1 CU 7 installed (10.0.2766.0).  We temporarily changed the retention policy to 10 days but scaled it back again yesterday becuase the problem with our synchronization process was solved.  We have seen no noticable change in the size of the syscommittab.  How can someone reliable tell if the auto clean-up is working?  (it is on)

More importantly we are seeing a very severe performance degradation on production when querying the change tracking tables.  The following query a week ago ran in seconds, now it takes 15-20 minutes and climbing rapidly.  The table that is being queryed has only 12 rows of data in the internal change tracking table which represents it.  It is a very static table. 

This Query takes 15-20 minutes to run on production:

SELECT

 

*FROMCHANGETABLE(CHANGES dbo.[table1], 146316152)AS cLEFTOUTERJOIN dbo.[table2]AS a

WITH

 

(NOLOCK)ON c.[CID]= a.[CID]AND c.[DID]= a.[DID]WHERE

(

 

c.SYS_CHANGE_OPERATION='D'OR(a.[CID]ISNOTNULLAND a.[DID]ISNOTNULL));

This Query takes only 43 seconds:

SELECT

 

*FROMCHANGETABLE(CHANGES dbo.[table1],null)AS cLEFTOUTERJOIN dbo.[table2]AS a

WITH

 

(NOLOCK)ON c.[CID]= a.[CID]AND c.[DID]= a.[DID]WHERE

(

 

c.SYS_CHANGE_OPERATION='D'OR(a.[CID]ISNOTNULLAND a.[DID]ISNOTNULL))AND SYS_CHANGE_VERSION> 146316152;

The difference in the execution plan is the first one does an index seek on syscommittab using some scaler operator in the predicate where the second FASTER query uses an index scan against syscommittab.  We are contemplating going to the second syntax to perform our data extracts but are unsure where the two queries return the same result set and if not what is the difference?

Any help would be appreciated, this is quickly becoming a crisis.

Computed Column at publisher end not replicating at subscriber end

$
0
0

Hi I do have Publisher Tableand Subscriber Table, both has same schema, Difference is publisher table has one computed column which return varchar Like Sample Below:

CREATEFUNCTION[cimfn_FormPartition](@pKeyVal BIGINT) RETURNS VARCHAR(100)WITH SCHEMABINDINGASBEGIN[LOGIC]RETURN@OutputEND GO**Publisher End:**createtable table1([pKey][bigint]IDENTITY(1,1)NOTNULL,[cKey]AS dbo.cimfn_FormPartition(pKey) PERSISTED,[id][varchar](20)NULL,[refId][varchar](20)NULL,constraint[pKey]PRIMARYKEYNONCLUSTERED( pKey ASC))ALTERTABLE[table1]ADDCONSTRAINT[CI_Items]UNIQUECLUSTERED([cKey])ON[PRIMARY]**Subscriber End:**createtable table1([pKey][bigint]NOTNULL,[cKey][varchar](100)NULL,[id][varchar](20)NULL,[refId][varchar](20)NULL,constraint[pKey]PRIMARYKEYNONCLUSTERED( pKey ASC))ALTERTABLE[table1]ADDCONSTRAINT[CI_Items]UNIQUECLUSTERED([cKey])ON[PRIMARY]

In the Article Properties of publisher tableAll things I have setto false ,andset ACTION IF NAME ISINUSE: Keep existing object unchangedWhen I insert data into publisher tablethenin subscriber tabel I am getting below output :**pKey cKey id	 refId1NULL  Item1	i1**
I Have addedd Article Proper and Even though subscription tableis  getting null value in cKey ,andall other column has correct value.
I have checkreplication monitor as well , No error is showing there.
I more drilled down with the store procedure**(sp_browsereplcmds)**and found out the insert command does not have computed column value with this. So now again question is why Distributor isnot picking computed columnfrom publisher?

DELETE A RECORD

$
0
0

Transaction replication. We have a bad record in the PUBLISHER DB for a particular program and currently working with the app company figuring out what happened.

Anyway, this is an open ticket since JAN. We want to move forward because the bad record looks like a glitch of some sort on a process. We tried simulating on a TEST server but has not been successful. However, it is affecting a report.

My options are:

[1] Ask program owner to delete the record.

[2] We delete the record on the SUBSCRIBER DB

[3] Place a filter on the application.

For [1], we have been pushing for the program owner to remove this record but has not been successful for whatever reason. I want to implement [2] instead of [3] and ask them not do delete the record anymore.

Thoughts?

TIA

"Invalid Operation" when adding Oracle subscriber to SQL Server 2016 replication publication

$
0
0

Hi,

I'm trying to set up transactional replication from SQL Server 2016 to Oracle 12c.  (I realize that heterogeneous replication is deprecated but this should be for a limited time period).  I am following the general guidance here:https://msdn.microsoft.com/en-us/library/aa337389.aspx  and the Oracle-specific info here: https://msdn.microsoft.com/en-us/library/ms151864.aspx.  I am finding that when I try to add the non-SQL Server subscriber, I get this error:

Invalid operation. The connection is closed. (System.Data)

------------------------------
Program Location:

   at System.Data.SqlClient.SqlConnection.GetOpenConnection()
   at System.Data.SqlClient.SqlConnection.get_ServerVersion()
   at Microsoft.SqlServer.Management.UI.ReplicationSqlConnection.GetServerVersion()
   at Microsoft.SqlServer.Management.UI.ReplicationSqlConnection.get_IsServer130OrLater()
   at Microsoft.SqlServer.Management.UI.SubWizardSubscriber..ctor(String name, SubscriberType subscriberType, Boolean isSelected, Boolean isRegistered, ReplicationSqlConnection sqlConn, WizardInputs inputs)
   at Microsoft.SqlServer.Management.UI.PageChooseSubscribers.AddNonSqlSubscriber_OnClick(Object sender, EventArgs e)

I have tried to follow the Oracle/heterogenous recommendations, including

1) Installing recent 64-bit Oracle client and verifying basic connectivity to database

2) Ensuring the the distribution account has read access to the Oracle OLEDB provider directory

3) Setting public snapshot format to Character

4) Setting publication's subscription options to Allow non-SQL Server subscribers

5) Configuring my source SQL Server as distributor

Any other suggestions?  Any known guides or walk-throughs for this scenario?

thanks!

Martin


Invalid operation. The connection is closed. - when adding Oracle subscriber to SQL Server 2016(13.0.5102.14) replication publication"

$
0
0

Hello,

I am  facing the issue when I try to add Oracle subscriber to SQL Server 2016 replication publication.

I have installed Oracle 19.0.0 full client on Distributor server.

Through SQLPlus I can able to connect to Oracle Database successfully.

Also through ODBC 64 bit DSN test connection done successfully.

I have given Read & Exec permission to the SQL Server Distributor Agent account.

TNSPing command also verified successfully.

But when I try to add Data Source Name in "Add non SQL Server Subscriber under "New Subscriber Wizard" it is giving error like "Invalid operation. The connection is closed."

Please suggest.

Thanks. 
Keeran kumar

Peer-to-peer replication not staying in sync

$
0
0

We have set up a simple test of peer-to-peer replication with three nodes, A, B, and C.   Node A has the peer originator ID set to 100, node B is set to 90, and node C is set to 80.  Allow peer-to-peer conflict detection is set to true and continue replication after conflict detection is also set to true.  From these settings I would assume if node A and node B updated the same row at the same time, the values of node A would prevail.  But this isn't happening.

I have a table called HoursData that has three columns.  The first column is SysID which is a uniqueidentifier and the primary key.  The second column is named Hours and is numeric(8,2).  The third column is named  UpdatedBy and is varchar(30).  There is a single row in the table that contains this data:

SysID: E66AA9B0-7B73-4884-BFCE-7BDF688770BF     Hours: 10     UpdatedBy:  Smith

If I run this query on node A:
  Update HoursData Set Hours = 20, UpdatedBy = 'Smith' Where SysID = E66AA9B0-7B73-4884-BFCE-7BDF688770BF    

And at the same time run this query on node B:
  Update HoursData Set Hours = 30, UpdatedBy = 'Jones' Where SysID = E66AA9B0-7B73-4884-BFCE-7BDF688770BF    

I find that the following data is shown for each node:

Node A:  SysID: E66AA9B0-7B73-4884-BFCE-7BDF688770BF     Hours: 20     UpdatedBy:  Smith
Node B:  SysID: E66AA9B0-7B73-4884-BFCE-7BDF688770BF     Hours: 20     UpdatedBy:  Jones

As expected the hours for node B changed from 30 to 20 because node A has a higher peer originator ID.  However the UpdatedBy column did not revert to Smith.  The data is out of sync.  From what I can tell the issue is that the value for the UpdatedBy column did not change on node A.  This is not what I would expect to occur.  If I run the following on both servers at the same time"

Node A:
  Begin Transaction
    Update HoursData set UpdatedBy = ''
    Update HoursData Set Hours = 20, UpdatedBy = 'Smith' Where SysID = E66AA9B0-7B73-4884-BFCE-7BDF688770BF    
  Commit Transaction

Node B:
  Begin Transaction
    Update HoursData set UpdatedBy = ''
    Update HoursData Set Hours = 30, UpdatedBy = 'Jones' Where SysID = E66AA9B0-7B73-4884-BFCE-7BDF688770BF    
  Commit Transaction

The data looks like this as I would expect it to:

Node A:  SysID: E66AA9B0-7B73-4884-BFCE-7BDF688770BF     Hours: 20     UpdatedBy:  Smith
Node B:  SysID: E66AA9B0-7B73-4884-BFCE-7BDF688770BF     Hours: 20     UpdatedBy:  Smith

Is this the way peer-to-peer replication is designed to work where if a column value remains the same it doesn't change to the value from the higher originator ID?  This doesn't make much sense to me.

Configure Peer-Peer Replication with T-SQL

$
0
0

Hi Team,

How to configure Peer-Peer Replication with T-SQL in SQL Server 2016?

I am familiar with GUI but not with T-SQL.

Please help us.


[Announcement] SQL server related Forums will be migrated to a new home on Microsoft Q&A!

$
0
0

This SQL Server related Forum will be migrated to a new home on Microsoft Q&A!

We’ve listened to your feedback on how we can enhance the forum experience. Microsoft Q&A  allows us to add new functionality and enables easier access to all the technical resources most useful to you, like Microsoft Docs and Microsoft Learn. 

Now until Aug 23, 2020:

From Aug 24, 2020 until Sep 7, 2020:

  • New posts – We invite you to post new questions in the “SQL Server” forum’s new home on Microsoft Q&A. The current forum will not allow any new questions.
  • Existing posts – Interact here with existing content, answer questions, provide comments, etc.

Sep 7, 2020 onward:

  • This forum will be closed to all new and existing posts and all interactions will be in Microsoft Q&A.

We are excited about moving to Microsoft Q&A and seeing you there.  


""SQL Server related"" forum will be migrated to a new home onMicrosoft Q&A SQL Server!
We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server!
For more information, please refer to the sticky post.

SQL Server Replication using RMO

$
0
0
We are using SQL Server replication using RMO.  We have SQL 2016 (Standard Edition) on the server acting as the publisher and SQL Server Express Edition as the subscriber.  
Previously, the distributor and the publisher were on the same server and the replication was working.  
We have a client application, the data needs to be synced with the server on a regular basis.  
We have Transactional and merger replication set and rely on pull approach where the client application pulls the data on demand.
For security reasons, the client doesn't want to expose port 1433 (or any other port) on the publisher to the subscribers.  
So, we decided to move the distributor on a remote server, so that the subscriber talks to the publisher via remote distributor.  (The remote distributor can connect and talk to the Publisher.)   However, I am getting an error when I try to sync.  
Wanted to check if replication is possible when port 1433 is blocked for the subscribers?  
If yes, can you please provide me some sample code or pointers to it.  If no, what are the different options that I can have?

SQL server 2016 Replication to Oracle 12102 Subscriber

$
0
0


Hi,

I am getting the below error after adding Oracle subscriber. 

 "Agent message code 20029. The required parameter '-SubscriberDB' is missing. "

(Snapshot agent able to generate a snapshot under snapshot folder successfully. But only Distributor agent giving this error)

Could you please suggest me.

Details: 

SQL server 2016 sp2 : Publisher & Distributor

Oracle 12102 : Oracle subscriber. I have installed full client of Oracle 12c1.

For adding Oracle subscriber:

From sqlcmd I ran,

>exec sys.sp_MSrepl_ORAdatatypes 'Oracle', '12'

>exec sys.sp_MSrepl_MSSQL_ORA_datatypemappings @source_dbms = N'MSSQLSERVER', @destination_dbms = N'ORACLE', @destination_version = '12'

From SSMS

use [DBname]

exec sp_addsubscription @publication = N'DB_To_oracle_<TNS name>_Trans_Publication', @subscriber = N'ORCLDC', @destination_db = N'(default destination)', @subscription_type = N'Push', @sync_type = N'replication support only', @article = N'all', @update_mode = N'read only', @subscriber_type = 3;
go

After that by default, replication created new Linked server with provided @subscriber name and it is using the provider "Microsoft OLE DB Provider for SQL Server"

After that added subscriber connection (from subscriber property): SQL Server Authentication(user should have access on Oracle DB)

TNSPing : succesfull.  (Tnsnames.ora file validated)

Provided Read & exec permissions to Distributor agent service account on Oracle directory.

Environment variable: Added Oracle home & bin path, TNS_admin path.

Publication Access list: Added agent service account & distributor_admin

Snapshot folder: service account has access to it.

Snapshot format: Character 

Allow non-SQL server subscribers : True

ODBC Data source Admin 64bit : System DSN configuration : Test successful 

If I configure new Linked server (with provider " Oracle Provider for OLE DB" and Remote login & password): It is successfully connecting to Oracle DB (on Linked server ).



Foreign keys being created on multiple subscribers

$
0
0

Have a publisher with a specific publication that has 1 article, and 4 subscribers. The subscribers are on 3 separate instances with the the same database name(database1) for 3 of the 4 subscribers. I am having an issue with one table having a foreign key added to it on the 2 of the subscribers with the same database name as the subscriber where the FK's are being dropped/added correctly via the pre/post snapshot scripts. Prior to the snapshot, the 2 subscriber tables do not have the foreign key, but after the snapshot, the key is added. The table(s) where the incorrect foreign key is being added is a table that is in another publication and exists on these 2 subscribers with no foreign keys as these are reporting servers. The  pre and post snapshot scripts that run for the publication deletes and recreates many foreign keys in the 3rd subcriber database, and these foreign keys are being dropped and created as expected, but I can't seem to find why these 2 tables are getting the foreign key added. There are 9 other tables involved with foreign keys to the published article, none of them are having a key added on the 2 subscribers, just this one. I have pasted a screen shot of the post snapshot file so you can see the logic used to apply the foreign keys. The 2 subscribers I am having issues with are not in the server list in the first if statement, there names could be server4 and server5.  What pointed out this problem, is when I dropped the subscriptions and publication to reapply, I was getting an error indicating that the foreign key already exists on those 2 subscriber tables which leads to think it is something other than the pre/post scripts. It is odd that this problem foreign key is the very 1st key dropped/created in the pre/post scripts.  Also both of the articles/tables involved here have "copy foreign key constraints" set to false in their article properties on the publications

Thanks for any insight


SQL Server 2019 snapshot agent error

$
0
0

Hello,

I was trying to configure an SQL Server 2019 transactional replication, but the snapshot agent returns the following error:

Error messages:
Message: An unspecified error had occurred in the native SQL Server connection component.
Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowConnectionFailureException(CConnection* pNativeConnectionWrapper)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.InitializeNativeBcpOutProvider(LogMessageCallback logMessageCallback, String strName, String strApplication, String strHost, String strServer, String strNetwork, Int32 encryptionLevel, String strDatabase, SecurityMode securityMode, String strLogin, SecureString strPassword, Int32 bcpBatchSize, Int32 loginTimeout, Int32 queryTimeout, Int32 packetSize, DeadlockPriority deadlockPriority, String strRowDelimiter, String strFieldDelimiter, Byte syncMethod, Boolean forceOdbcBcp, Boolean forceOleDbBcp, Boolean enableMultipleActiveResultSets, Boolean useReadPastHint, Boolean usePageLockHint, Boolean securePassword)
   at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotProvider.InstantiateBcpOutProviderWorker(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.InstantiateBcpOutProvider(String strBcpConnectionName)
   at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.Initialize()
   at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
   at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQL_REPL, Error number: MSSQL_REPL55012)
Get help: http://help/MSSQL_REPL55012

Any idea why?

Best regards,

José Cruz





Latest Images