|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:27 AM
Points: 266,
Visits: 512
|
|
What are the issues with using replication to move data between a live database and one used for reporting?
is this the best way to get real time data into a reporting database?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 6:28 AM
Points: 1,125,
Visits: 14,511
|
|
erics44 (9/5/2012) What are the issues with using replication to move data between a live database and one used for reporting?
is this the best way to get real time data into a reporting database?
There is no "best way". It depends on your situation.
For near real time you will need to use transactional replication and control access to prevent reporting data modification.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:27 AM
Points: 266,
Visits: 512
|
|
reporting data could change from time to time, why would you need to prevent this?
sorry i dont really understand exactly what replication is all about
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 6:28 AM
Points: 1,125,
Visits: 14,511
|
|
Replication uses magazine/newspaper terminology.
Publisher = Source Server Subscriber = Destination Server Article = Table/Stored procedure/view Publication = Group of articles
You would want to limit access to the subscriber as there is very little to prevent someone accessing the subscriber and changing/removing data. Its a rare occurrence but very possible that an application with R/W functionality is accidentally pointed at a reporting server. Its not to big an issue but can break reports and cause replication errors.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:27 AM
Points: 266,
Visits: 512
|
|
ahh i see
so you mean its good to prevent someone being able to go into the reporting server and changing data where as the data should be changed in the live server
another question, does replication have to be a direct copy of the live server?
so can you change it so when a transaction is updated in the live database the information is stored in the replicated database in a different way?
to try and clarify what i mean, you might have 2 tables in the live database (linked by a foreign key perhaps) that you want to store as a single table in the replicated database, so when the replication happens it brings through the foreign key from the other table too
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Thursday, May 23, 2013 9:24 AM
Points: 770,
Visits: 682
|
|
erics44 (9/5/2012) ahh i see
so you mean its good to prevent someone being able to go into the reporting server and changing data where as the data should be changed in the live server
another question, does replication have to be a direct copy of the live server?
so can you change it so when a transaction is updated in the live database the information is stored in the replicated database in a different way?
to try and clarify what i mean, you might have 2 tables in the live database (linked by a foreign key perhaps) that you want to store as a single table in the replicated database, so when the replication happens it brings through the foreign key from the other table too
SqlServer will prevent you from updating replicated data. As to your other question about storing 2 tables in 1, replication will not handle that. you would have to write a process to do that on your own.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 7:27 AM
Points: 266,
Visits: 512
|
|
ok perhaps replication isnt what i need
it seems like more of a dev / back up / disaster recovery method
I am looking into ways of moving data into a reporting database and trying to keep the data real time
if i need to write procedures that will organise the data after the replication then this kind of defeats the object for me
i think :)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 6:28 AM
Points: 1,125,
Visits: 14,511
|
|
Not in the way you describe.
You can publish tables using a foreign key constraint type link using Merge replication but not to a single table. i.e. you can publish the primary table with a filter, call it WHERE active=1, and because of the publication links the related records to those filtered would accompany the row(s) in the primary table.
You "could" create a customized process to merge the data on the subscriber. Maybe a logical database with only cross database views would work for you to merge the data.
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Thursday, May 23, 2013 9:24 AM
Points: 770,
Visits: 682
|
|
erics44 (9/5/2012) ok perhaps replication isnt what i need
it seems like more of a dev / back up / disaster recovery method
I am looking into ways of moving data into a reporting database and trying to keep the data real time
if i need to write procedures that will organise the data after the replication then this kind of defeats the object for me
i think :)
triggers aren't always the best idea, but might be something you want here (on insert/update/delete). you can use it to insert into another table that "flattens" the data you want out.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 6:28 AM
Points: 1,125,
Visits: 14,511
|
|
crashdan (9/5/2012)
SqlServer will prevent you from updating replicated data.
Sorry. That is incorrect. It will not.
|
|
|
|