DB Replication Or Table Replication Via Triggers?

Apr 17, 2007

Hello everyone,

I am involved in a scenario where there is a huge (SQL Server 2005)
production database containing tables that are updated multiple times
per second. End-user reports need to be generated against the data in
this database, and so the powers-that-be came to the conclusion that a
reporting database is necessary in order to offload report processing
from production; of course, this means that data will have to be
replicated to the reporting database. However, we do not need all of
the data in the production database, and perhaps a filtering criteria
can be established where only certain rows are replicated over to the
reporting database as they're inserted (and possibly updated/deleted).
The current though process is that the programmers designing the
queries/reports will know exactly what data they need from production
and be able to modify the replication criteria as needed. For example,
programmer A might write a report where the data he needs can be
expressed in a simple replication criteria for table T where column X
= "WOOD" and column Y = "MAHOGANY". Programmer B might come along a
month later and write a report whose relies on the same table T where
column X = "METAL" and column Z in (12, 24, 36). Programmer B will
have to modify Programmer A's replication criteria in such a way as to
accomodate both reports, in this case something like "Copy rows from
table T where (col X = "WOOD" and col Y = "MAHOGANY") or (col X =
"METAL" and col Z in (12, 24, 36))". The example I gave is really
trivial of course but is sufficient to give you an idea of what the
current thought-process is.

I assume that this is a requirement that many of you may have
encountered in the past and I am wondering what solutions you were
able to come up with. Personally, I believe that the above method is
prone to error (in this case the use of triggers to specify
replication criteria) and I'd much rather use replication services to
copy tables in their entirety. However, this does not seem to be an
option in my case due to the sheer size of certain tables. Is there
anything out there that performs replication based on complex
programmer defined criteria? Are triggers a viable alternative? Any
alternative out-of-the-box solutions?

Any feedback would be appreciated.

Regards!

Anthony

View 11 Replies


ADVERTISEMENT

Adding New Table In Replication And Changing One Column Replication Database

Jan 17, 2002

Hi,

In my production box is running on SQL7.0 with Merge replication and i want add one more table and i want add one more column existing replication table. Any body guide me how to add .This is very urgent
Regards
Don

View 1 Replies View Related

Triggers And Replication

Aug 25, 2000

Is there a way to not initiate triggers during replication? We have a few triggers that we do not want to use while replicating. They cause data in other tables to be deleted.

View 2 Replies View Related

Triggers And Replication

Jul 23, 2005

If a table is updated via replication, will an INSERT trigger go off ifa new row is being added?--Bob

View 3 Replies View Related

Replication Of Triggers

Jun 21, 2006

Hello !

I have set up some transactional replication on one of my database but I can't see where I can specify that we should replicate the triggers. What I have seen is that the triggers are automatically replicated when the table is replicated except id they are marked "Not for replication"

But it does not seem to work for me. Do you have any idea ?

Thanks,

View 9 Replies View Related

Removing Replication Triggers.

Jan 13, 2005

Does anyone know how to remove 'Replication Triggers'?

I have a database created by export of data object. This process does not export any system tables to do with replication but there still seems to be something in the database which references them. There is no poblem if I backup and restore the dataabse.

Any advice?

Thanks Ed

View 1 Replies View Related

How To Configure Replication Triggers To SET NOCOUNT ON?

Jul 16, 2007

Hopefully simple question:

How to configure replication so that replication triggers issue a SET NOCOUNT ON?

Also: are there any negative consequences of adding a SET NOCOUNT ON to replication triggers?

I'm not a DBA so my experience with replication is pretty much non-existent. Hopefully, there's a simple configuration option that I can apply when setting up replication for a database. If not, is it going to be feasible for me to write a script that runs over the replication triggers/procs to add this SET statement (any pointers on inbuilt procs that would help here would be real useful)?

Thanks in advance
Christian

View 6 Replies View Related

Merge Replication Corruption (system Triggers And Views)

Sep 21, 2006

All of a sudden none of our merge replications are working. In fact you can't even insert, update or delete and data from the tables in the merge publication. When trying that, we get an error stating:

Msg 550, Level 16, State 1, Procedure MSmerge_ins_E3F43EF8B259476099BBB194A2E1708C, Line 42
The attempted insert or update failed because the target view either specifies WITH CHECK OPTION or spans a view that specifies WITH CHECK OPTION and one or more rows resulting from the operation did not qualify under the CHECK OPTION constraint.
The statement has been terminated.

Currently, the only solution I've found is to delete the publication and recreate it. I'm trying to figure out why this happened. It happened on a development server that to my knowledge, hasn't been changed in a week or so outside of changing the server's IP address. Would that cause such an error to occur?

-mike

View 5 Replies View Related

Creating Triggers In Transactional Replication On The Subscriber Side

Jun 17, 2007

Hi all

i have setup default transactional replication using locat distributor scheme. I need to create triggers on tables at subscriber side. Can this be done using transaction replication?



Thanks,

Arslan.

View 2 Replies View Related

SQL 2005 Error: Replication-Replication Distribution Subsystem: Agent (null) Failed.

Jun 15, 2007

I'm getting this, after upgrading from 2000 to 2005.Replication-Replication Distribution Subsystem: agent (null) failed.The subscription to publication '(null)' has expired or does notexist.The only suggestions I've seen are to dump all subscriptions. Sincewe have several dozen publications to several servers, is there adecent way to script it all out, if that's the only suggestion?Thanks in advance.

View 3 Replies View Related

Replication Issues After A Database Restore - Unable To Drop Or Create Transactional Replication

Sep 13, 2007

Hi,I have transactional replication set up on on of our MS SQL 2000 (SP4)Std Edition database serverBecause of an unfortunate scenario, I had to restore one of thepublication databases. I scripted the replication module and droppedthe publication first. Then did a full restore.When I try to set up the replication thru the script, it created thepublication with the following error messageServer: Msg 2714, Level 16, State 5, Procedure SYNC_FCR ToGPRPTS_GL00100, Line 1There is already an object named 'SYNC_FCR To GPRPTS_GL00100' in thedatabase.It seems the previous replication has set up these system viewsSYNC_FCR To GPRPTS_GL00100. And I have tried dropping the replicationmodule again to see if it drops the views but it didn't.The replication fails with some wired error & complains about thisviews when I try to run the synch..I even tried running the sp_removedbreplication to drop thereplication module, but the views do not seem to disappear.My question is how do I remove these system views or how do I make thereplication work without using these views or create new views.. Whyis this creating those system views in the first place?I would appreciate if anyone can help me fix this issue. Please feelfree to let me know if any additional information or scripts needed.Thanks in advance..Regards,Aravin Rajendra.

View 2 Replies View Related

DBCC OPENTRAN Shows REPLICATION On A Server That Is Not Configured For Replication

Aug 22, 2007

Hello,

I have this problem on a Production database.

DBCC OPENTRAN shows "REPLICATION" on a server that is not configured for replication. The transaction log is almost as large as the database (40GB) with a Simple recovery model. I would like to find out how the log can be truncated in such a situation.

Thank you.

View 4 Replies View Related

Identity Range Managed By Replication Is Full And Must Be Updated By A Replication Agent. Error Message Makes NO SENSE.

Mar 6, 2007

Hello,I'm getting the following error message when I try add a row using aStored Procedure."The identity range managed by replication is full and must be updatedby a replication agent".I read up on the subject and have tried the following solutionsaccording to MSDN without any luck.(http://support.Microsoft.com/kb/304706 )sp_adjustpublisheridentityrange (http://msdn2.microsoft.com/en-us/library/aa239401(SQL.80).aspx ) has no effectFor Testing:I've reloaded everything from scratch, created the pulications from byrunning the sql scripts generated,created replication snapshots andstarted the agents.I've checked the current Identity values in the Agent Table:DBCC CHECKIDENT ('Agent', NORESEED)Checking identity information: current identity value '18606', currentcolumn value '18606'.I check the Table to make sure there will be no conflicts with theprimary key:SELECT AgentID FROM Agent ORDER BY AgentID DESC18603 is the largest AgentID in the table.Using the Table Article Properties in the Publications PropertiesDialog, I can see values of:Range Size at Publisher: 100,000Range Size at Subscribers: 100New range @ percentage: 80In my mind this means that the Publisher will assign a new range whenthe Current Indentity value goes over 80,000?The Identity range for this table cannot be exhausted! I'm not surewhat to try next.Please! any insight will be of great help!Regards,Bm

View 1 Replies View Related

Replication :: Difference Between Snapshot And Transaction And Merge Replication?

May 26, 2015

What is the main difference between snapshot and transactional and merge replication?

View 5 Replies View Related

SQL Express Replication And Problems Accessing Data After Replication

Jul 28, 2006

Hi,

I have a VB.net app that access a SQL Express database. I have transactional repliaction set up on a SQL 2000 database (the publisher) and a pull subscription from the VB.net app. I use RMO in the VB app to connect to the publisher. My problem is I am getting some strange behaviour as follows

- if I run the app and invoke the pull subscription it works fine. If I then close my app and go back in, I can access my data without any problem

- If I run the app and try to access data in my SQL Express database it works fine. I can then close the app, reopen it and run the pull subscription it works fine

however.......

- if I run the app, invoke the pull subscription (which runs fine), and then try to access data in my local SQL Express database without firstly closing and reopening the app, I get a login error

- if I run the app, try to access data in my local SQL Express database (which works fine), and then try to run the pull subscription I get a "the process cannot acces the file as it is being used by another process" error. In this case I need to restart the SQL Express service to be able to run replication again.

I get exactly the same behaviour when I use the Windows Sync tool (with my app open at the same time) instead of my RMO code to replicate the data.

I am using standard ADO.Net 2 code to access my SQL Express data in the app and closing all connections etc

Any advice appreciated !

Thanks
Ronan





View 2 Replies View Related

Does Replication Affect Tempdb GROWTH Replication

Jun 28, 2007

Hi all,

I have recently setup a transactional replication in MS SQL 2000. After setting up the replication the clients TempDB grew by almost 60GB. Now the client is Blaming me for the TempDB GROWTH and saying that its because of the replication being setup i tried to convince them but they are not satisfied yet. Can anybody please tell me does replication cause the tempdb to grow. If yes then how. can u suggest any good link for getting to know the internal working of SQL Server replication????



Thanks in advance

Jacx

View 3 Replies View Related

How Do We Add A New Column To A Merge Replication Article, But Specify It As Not For Replication?

Aug 30, 2007

Hi all,

I know that adding a column using ALTER TABLE to add a column automatically allows SQLSERVER 2005 to replicate the schema changes to the subscribers, however, I would like to add a new column to an existing article that is being used for merge replication, however, I don't want this column to be replicated. Re-initialising the subscriptions is not a option. Help would be appreciated.

I am using SQLSERVER 2005 (SP1).

View 3 Replies View Related

Replication :: Transactional Replication Removal Sequence

Sep 2, 2015

I have been researching on the proper steps or sequence to follow to completely remove SQL Server 2012 Transactional Replication.  I have read articles about using SSMS as well as using replication stored procedures and some procedures use SQLCMD or just regular TSQL executed in SSMS.  I have also read articles where people said all you really need is connect to the Publisher instance, find the publication you want to remove and choose "Delete" and everything will be taken care of behind the scene. I have three SQL servers that participate in transactional replication.  SQL-P (publisher), 

SQL-D (distributor) and SQL-S (subscriber).  Do I need to connect to the distributor instance and the subscriber instance when removing transactional replication or is it just really connecting to the publisher and click delete on the publication? I want everything gone including any metadata, systems tables, distributions db and any other replication objects created during the initial configuration.

View 6 Replies View Related

Merge Replication Set Off Transactional Replication

Oct 9, 2007

I am working on bringing our disaster recovery site to be a live site. Currently we replicate to one of out servers (server B) with merge replication (from server A). Server A also does one way transactional replication form some table to several other servers including servers at the DR site.

This setup is not going to be fast enough for what we need so I am wondering if a table is receiving merge replication will the merge updates also replicate down the transaction path??

Example...
Server B update a row and merges to Server A. With this update them replicate (via transactional) to Server C??

thanks...

View 5 Replies View Related

Table Changes And Replication

May 4, 2004

I have an ASP.Net Application that connects to a SQL DB. I also have a backup of the application and the db on a second server.

I have a snapshot replication setup between the two servers. Every night the snapshot is taken at 3:00am and distribution happens at 4:00am

Everything works perfectly.

However, whenever I want to make a change to a table it won't let me make the change because the table is part of a replication. So I do the following; I delete the replication, make the table change, and then rebuild the replication.

I have to believe there is an easier way to do this.

Is there a way to make table changes without deleting and rebuiling my replication?

Thanks a lot,

Chris

View 1 Replies View Related

New Table For Replication

Sep 20, 2007

I use Transactional publication with updatable subscriptions for replication. Just what to know whenever I want to add new table to replication, do I need to regenerate the new snapshot again. However, once I do it, i found that the subscriber will recreate all table and bulk copy data all over again.. Is there any option or way that I can avoid it. THX

View 2 Replies View Related

Replication - Cannot Drop Table

Mar 15, 2001

I need some help with Merge Replication. After successfully defining a publisher, distributor and subscriber to perform merge replication, we decided to test Merge Replication to see what we can and can't do.

What we found is that you can't add new fields or change the nullable/null attributes of tables whilst the replication settings are still defined to the databases. ie you get the following error

'tblProducts' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot drop the table 'dbo.tblProducts' because it is published for replication.

So we thought, fair enough. We decided to uninstall replication using the wizards provided to see whether we can make schema changes. What we found is that we can make schema changes to the publisher database(on Server1), BUT not to the subscriber (Server2).

Does anyone know why? We are running SQL7 SP2.
Email me on ftowicz@icontact.com.au

View 4 Replies View Related

Replication - Dropping A Table

Nov 22, 2002

I'm new to replication and would like to know how to drop an article published for replication. I believe I need to follow these steps, but I am unsure.

Step (1)
exec sp_dropsubscription @publication = N'db name',
@article = N'article name',
@subscriber = 'subscriber name',
@destination_db = N'db name'

Step (2)
exec sp_droparticle @publication = N'db name',
@article = N'article name'

Step (3)
drop the article on the publisher

Step (4)
drop the article on the subscriber

Is this the correct sequence or am I missing something.

Thanks, Dave

View 2 Replies View Related

Replication: Table Order

May 22, 2002

SQL Trasnsactional Replication.

I've set up a transactional replication, but I need to specify in which order the tables are to be replicated (tables with foreign keys last).
How/where do set table order ?

/Carl

View 1 Replies View Related

SQL 2k Replication - View To Table

Sep 20, 2005

We would like to copy sensitive prod data into a devleopment environment and use a view to alter some of the sensitive rows. (incl. ssn's)

We have views that will "scrub" the data and substitute ssn's with an alternate key for R.I.

Some would like us to use replication to copy from our scrubbed views to our dev tables. Anyone have suggestions on how to accomplish this?

Only ops has access to distributors on-site, including my laptop :( so I can't do much experimenting and have to back-seat drive.

View 1 Replies View Related

Replication Table Permissions

Apr 19, 2004

Is there a way to replicate the table permissions from publisher to
subscriber? I noticed that when replication takes place, the permissions
that were set up on tables on the subscriber are wiped out. I need the permissions to be send to the subscriber automatically.

View 8 Replies View Related

Replication With Truncate Table

Mar 13, 2007

HI,

I am trying to find a replication solution. It does not have to be real-time, but snapshot will not work since the database is too big. I was trying to configure Transactional replication. The replication itself worked good, but the Truncate table is not allowed in the transactional replication and merge replication. We have to use "Truncate table" in another processes during replication. Is there any other option or third party application I can use to do the replication with truncate table working. I tried Replication Exec, but it does not support 64bit system, which we have.

View 11 Replies View Related

[ms Sql] How To Add New Table To Merge Replication ?

Jul 13, 2007

Hi,How to add new table to merge replication ?When I do this in Enterpriise Manager i got an error:Server: Msg 2758, Level 16, State 1, Procedure sp_addmergearticle,Line 466RAISERROR could not locate entry for error 20085 in sysmessages.What is wrong ?Thank for any helpLuk

View 1 Replies View Related

Table Replication Question

Feb 20, 2008

Hi, I'm using MS SQL server 2005.I have two identical databases - with one exception: they have differentnames (etc database1 and databse2), but their structure is completely same.Is it possible to replicate one table between those databases?Regards

View 2 Replies View Related

Replication Hangs On One Table

Feb 24, 2007

publisher - sql2000 sp4 distributor - sql 2005 sp1 subscribers - mix of sql2005 sp1 and sql 2000 sp4 we have a database with around 300 tables and replicate it to around 10 different subscribers. some in the same datacenter and others in different offices. We have around 50-60 different publications for this. Some have 20 or so tables others have only one table if they are large tables. Tables range in size from a few hundred rows to over 20 million. Some tables replicate a few commands, others 100000 or more commands on a daily basis. Around 6 weeks ago we started having problems with one table. It's 1.4 million rows and replicates around a few thousand commands on a daily basis. We saw a backlog of around 150000 to 400000 commands. We had some replication issues at this time with this distributor and we traced these problems to memory errors and the replication job would not start or stop. After restarting the job it pushed all the commands through to the subscribers. A few weeks ago we started noticing another backlog again and this time it wouldn't clear. A few times we just ran another snapshot at night but then we started to investigate. We noticed that some people were doing mass updates of 30000 or more rows and this time they weren't going through. It would just build up and cause blocking on the subscribers along with spiking the CPU to 50% or more on a constant basis. As soon as we turn off the replication for this publication everything goes back to normal. Meanwhile all the other publications are happily replicating tens of thousands of rows with no problems. One thing I noticed is that these updates cause a command to transaction ratio of thousands to one where everything else is less than 10 to 1. I thought this was the cause but then the senior DBA updated around 20000 rows in another publication in one update and it went through within a few minutes. Microsoft is absolutely no help. They are looking through logs and they tried to tell us to upgrade our hardware but we have some ancient subscribers for other busy publications with no issues. Right now we are thinking that it might be corruption on the publisher table and we'll be creating a new one this weekend. Any other ideas?

View 16 Replies View Related

How To Remove A Table From Replication

Mar 17, 2015

Version: SQL 2008 R2

Problem: I have a user who wants to remove table, but when she tries to remove it ( drop the table), she gets an error:
===========================================================
MSG 3724, Level 16, State 2, Line 6: Cannot drop the table, 'dbo.<table name>' because it is being used for replication.
MSG 2714, Level 16, State 6, Line 2
There is already an object named '<table name>' in the database.
============================================================

To investigate, I saw the following:

In the SSMS---> Replcation---> Local Publication--> [XYZ].Pub_XYZ
[SERVER Name].[XYZ_Replication]
                                                
Local Subscriptions:
[Reference DB].[ServerInstance].[Instance Name]:ABC.ABC_TO_XYZ.Reference DB).

How do I remove that table? Do I need to edit Replication? How? Which one?

View 15 Replies View Related

Removing Replication Table

Oct 12, 2005

Hi all,

View 10 Replies View Related

Replication With Truncate Table

Mar 13, 2007

I am trying to find a replication solution. It does not have to be real-time, but snapshot will not work since the database is too big. I was trying to configure Transactional replication. The replication itself worked good, but the Truncate table is not allowed in the transactional replication and merge replication. We have to use "Truncate table" in another processes during replication. Is there any other option or third party application I can use to do the replication with truncate table working. I tried Replication Exec, but it does not support 64bit system, which we have.



Thanks

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved