Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 参考 » 使用 SQL » SQL 语句 » SQL 语句 (P-Z)

 

START SYNCHRONIZATION DELETE 语句 [MobiLink]

此语句可用于为 MobiLink 同步重新启动有关删除操作的日志记录。

语法
START SYNCHRONIZATION DELETE
注释

通常,SQL Anywhere 和 UltraLite 自动记录对属于同步的表或列所作的任何更改,并在下一次同步期间将这些更改上载到统一数据库。使用 STOP SYNCHRONIZATION DELETE 语句可以暂时停止对删除操作的自动记录。START SYNCHRONIZATION DELETE 语句允许您重新启动自动记录。

执行 STOP SYNCHRONIZATION DELETE 语句之后,不会同步在此连接上执行的任何删除操作。效果一直持续到执行 START SYNCHRONIZATION DELETE 语句为止。重复执行 STOP SYNCHRONIZATION DELETE 不会有额外的效果。

单个 START SYNCHRONIZATION DELETE 语句可重新启动记录,无论在它前面执行了多少个 STOP SYNCHRONIZATION DELETE 语句。

如果您的应用程序不同步数据,则不要使用 START SYNCHRONIZATION DELETE。

权限

必须具有 DBA 权限。

副作用

无。

另请参见
标准和兼容性
  • SQL/2003   服务商扩充。

示例

下面的 SQL 语句序列阐释了如何使用 START SYNCHRONIZATION DELETE 和 STOP SYNCHRONIZATION DELETE:

-- Prevent deletes from being sent
-- to the consolidated database
STOP SYNCHRONIZATION DELETE;

-- Remove all records older than 1 month
-- from the remote database,
-- NOT the consolidated database
DELETE FROM PROPOSAL
WHERE last_modified < months( CURRENT TIMESTAMP, -1 )

-- Re-enable all deletes to be sent
-- to the consolidated database
-- DO NOT FORGET to start this
START SYNCHRONIZATION DELETE;

-- Commit the entire operation,
-- otherwise rollback everything
-- including the stopping of the deletes
commit;