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

P2P Transactional Replication Error When Adding a Subscriber

$
0
0

I am trying to add one more node in peer-to-peer cluster. In current state, I have 3 servers A, B and C. I need to add a node D with node A(only). For this, I used following steps:

  • Took full backup from Node A
  • Copied it to Node D
  • Restored the backup
  • Added publications in both nodes.
  • Added subscription for Node D in publisher Node A with sync_type 'initialize with backup'

As soon as the commands were run, the Log Reader in Node A started throwing the below errors:

  • The process could not execute 'sp_MSadd_replcmds' on 'Node A'. (Source: MSSQLServer, Error number: 1007) Get help: http://help/1007
  • The transactions required for synchronizing the nosync subscription created from the specified backup are unavailable at the Distributor. Retry the operation again with a more up-to-date log, differential, or full database backup. (Source: MSSQLServer, Error number: 1007) Get help: http://help/1007
  • IDistPut Interface has been shut down. (Source: MSSQL_REPL, Error number: MSSQL_REPL2000) Get help: http://help/MSSQL_REPL2000
  • The last step did not log any message! (Source: MSSQL_REPL, Error number: MSSQL_REPL22037) Get help: http://help/MSSQL_REPL22037

As this was affecting the p2p replication between Nodes A, B and C, I removed the subscription for Node D. This didn't resolve the error. On further investigation I found that the Distribution Cleanup job was still running. Probably that caused the issue.

Now, I am just hoping to make the p2p replication between already existing nodes A, B and C working again, the way it was before. But, all my attempts have resulted in no change in Log Reader Agent. It is stuck at the same error. - The process could not execute 'sp_MSadd_replcmds' on 'Node A'. (Source: MSSQLServer, Error number: 1007) Get help: http://help/1007 - The transactions required for synchronizing the nosync subscription created from the specified backup are unavailable at the Distributor. Retry the operation again with a more up-to-date log, differential, or full database backup. (Source: MSSQLServer, Error number: 1007) Get help: http://help/1007 - IDistPut Interface has been shut down. (Source: MSSQL_REPL, Error number: MSSQL_REPL2000) Get help: http://help/MSSQL_REPL2000 - The last step did not log any message! (Source: MSSQL_REPL, Error number: MSSQL_REPL22037) Get help: http://help/MSSQL_REPL22037

Please advise on any steps to resolve this. Thanks



Is it possible to turn on CDC on MSSQL server that is populated by a Transactional Replication Subscription?

$
0
0

We have 2 MSSQL production servers synced by transactional replication. For reasons not under my control we can not enable CDC on the production servers.  Instead, we have a third server synced by transactional replication that we would like to enable CDC on - we have another framework that needs to read the CDC tables for our real-time pipeline.

We set this up yesterday, but it seems that the CDC tables on the third server are not being populated by the transactional replication operations. After 12 hours, there are no entries... we should have 100,000s of records. So, first question: Is it possible for CDC to track changes created solely by a transactional replication subscription?  If so, how do we do this? We can easily get transactional replication working. And we have in the past easily gotten CDC enabled and working by itself.

Thanks Community!

Snapshot fails with DATA CONVERSION ERROR on Article with SQL_VARIANT datatype.

$
0
0

This publication has one article, it was failing for a MEMORY MAP failure.

Now fails with a DATA CONVERSION error. The snapshot progresses through a large table in multiple threads, then always stops with a DATA CONVERSION error.  Strangely, this has worked for several years but now fails.

Publisher is SS 2008R2 and the subscribers are SS 2016.

The SQL_VARIANT columns have alternately integer, character or datetimestamp data.

 


SET

ANSI_NULLSON

GO



SET

QUOTED_IDENTIFIERON

GO



CREATE

TABLE[MYTroublesometable]

[SnappyChangeEventID] [bigint] NOTNULL,

[SnappyID] [int] NOTNULL,

[SnappyChangeEventTypeID] [int] NOTNULL,

[NumberID] [bigint] NOTNULL,

[NumberTypeID] [tinyint] NOTNULL,

[ChangeByPersonID] [int] NOTNULL,

[ChangeDate] [datetime] NOTNULL,

[OldValue] [sql_variant] NULL,

[NewValue] [sql_variant] NULL,

[ContextValue1] [sql_variant] NULL,

[ContextValue2] [sql_variant] NULL,

CONSTRAINT[PK_SnappyChangeEventArchive]PRIMARYKEYCLUSTERED

(


[SnappyID]

ASC

)

WITH(PAD_INDEX=OFF,STATISTICS_NORECOMPUTE=OFF,IGNORE_DUP_KEY=OFF,ALLOW_ROW_LOCKS=ON,ALLOW_PAGE_LOCKS=ON,FILLFACTOR=90)ON[PRIMARY]


)

ON[PRIMARY]


GO


David z

Mirroring Status Change Alerts - Getting an email every 2 mins about Mirror being broken when it's not

$
0
0

Hi

I followed this page in order to setup Alerts for Mirroring: Create Alerts for SQL Server Mirroring Failovers  

This works Ok, I disabled the nic on the Mirror server - the Principal server alerted me of the mirror being down. Then I enabled the nic on the Mirror server - but the Principal server kept alerting me .... every 2 minutes....

What am I doing wrong here?

The alert configured was this: 

Thanks, M


Maelito


Transaction replication - subscriber db movement to another drive

$
0
0

Pub,& distr in same server : ServerA    ,   sub 1 in server B,   sub2 in server C

Database :  DB   (pub) 

Database : DB1     (sub 1)  

Database : DB2     (sub 2) 

Type:  transnational replication

Scenario:

Server B, going to reconfigure. there is disaster may happen on that database drive.

for safer side i want to move this (sub 1) db to persistent Drive.

how to move this subscriber db into another drive during replication setup?


correct me if am wrong on below workaround:

confirm no pending undistributed cmd

stop “Log Reader Agent”.

Snapshot Agent should be completed and stop


make sub db offline with single user

modify file name in system catalog

copy mdf,ldf file physical to new location

set da online & multi user mode


start all replication jobs which is stopped earlier.



SQL 2019 CTP2.2 Replication error in sp_changereplicationserverpasswords

$
0
0

Hi, I am trying to change SQL replication agents password

exec sp_changereplicationserverpasswords @login_type = 0, @login = 'sa', @password = ' PASS'

Msg 208, Level 16, State 1, Procedure master.sys.sp_MSchangerepltablepasswords, Line 26 [Batch Start Line 108]
Invalid object name 'MSreplservers'.

Database 'BTScratch' cannot be deleted because it is used as a sync metadata database which still contains sync groups and/or sync agents.

$
0
0

 Database 'BTScratch' cannot be deleted because it is used as a sync metadata database which still contains sync groups and/or sync agents.

This database does not have Sync Groups or Sync Agents.  At least not visible in the Azure Portal.  My goal is to delete the database, but am not able to do so based on the apparent existence of sync metadata in the database.  How do I remove this metadata with the goal to delete the entire database?

-Brian

Replication doesn't work after installed SQL 2012 SP3 to SQL 2005

$
0
0

Hi Sir/Madam,

I installed SQL 2012 SP3(Enterprise Edition,Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64) ) in a prodcution database server, in which we are using transactional replications to

1). SQL 2012 database server , it works fine;

2). SQL 2005 database server(Standard Edition, Microsoft SQL Server 2005 - 9.00.4340.00 (X64) ), it doesn't work;

The error message is,

Message: declare @event_type SMALLINT = 0, @distributor_major_version SMALLINT = 11, @distributor_minor_version SMALLINT = 0, @distributor_build_number SMALLINT = 6020 if object_id(N'sys.sp_repl_generate_subscriber_event') is not null
exec sys.sp_repl_generate_subscriber_event @event_state = @event_type, @distributor_major_version = @distributor_major_version, @distributor_minor_version = @distributor_minor_version, @distributor_build_number = @distributor_build_number
2016-01-22 19:22:02.180 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  139
Message: Cannot assign a default value to a local variable.
2016-01-22 19:22:02.180 Category:NULL
Source:  Microsoft SQL Server Native Client 11.0
Number:  137
Message: Must declare the scalar variable "@event_type".

I couldn't found any solution to fix it.

Please advise,

Thanks,


SQL Replication problem

$
0
0

Hi,

I tried to add new article to already existing and working publication and replication. I create a new snapshot after that and creation went fine. Replication started and table was created on subscriber, but stay empty with following error massage:

Error messages:
The process could not bulk copy into table '"dbo"."Table1"'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20037)
Get help: http://help/MSSQL_REPL20037
metadata query failed
Invalid character value for cast specification (Source: MSSQLServer, Error number: 22018)
Get help: http://help/22018
Unspecified error

Publisher/Distributor: MS SQL 2008 R2 (SP3) - 10.50.6529.0 (X64)

Subcriber: MS SQL 2016 (SP2-CU3) (KB4458871) - 13.0.5216.0 (X64), Compatibility level 130, same collation as on Publisher

And everything else is working fine, transactions goes from one server to another server, except that table table1, which is empty. And I tried to create snapshpot few times, with same result.

Any suggestion?

Custom Replication in Uni-Direction

$
0
0

All, need help please.

I have DBI and DBII on the same server...Let's consider that DBI is the primary database and DBII is the replicated copy of DBI. While resources working on DBI there will changes done on parallel on DBII as well..at the end of the day, all the DML's done on DBII needs to be upserted/merged into DBI without breaking any referential integrity and by keeping a fresh replicated copy of DBI for the next day use. Please advise me a best approach to handle this scenario or please guide me where I can find solutions to this. thanks in Advance. 

Happy new year all!!





Deleted Records in One Table [Transactional]

$
0
0

On the Subscriber DB (S-DB), a user deleted records by accident.

I can identify the missing records using columns keys (I have no  identity column). Can I just copy these missing records back into the table?

TIA



Moving a 6TB database to a new SAN question

$
0
0

Hi All,

Looking for the best method to do this, maybe I'm missing something.

I have a 6TB database on a NETAPP San and we are moving to a NIMBLE San. Disk resources have been created and allocated on the same Physical machine. 

I can't backup and restore the 6TB as would take too long as the downtime needs to be as little as possible i.e. max 2 to 3 hours.

The database is in simple mode so no log shipping. I've been advised by a third party that replication to the new disk is the way to go. (Comments welcome).

If going with replication how do I get the initial snapshot across to the 2nd drive? would the replication snapshot be the way forward for 6TB? I have 7 days to get them in sync before we swap drives across. I was thinking Async to start with the synchro just before we change to the new drive letter and change the drive allocation mappings?

I've read that Mirroring may be another way forward but again how to sync the initial snapshot?

The server is still on SQL2012 at the moment.

Thanks in advance for any suggestions or comments.

Kind Regards,

Ian

SQL Server Merge Replication issues - Merge is taking very long - about an hr for 2.5M records

$
0
0

Our use case - We have two SQL server instances and both are update-able. Primary OLTP is transnational and dedicated for UI and other instance dedicated data ingestion via SSIS or APIs. As changes occur in source systems, that data gets ingested via real-time APIs and SSIS packages. We would like both sync'ed up near real-time with latency not more than 5 mins. Our daily volume of changed records for both databases combined is roughly 50M records.

Question - Can merge replication achieve this ? if it can how should our config look like ? Any help is much appreciated.

Thanks

How to Configure Replication for Always On Availability Groups under SQL Server 2016 Standard Edition.

$
0
0
I would like to setting up Transactional replication on a database which is part of basic AlwaysOn Availability Group with No readable secondary

Server 1 : AlwaysOn Availability Group Primary replica and transactional replication publisher

Server 2 : AlwaysOn Availability Group Primary replica and transactional replication publisher

Server 3 : replication subscriber and distributor

I received the error message  (as below) when I EXEC sys.sp_validate_replica_hosts_as_publishers at distribution database:
Msg 21899, Level 11, State 1, Procedure sp_hadr_verify_subscribers_at_publisher, Line 109 [Batch Start Line 2]

The query at the redirected publisher 'Server 1' to determine whether there were sysserver entries for the subscribers of the original publisher 'Server 1' failed with error '976', error message 'Error 976, Level 14, State 1, Message: The target database, 'xxx', is participating in an availability group and is currently not accessible for queries. Either data movement is suspended or the availability replica is not enabled for read access. To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group.  For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.'.
One or more publisher validation errors were encountered for replica host 'Server 1'.

Due to SQL Server edition limitation, readable secondary is not able to set to read-only or intended read.

Is it possible to Configure Replication for Always On Availability Groups in this scenario and how to setup.

how to check the Rebuild index status in sql server? --urgent

$
0
0

Hi All,

I am facing the rebuild index issue.

I have 2TB of database , we have configured the rebuild index before on wards i have put the database in simple recovery model and stopped the all jobs also.but rebuild index was taking  the  lot of time(last 72 hours it's running )

actually application team was asking  to us ,how much time it will take to complete .

can u please tell me how to check the status of the rebuild index .

please post the your valuable answers.

Thanks in advance.


RAM



Log reader agent is not getting started

$
0
0

Hi,

We have created publication for single test table which has 2 columns only and inserted some rows in it.

But when we start ‘Log Reader Agent’, it’s also getting failed. As we checked in job history its showing this error:

Message

Executed as user: APLSRPDOMAIN\800xaservice. String or binary data would be truncated. [SQLSTATE 22001] (Error 8152).  The step failed.

We tried to get some solution for it, but none of it got worked.

Please provide some help in this

wfc sync 2.1 issue, trigger changed data not synced.

$
0
0

We just upgraded to sync 2.1 with sqlce 3.5 SP2 and SQL Server, everything works fine except one issue:

When sync data change from client to sql server, we have a 'after Insert, Update' trigger on the table to update a column value which is called 'sync_date', in order to get the trigger changed value back to the client side (sqlce 3.5), I tried different ways, here's a couple:

1. 

var scope = string.Format("{0}-{1}", CommonStaticConstants.COMMON_SCOPE_BIDIRECTION, auth.ApplicationUser);
GetOrchestrator(auth, GetMachineNames(auth.ApplicationUser), scope, SyncDirectionOrder.UploadAndDownload, false).Synchronize();

2.

var scope = string.Format("{0}-{1}", CommonStaticConstants.COMMON_SCOPE_BIDIRECTION, auth.ApplicationUser);
GetOrchestrator(auth, GetMachineNames(auth.ApplicationUser), scope, SyncDirectionOrder.Upload, false).Synchronize();
GetOrchestrator(auth, GetMachineNames(auth.ApplicationUser), scope, SyncDirectionOrder.Download, false).Synchronize();

Here's the logic of GetOrchestrator():

private static SyncOrchestrator GetOrchestrator(LoginAuthenticator auth, string machineNames, string scopeName, SyncDirectionOrder direction, bool isRescopingRequired)
        {
            if (!orchestratorMap.Keys.Contains(scopeName) || isRescopingRequired)
            {
                var destinationProxy = new SqlSyncProviderProxy(auth, machineNames, scopeName, isRescopingRequired);

                orchestrator = new SyncOrchestrator();
                var localProvider = new SqlCeSyncProvider();
                localProvider.ScopeName = scopeName;
                localProvider.Connection = new SqlCeConnection(Infrastructure.ConnectionManager.GetClientDbConnection());
                localProvider.ApplyChangeFailed += OnApplyChangeFailed;
                
                orchestrator.LocalProvider = localProvider;
                orchestrator.RemoteProvider = destinationProxy;
                orchestrator.Direction = direction;

                CheckIfProviderNeedsSchema((SqlCeSyncProvider)orchestrator.LocalProvider, auth, machineNames, isRescopingRequired);

                if (orchestratorMap.Keys.Contains(scopeName))
                {
                    orchestratorMap.Remove(scopeName);
                }
                orchestratorMap.Add(scopeName, orchestrator);
            }

            orchestratorMap[scopeName].Direction = direction;

            return orchestratorMap[scopeName];
        }

none of them works for me, data change can be uploaded correctly, but trigger changed value never came back to client side.

Any idea what I'm missing here? Please let me know what other code pieces I need to provide.

Thanks in advance.

Jerome

Expired subscription clean up failing with sp_MSdrop_expired_subscription

$
0
0

This issue is with 3 servers that are running SQL 2005 SP3 with transactional replication. The "Expired subscription clean up" job is failing with the message "The name myDatabase.sys.sp_MSdrop_expired_subscription' is not a valid identifier. [SQLSTATE 42000] (Error 203).  The step failed.". However, it does work on 1 server with transactional and another with merge.

I have looked at the job and it calls  "EXEC sys.sp_expired_subscription_cleanup"

This in turn gets a list of publishers, determines the type of replication and then calls dbname.sys.sp_MSdrop_expired_subscription.

I have looked at all publications (working and not working), and they are all the same. We have them all set to subscription does not expire.
I have tried to look for the procedure sys.sp_MSdrop_expired_subscription which should exist in each publicating database, and have not found it anywhere. I have run manually the procedure sys.sp_expired_subscription_cleanup and get the same error on all publicating servers. I have compared the job across all servers to verify it is the same.

So my problem is this - on the servers that the job fails I think this seems to make sense - the procedure doesn't exist. However, on the servers that it does work as a job, I'm not so sure. The procedure sys.sp_MSdrop_expired_subscription doesn't exist, when sys.sp_expired_subscription_cleanup is executed manually it gives an error, however the job reports that it was sucessfull.

For the moment I've disabled the jobs, which is not the solution I prefer but I am at a loss as to why they are failing on one server and not the next.

Am I missing something here ? I would really like to understand why these errors are occurring.

SQL Database clustering

$
0
0

Hi

we want to setup SQL Database clustering, we will procure two same server but need to confirm which Windows 2016 Server OS required, is clustering possible on Windows OS 2016 Std edition.

how can setup SQL clustering that if one data save on one sever it automatically replicate on another.

if in any case first server down, we can up another and user database.

any comment will highly appreciate.


Arvind

Problem with CDC (change data capture)

$
0
0
On a high-load base (about a million commands per second)
Included CDC on the table (about 1 000 000 000 rows) with changes of about 3 million per day

It turned out that the table of changes gets not all.
Of the million inserts per day does not come about 100.
That is, in the table on which the CDC is enabled, new IDS appear, and there are no records in the change table. Whole transactions go missing. Sometimes several in a row.
How many misses Deletes and updates have not figured out yet.
There are no errors.

The storage time changes to 5 days. 

Increased the number of processed transactions to 5000 (didn't help)

EXECUTE sys.sp_cdc_change_job   
    @job_type = N 'capture',  
    @maxtrans = 5000;  

Other settings are default.
About this problem there is only one mention in the Internet and it is without comments and very ancient.
Viewing all 4054 articles
Browse latest View live




Latest Images