Home > database >  Sybase copy main point when the truncate table to prepare some what? Should be how to operate? Thank
Sybase copy main point when the truncate table to prepare some what? Should be how to operate? Thank

Time:09-17

Sybase replication system, want to master a large number of data points in one table quickly deleted, so want to truncate the table, do not know to do this have any impact on replication system, to copy what is the effect? Copy some don't need to synchronize the data is to be deleted, how to simple operation, safe to finish the work? Large coffee, please help, thank you!

CodePudding user response:

Look at your copy to define how to write the copy - if it is a single table, then trunacate table this command is not a journal, cannot be copied to copy, copy point table for synchronization, then have to manually perform truncate
If your copy is defined as the db replication definition, but also the subscribe the truncate table, then the truncate table will be to duplicate the point execution, you what also don't tube,

CodePudding user response:

reference 1st floor EisenWang response:
see you replicate definition of how to write, if is single table replication, then trunacate table this command is not a journal, cannot be copied to copy, copy point table for synchronization, then have to manually perform truncate
If your copy is defined as the db replication definition, but also the subscribe the truncate table, then the truncate table would be to duplicate the point execution, you what also don't tube,


Hello! Thank you for your comment!
I am a single table to copy,
Because the main point of the list of data quantity is big, I'm not sure whether trunacate table will add a large number of replication queue,
In addition, in the main point trunacate table whether need to suspend the connection or sp_stop_rep_agent?
And whether you need to drop the subscription and drop the replication definition and then rebuild?
Thank you very much!

CodePudding user response:

For table rep def/sub, the main point table execution truncate table don't need to suspend the connection or sp_stop_rep_agent, because this cannot be spread to replicate at site,
Just so there will be a hidden danger, the future of this main point table an insert may trigger a duplicate key error, at that point in copying

CodePudding user response:

reference EisenWang reply: 3/f
for table rep def/sub, the main point table execution truncate table don't need to suspend the connection or sp_stop_rep_agent, because this cannot be spread to replicate at site,
Just so there will be a hidden danger, the future of this main point table an insert at that point in replication may cause duplicate key error,

Hello!

CodePudding user response:

The hidden danger I failed to take into account beforehand, it may lead to repeat, thank you very much!
That isn't there any way to avoid this threat?
Or in the main point I suspend connection, then the conditional part of the delete data, then resume after the completion of the connection the skip the transaction, I wonder if this can avoid duplicate key concerns? Also don't know whether can avoid a large number of replication queue? , of course, the main point of the table data from 120 g don't know how long can thin body, thank you!

CodePudding user response:

You also points to replicate a truncate table does not have to manually run

CodePudding user response:

EisenWang, hello!
Copy of this form has two points A and B, an A is going to truncate the table; Another B is retain historical data for the query, B can't delete the above data, so I'd like to have as A result of the replicated data in the main check out the data on the (A) can clear it, has not yet been replicated data need to copy to A and B, of course, even out of the question, A question is not big, but it is best not to B A problem, please help to think about whether it can improve the operation of clearing the table, trouble, thank you!

CodePudding user response:

Will be copied to A table to subscribe to the subscribe to truncate table, copy the B list subscription don't subscribe to truncate table,
So you are on the main table truncate table will not be on A truncated data,
  • Related