October 9, 2006 at 10:09 am
I have read the posts about "seamless replication"; but this process seems to be too manual. My client's application changes the schema on the fly, so the database could be in any state at any time, depending on what user has run what software. We are only replicating to one node, so at least the direction is always known; but how do I check for schema changes prior to each scheduled replication? It is early yet, Monday morning, a holiday at that... I've got a week to come up with a solution, and three weeks to make it work without intervention... and then one week to roll it out.
Any suggestions would be appreciated.
Thank-you,
David Russell
Any Cloud, Any Database, Oracle since 1982
October 10, 2006 at 11:54 am
Schema changes are not automatically replicated in SQL 2000 T-REP. So you would need to modify the code to include the appropriate commands before issuing the schema change.
******************
Dinakar Nethi
Life is short. Enjoy it.
******************
October 10, 2006 at 4:23 pm
yes, that is why I asked the question "but how do I check for schema changes prior to each scheduled replication? "
Thank-you,
David Russell
Any Cloud, Any Database, Oracle since 1982
October 11, 2006 at 8:55 am
You could run a "DIFF" between the databases, to identify difference between each table in your Publication Database and Subscription Database and output the results to a work table. Then perhaps run scripts that look at the work table of "diffs", and create scripts to modify your publications. Sounds a bit messy.
Are the Publication & Subscriber Databases on the same server ?
Here's some generic "DIFF" scripts I wrote that might be helpful. They show tables where colums attributes are different from 1 db to another, and also check for columns that are in one table, but not in the other .. ie ... dropped or added columns.
+++++++++++++++++++++++++++++++++++++++++++
table AdminDB.dbo.DB1_TableSchema (table_name [sql_variant], column_order [sql_variant], column_name [sql_variant], column_datatype [sql_variant],
table AdminDB.dbo.TRN_TableSchema -- truncate any existing data from previous runs.
TRN
@table_name nvarchar(128)
Nocount ON
tablenames_cursor CURSOR FOR
into AdminDB.dbo.TRN_TableSchema
tablenames_cursor
tablenames_cursor
* from AdminDB.dbo.TRN_TableSchema order by table_name -- Look at the results
'PRD ' as 'PRD ', 'TRN ' as 'TRN ',
AdminDB.dbo.PRD_TableSchema a
AdminDB.dbo.TRN_TableSchema b
'PRD no TRN', PRD.table_name, PRD.column_name
AdminDB.dbo.PRD_TableSchema PRD
AdminDB.dbo.TRN_TableSchema TRN on PRD.table_name = TRN.table_name
outer join DBAdmin.dbo.AdvDbTrn_TableSchema TRN2 on PRD.table_name = TRN2.table_name and TRN2.column_name = PRD.column_name
TRN2.column_name is NULL
by PRD.table_name, PRD.column_name
by PRD.table_name, PRD.column_name
'TRN no PRD', TRN.table_name, TRN.column_name
AdminDB.dbo.TRN_TableSchema TRN
AdminDB.dbo.PRD_TableSchema PRD on PRD.table_name = TRN.table_name
outer join DBAdmin.dbo.PRD_TableSchema PRD2 on PRD2.table_name = TRN.table_name and TRN.column_name = PRD2.column_name
PRD2.column_name is NULL
by TRN.table_name, TRN.column_name
by TRN.table_name, TRN.column_name
October 11, 2006 at 10:36 am
Thanks for the response, and for the scripts. I will be looking at them carefully with the next five days (probably weekends included )
No, the databases are not on the same server, in fact, it gets a bit more complicated. The source DB is on a mirrored pair of hosts (done with EMC RepliStor), file level mirror, active/passive configuration, and the target site is in Arizona connected with a T3 line.
To further complicate matters, the Reporting Services are installed in a funky way to keep from having to pay for an enterprise license. You can't connect two sets of processes to one set of RS databases without enterprise edition - so when I replicate the RS DBs, I will also have to figure out which ones to point to in Arizona - where there is just one pair.
Okay, TMI...
But, believe me, your help is appreciated very much.
David
Thank-you,
David Russell
Any Cloud, Any Database, Oracle since 1982
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply