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
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
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:
But, even when I try to manually start the snapshot job, I receive the following:
I don't understand what's going on. What am I doing wrong or missing?
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.
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?
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
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
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
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.
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.
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:
Sep 7, 2020 onward:
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.
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 ).
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
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