Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
使用此过程删除未使用或不需要的同步状态。
ml_delete_sync_state ( 'user', 'remote_id' )
user
VARCHAR(128)。MobiLink 用户名。
remote_id
VARCHAR(128)。远程 ID。
这些参数可以为空。如果所有参数都为空,则该过程不执行任何操作。
此存储过程删除给定 MobiLink 用户名和远程 ID 的 ml_subscription 表中的所有行。如果 ml_subscription 表中的任何行都不再引用远程 ID,则此存储过程还会从 ml_database 表中删除此远程 ID。
如果远程 ID 为空,而 MobiLink 用户名不为空,则此存储过程会从 ml_subscription 表中删除给定 MobiLink 用户名引用的所有行;如果 ml_subscription 表中的任何行都不再引用这些远程 ID,则此存储过程会从 ml_database 表中删除这些远程 ID。
如果 MobiLink 用户名为空但远程 ID 不为空,则此存储过程不会删除 MobiLink 用户,即使已删除 ml_database 表中所有远程 ID 且 ml_subscription 表中无任何行引用此用户。如果需要删除此 MobiLink 用户,可以通过发出如下命令来将其删除
delete from ml_user where name = 'user_name'
其中 user_name 是您要删除的 MobiLink 用户。
使用此存储过程时要极其谨慎,因为 MobiLink 服务器会在 ml_database 和 ml_subscription 表中自动添加此远程 ID,而下次 MobiLink 客户端为此远程 ID 请求同步时 MobiLink 服务器并不会检查它的同步状态。如果远程 ID 的上次同步尝试不成功,则删除它的同步状态可能会导致数据不一致。
此存储过程将删除 ml_subscription 表以及 ml_database 表中针对给定远程 ID 的所有行。
以下示例为 MobiLink 用户 John 清理远程 ID 为 remote_db_for_John 的远程数据库的相关 MobiLink 系统表信息:
CALL ml_delete_sync_state( 'John', 'remote_db_for_John' )