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

close sql server management studio while running sql server replication

0
0

Hi friends.

I have successfully configured transactional replication (pull type)between 2 sql servers using initialize transactional replication from database backup method. Below my servers;

sql1 = publisher

sql2 = distributor & subscriber (pull type)

My question is

a) Can I close sql server management studio after my replication setup completed & run smoothly.

Thanks in advance

Imra


Setting up Linked Server freezes Client and Server

0
0

I recently had the Oracle client installed on a SQL 2012 64-bit machine that is also a distributor and subscriber for transactional replication. I tried to verify the install by opening the dialog to create a linked server but I neglected to enter the server name first. This not only caused the client to hang but appears to have frozen the server as well. Replication has stopped entirely. Is there a fix for this without doing a reboot?

Adding Tables after Initializing Subscription from Backup

0
0

We have a transaction publication with two subscribers. One was recently re-initialized using a backup. I'm now trying to add tables to the publication. When I do this and generate a snapshot to populate the added tables, the distribution agent ignores the snapshot and continues applying transactions. It then stops when a transaction hits one of the added tables because the "not for replication" identity column option that would have been taken care of by the snapshot isn't there. Is this because the subscription was initialized from a backup and is there a workaround?

System Info: The subscriber and publisher are both SQL 2012 64-bit.

Merge Replication from 2012 SQL Server publisher/distributor to 2014 SQL Express subscriber

0
0

Hi, I'm having a question about which version to use when running SQL Merge Replication.

In my test enviroment I have a SQL 2012 server running as Publisher and Distributor for my Merge Replication. I have now set up a test client running Win7 with SQL 2014 Express as a subscriber. The subscription initializes and runs perfectly.

But according to the SQL documentation this should not be possible as it states that the subscriber should have a version number equal or lower than the publisher. My subscription client was set ut using SQL-scripting, if I try using the wizard it will just cause an error message telling that this is not possible since the client has a newer version number. I still not encountered any problems after I set it up using the script with the sp_addmergepullsubscription and sp_addmergepullsubscription_agent procedures.

The roll-out of my solution will start in a few weeks and I now have to decide whether to use 2014 Express or 2012 Express on the clients. Using 2014 Express will save me for a lot of upgades in a year or two. The 2012 SQL Server running as publisher/distributor will be upgraded to/replaced with a 2014 Server in some few months.

I'm looking for good advices and recommendations for what to choose on the clients, 2012 Express or 2014 Express. Are the any known problems with using 2014 Express as a subscriber to a publisher/distributor running 2012 SQL Server?

All responses are welcome!

Regards, Anders

SQL Server Replication - Geographically Dispersed Data Centers - Stretch Cluster

0
0

Hello All, <o:p></o:p>

I have a question with regards to SQL Replication between geographically dispersed data centers. I am trying to determine the best method to use that offers the most success and most frequent replication. <o:p></o:p>

In this scenario, we will use this for SharePoint environments. We will use the new Windows 2012 Hyper-V Replica feature to replica the SharePoint servers. These will be replicated in an 'OFF' state. This is what I had in mind for the architecture:<o:p></o:p>

Primary Data Center = 2 server failover cluster with SAN storage at primary DC. One active, one passive. Either can be used at any time.
Secondary Data Center = 1 server SQL instance with SAN storage at secondary DC. This would be a passive node that is only used if manually told to do so. <o:p></o:p>

I know many of the out of the box technologies are not supported in a geo replication form as there can be latency issues. Is it as simple as having a third leg of a cluster? How can I point to local SAN storage, rather than the SAN storage used at the primary DC?<o:p></o:p>

I am open to any and all suggestions or recommendations. <o:p></o:p>

Thank you all in advance!
Joe <o:p></o:p>

stream_blob_columns

0
0

I am setting up merge replication in republishers topology. i have few articles setup with @stream_blob_columns as false (the default is false )

Now when im replicating same article at republisher having @stream_blob_columns set to false i get below error:

Warning: To allow replication of FILESTREAM data to perform optimally and reduce memory utilization, the 'stream_blob_columns' property has been set to 'true'.  To force FILESTREAM table articles to not use blob streaming, use sp_changemergearticle to set 'stream_blob_columns' to 'false'.
Msg 20053, Level 11, State 1, Procedure sp_addmergearticle, Line 838

An article with a different stream_blob_columns value already exists for object

My question is why it is setting value to true when i have filestream disabled on server ?

when im replicating same article at republisher having @stream_blob_columns set to true i get below error:

Msg 20053, Level 11, State 1, Procedure sp_addmergearticle, Line 838

An article with a different stream_blob_columns value already exists for object

This kind of make sense because i have article on main publisher with different value for @stream_blob_column.

any help regarding this is greatly appreciated. Here is the table definition

CREATE TABLE [dbo].[table1](
      [cde_Address] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
      [txt_Desc] [varchar](50) NULL,
      [Sort] [int] NULL,
      [Active] [bit] NULL,
CONSTRAINT [PK_table1] PRIMARY KEY CLUSTERED
(
      [cde_Address] 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


Unable to perform retention-based metadata cleanup in database 'XYZ'

0
0

Hi All!

I am facing issues with Merge Replication in SQL Server 2012. The replication type is push-based with both the publisher and the distributor on the same server. Currently I have 5 subscribers which were replicating perfectly till end last week but today I'm facing metadata cleanup issues with all of them. Here is the error :-

-------------------------------------------------------------------------------------------------------------------

Source:  Merge Replication Provider
Number:  -2147199466
Message: The merge process could not perform retention-based metadata cleanup in database 'XYZ'. If this failure continues, try increasing the query timeout for this process, or try reducing the retention period. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
2014-06-30 01:23:59.322 Percent Complete: 0
2014-06-30 01:23:59.322 Category:SQLSERVER
Source:  XYZ-SQL2012
Number:  206
Message: Operand type clash: bigint is incompatible with uniqueidentifier
2014-06-30 01:23:59.385 Percent Complete: 0
2014-06-30 01:23:59.385 Category:SQLSERVER
Source:  XYZ-SQL2012
Number:  206

--------------------------------------------------------------------------------------------------------------------

I can see that all the subscribers are replicating perfectly every 15 mins with the server yet they are showing the above error. For all the subscribers, the subscription expiration is set for an interval of 14 days. I have tried checking the logs but just couldn't get any clues and don't know where to start looking.

Any help would be highly appreciated.

Thanks

Advice setting up replication

0
0

Hi everyone, I'm fairly new to SQL Server and we have just moved from an Oracle 10g environment to a SQL Server 2008 R2 setup and wanted some advice on how to set up replication.  Here's the jist of what I'm looking to accomplish.

1.We have a number of production databases that that should only be "touched" by the vendor applications for performance reasons (this is a public safety set of systems).

2.We have a second SQL Server set up that we can use as a data warehouse for reporting, external agency access, third party vendor access (all of which will be read only, no updates).

3.How do I set up getting data into the data warehouse from production so it is as up to date as possible (preferably within a few minutes of the production database and with as little impact on performance as possible)?

Sorry for all the probably silly/obvious questions but I'd rather ask than flounder around in the dark for several weeks.

Many thanks, Dean Longhurst...


Merge Replication help

0
0

I'm trying to set up a merge replication between two sql server 2008 instances. The publisher server is running on server 2008 setup as a workgroup, the subscriber is on server 2008 domain. I have been able to get the subscriber to connect to the publisher, bur the initialization fails with 'schema 'xxx' was unable to be propagated to the subscriber'. I have specified the snapshot be placed in a network share and shared it with everyone and given everyone permission to read it. I'm not sure what else to do. This is a test environment, but the live implementation will be between domains without a trust relationship

Any iseas?

Transactional Replication Stalled.

0
0

Hi,

We are having a Transactional  replication issue where the Data does not get replicated  and the log Just keeps grawing.

Last week we had an accidental load 15 Million records, on one of  the T replication enabled   Db's .Then  the replication stopped working i mean i look at the replication monitor it says NO transactions to replicate but we have a lot difference with the DATA.I  also see that the logfile file for the DB is growing.  

1.I did a few things like stopping the log reader and restarting.

2.Reinitialize the Snapshot ,the snapshot is taken but is not being applied  to the subscriber .No error msg that i can see.

So had to drop the replication entirely , shrink the log  and recreate it adding few bunches of articles, creating a snapshot for them wait until they are applied and then add the other articles which worked fine for few days , and  DB replication stopped again and log started growing.This time it is also effecting other replications this time too.

I am running out of options can some one plz help!

THanks,

Jack

A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_printstatement":

0
0

Hi,

When we run sp_browsereplcmds command it gives following message. Not sure if this related to any patching.Can somebody provide a solution? 

Msg 6522, Level 16, State 1, Procedure sp_printstatement, Line 0

A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_printstatement":

System.TypeInitializationException: The type initializer for 'System.Data.ProviderBaswe.DbConnectionClosedPreviouslyOpened' threw an exception. ---> System.Threading.ThreadAbortException: Exception of type 'System.Threading.ThreadAbortException' was thrown.

System.Threading.ThreadAbortException: System.TypeInitializationException:

at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory)

  at System.Data.SqlClient.SqlConnection.Close()

  at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing)

  at System.ComponentModel.Component.Dispose()

  at Microsoft.SqlServer.Replication.ReplCmdsReader.sp_printstatement(String strCmd)


Rahul

Problems starting Replication on large databases - SQL 2012

0
0

Hi all,

I have been battling SQL Server for a week trying to get replication up and running, now I realize that most probably I am doing something wrong and I hope that one of you can help pointing me in the right direction.

I want to start replication of a big (180GB) database in my lab environment and every time the end result is errors of the type "The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: 20598)".

There are more than one database to be replicated and the smaller ones (<= 4GB) have started without problems, a medium database of 21GB had one similar error and has been running for a few days since I found and inserted the missing data in the subscriber DB.

A couple of facts:

- I have set up the distributor as a remote distributor since the publishers are mirrored databases.
- I assume the distributor setup is OK since all the replicated databases are taking the same 'path' and the smaller ones are working.

- The distributor and the subscriber are set up on the same server.
- All in all the following procedure takes about 3.5-4 hours.
- The database is running in Full Recovery mode
- All log backups on the publisher are turned off for the duration.

Here's what I do:
On the publisher
Create the publication and add all the articles

use [Zaragoza]
exec sp_replicationdboption @dbname = N'Zaragoza',
                            @optname = N'publish',
                            @value = N'true'
GO
exec [Zaragoza].sys.sp_addlogreader_agent @job_login = N'NS-LAB-DB-40\SqlServiceUser',
                                          @job_password = N'********',  -- Modify Here
                                          @publisher_security_mode = 1,
                                          @job_name = null
GO
-- Adding the transactional publication
exec sp_addpublication @publication = N'Zaragoza_Full',
                       @description = N'Transactional publication of database ''Zaragoza'' from Publisher ''NS-LAB-DB-38''.',
                       @sync_method = N'concurrent',
                       @retention = 0,
                       @allow_push = N'true',
                       @allow_pull = N'true',
                       @allow_anonymous = N'false',
                       @enabled_for_internet = N'false',
                       @snapshot_in_defaultfolder = N'true',
                       @compress_snapshot = N'false',
                       @ftp_port = 21,
                       @allow_subscription_copy = N'false',
                       @add_to_active_directory = N'false',
                       @repl_freq = N'continuous',
                       @status = N'active',
                       @independent_agent = N'true',
                       @immediate_sync = N'true',  -- Needs TRUE
                       @allow_sync_tran = N'false',
                       @allow_queued_tran = N'false',
                       @allow_dts = N'false',
                       @replicate_ddl = 1,
                       @allow_initialize_from_backup = N'true',  -- Modify Here
                       @enabled_for_p2p = N'false',
                       @enabled_for_het_sub = N'false'
GO

/* SHOULD not need this since no snapshots will be generated
exec sp_addpublication_snapshot @publication = N'Zaragoza_Full',
                                @frequency_type = 1,
                                @frequency_interval = 1,
                                @frequency_relative_interval = 1,
                                @frequency_recurrence_factor = 0,
                                @frequency_subday = 8,
                                @frequency_subday_interval = 1,
                                @active_start_time_of_day = 0,
                                @active_end_time_of_day = 235959,
                                @active_start_date = 0,
                                @active_end_date = 0,
                                @job_login = N'NS-LAB-DB-40\SqlServiceUser',
                                @job_password = N'********',
                                @publisher_security_mode = 1
*/

exec sp_addarticle @publication = N'Zaragoza_Full',
                   @article = N'__MigrationLog',
                   @source_owner = N'dbo',
                   @source_object = N'__MigrationLog',
                   @type = N'logbased',
                   @description = null,
                   @creation_script = null,
                   @pre_creation_cmd = N'drop',
                   @schema_option = 0x000000000803509F,
                   @identityrangemanagementoption = N'manual',
                   @destination_table = N'__MigrationLog',
                   @destination_owner = N'dbo',
                   @vertical_partition = N'false',
                   @ins_cmd = N'CALL sp_MSins_dbo__MigrationLog',
                   @del_cmd = N'CALL sp_MSdel_dbo__MigrationLog',
                   @upd_cmd = N'SCALL sp_MSupd_dbo__MigrationLog'
GO
-- MANY more "EXEC sp_addarticle"....




On the publisher
I recompile the subscription SPs since I had problems with them once.
I use the output from the following statement:

USE Zaragoza;
EXEC sp_scriptpublicationcustomprocs @publication=N'Zaragoza_Full';




On the publisher
I backup the database & log

BACKUP DATABASE Zaragoza TO DISK = 'E:\Backup\Zaragoza_FULL.bkp' WITH INIT, STATS=5;
BACKUP LOG Zaragoza TO DISK = 'E:\Backup\Zaragoza_LOG.bkp' WITH INIT, STATS=5;


On the subscriber
Copy the backups from the publisher

CD /D E:\Backup
COPY /Y \\NS-LAB-DB-38-mirror\Backup\Zaragoza_FULL.bkp .
COPY /Y \\NS-LAB-DB-38-mirror\Backup\Zaragoza_LOG.bkp .


On the subscriber
Restore the database and log backups

USE [master]
GO

RESTORE DATABASE Zaragoza_Sub
FROM DISK = 'E:\Backup\Zaragoza_FULL.bkp'
WITH NORECOVERY, REPLACE, STATS=5,
     MOVE 'Zaragoza' TO 'I:\mssql_repl\Zaragoza_Sub\Zaragoza_Sub.mdf',
     MOVE 'Zaragoza_log' TO 'I:\mssql_repl\Zaragoza_Sub\Zaragoza_Sub_log.ldf';
GO

RESTORE LOG Zaragoza_Sub
FROM DISK = 'E:\Backup\Zaragoza_LOG.bkp'
     WITH RECOVERY, STATS=25;
GO


On the subscriber
Remove all triggers since I noticed that they interfered with the replication SPs

USE Zaragoza_Sub;

DECLARE @Trigger nvarchar(100),
        @SQL nvarchar(2000);

DECLARE curTriggers CURSOR
    LOCAL FAST_FORWARD FOR
    SELECT DISTINCT tr.name TriggerName--, te.type_desc TriggerType, ob.name TableName, tr.is_disabled, c.text
    FROM sys.triggers tr INNER JOIN
         sys.trigger_events te ON tr.object_id = te.object_id INNER JOIN
         sys.objects ob ON tr.parent_id = ob.object_id;

OPEN curTriggers;
FETCH NEXT FROM curTriggers INTO @Trigger;
WHILE @@FETCH_STATUS = 0
BEGIN
    SELECT @SQL = 'DROP TRIGGER dbo.' + @Trigger + ';';
    EXEC sp_executesql @SQL;
    FETCH NEXT FROM curTriggers INTO @Trigger;
END;
CLOSE curTriggers;
DEALLOCATE curTriggers;


On the publisher
Add the subscription and the push agent

-----------------BEGIN: Script to be run at Publisher 'NS-LAB-DB-38'-----------------
-----------------                           *********               -----------------
use [Zaragoza]

exec sp_addsubscription @publication = N'Zaragoza_Full',
                        @subscriber = N'NS-LAB-DB-40',
                        @destination_db = N'Zaragoza_Sub',
                        @subscription_type = N'Push',
                        @sync_type = N'initialize with backup',  --@sync_type = N'replication support only',
                        @status = N'active',  -- ADD this line
                        @article = N'all',
                        @update_mode = N'read only',
                        @subscriber_type = 0,
                        @backupdevicetype=N'disk',
                        @backupdevicename=N'E:\backup\Zaragoza_LOG.bkp';

exec sp_addpushsubscription_agent @publication = N'Zaragoza_Full',
                                  @subscriber = N'NS-LAB-DB-40',
                                  @subscriber_db = N'Zaragoza_Sub',
                                  @job_login = N'NS-LAB-DB-40\SqlServiceUser',
                                  @job_password = N'********',   -- Modify Here
                                  @subscriber_security_mode = 1,
                                  @frequency_type = 64,
                                  @frequency_interval = 0,
                                  @frequency_relative_interval = 0,
                                  @frequency_recurrence_factor = 0,
                                  @frequency_subday = 0,
                                  @frequency_subday_interval = 0,
                                  @active_start_time_of_day = 0,
                                  @active_end_time_of_day = 235959,
                                  @active_start_date = 20140618,
                                  @active_end_date = 99991231,
                                  @enabled_for_syncmgr = N'False',
                                  @dts_package_location = N'Distributor';
GO
-----------------END: Script to be run at Publisher 'NS-LAB-DB-38'-----------------



The worst part is that this is only a LAB system, when I apply this to Live I will have to deal with a 24/7 environment with 10,000+ transactions a day, so downtime is a total No-No.

If you are missing any details do not hesitate to ask, I will gladly provide all the details I have.

Have a great day

DS

How to configure Peer To Peer Topology after adding new table column to a database schema

0
0

Greetings,

Our project is using SQL Server 2008 R2 running on Windows Server 2008 R2.
We are currently trying to set up replication between two SQL Server Database.

We are using Transactional Replication with Peer-To-Peer-Topology configured.
During the setup, no error message is prompted and we were able to configured Publication in both server successfully.
However, when the replication process started, we always received an error message saying that 'Column A' does not exist in 'Table A'. Although this column is there in both databases.

Column A was recently added into the schema. Is there any step that I missed here, if I want to set-up replication right after adding new column?

Log Reader Agent and Snapshot Agent wont start

0
0

Hi There,

I've two SQL 2012 servers with multiple instances installed.

I've started replicating the databases in these instances using transactional replication and thus far they've worked without a hitch.

One of my instances, annoyingly, has an issue where the Log Reader Agent and Snapshot Agent refuse to start, and I've followed exactly the same process as with the other instances\databases.

The Agents are configured to make use of a domain user account with sysadmin permissions to the instances on both servers.

I get the following two error when I View Log Reader Agent Status:

The job failed.  The Job was invoked by User sa.  The last step to run was step 2 (Run agent.).

I've asked the agent to run as my DOMAIN\sqlservice account, so I've no idea why it's moaning about sa?!!?

I get the following error when I View Snapshot Agent Status:

The replication agent has not logged a progress message in 10 minutes. This might indicate an unresponsive agent or high system activity. Verify that records are being replicated to the destination and that connections to the Subscriber, Publisher, and Di

If I try to start either agent I'm told that the request to run job was refused because the job has been suspended, "Changed database context"??  Error 22022.

Can anyone help?

Remote Database Snapshot

0
0
We have a third party application . The database for this third party application is hosted by a separate firm remotely. Now our organization wants to do some reporting out of this database.  Now we will not be allowed direct remote access to their database. My question is, should we tell them to send us a daily snapshot of database ?

What is the best way to drop and recreate a Primary Key in the Replication Table?

0
0

I have a requirement to drop and recreate a primary key in a table which is part of Transaction replication. What is the best way to fo it other than remove it from replication and add again?

Thanks


Swapna

Transfer bulk data using replication

0
0

Hi,

We are having transactional replication setup between two database where one is publisher and other is subscriber. We are using push subscription for this setup.

Problem comes when we have a bulk data updates on the publisher. On publisher size the update command gets completed in 4 mins while the same takes approx 30 mins to reach on the subscriber side. We have tried customizing the different properties in Agent Profile like MaxBatchSize, SubsriptionStreams etc but none of this is of any help. I have tried breaking the command and lot of per & comb but no success.

The data that we are dealing with is around 10 millions and our production environment is not able to handle this.

Please help. Thanks in advance!

Samagra

SQL Server 2014 Replication: Peer-to-peer replication

0
0

SQL Server 2014 Replication wizard: Peer-to-peer replication -> Agent Security Settings setup only Log Reader Agent Security Settings are available.

After I selected replication type and articles only Log Reader Agent Status was available, the Snapshot Agent Reader Status displays text:

  "A Snapshot Agent job has not been created for this publication."

Another issue with replication:

  "Peer-to-peer publications only support a '@sync_type' parameter value of 'replication support only', 'initialize with backup' or 'initialize from lsn'.
The subscription could not be found."

Search how to resolve issues in SQL Server 2014?









How to re-generate a scall style transcriptional replication customer proc for update?

0
0

Hi ,

Does anyone know that how to re-generate a scall style transcriptional replication customer update proc ?

For example i want to re-generate a customer update proc:

-- get article id

select artid,name,upd_cmd from dbo.sysarticles
where name='xmltest'

--artidnameupd_cmd
--11xmltest SCALL [sp_MSupd_dboxmltest]

-- try re-generate customer update proc

exec sp_scriptmappedupdproc 11

-- try re-generate customer update proc

exec sp_scriptdynamicupdproc '11'

-- and all get errors below:

/*

Msg 14156, Level 16, State 1, Procedure sp_scriptupdproccore, Line 217

The custom stored procedure calling the format for the update command specified in the article definition does not match the MCALL format.

*/

Many thanks.

Full Replication with only selected tables merged

0
0
Is it possible to setup replication so that the whole database is replicated and published, but only some of the tables are merged with the subscriber, the rest are just pushed to the subscriber?  Could this be accomplished by setting up two different publications?  One with merge tables and the other with just push, but both within the same database?
Viewing all 4054 articles
Browse latest View live




Latest Images