Use this stored procedure to programmatically decide when a rescan is required.
Name | Value | Description |
---|---|---|
publication_n (in) |
publication |
Deprecated. Use subscription_n instead. The publications being synchronized, where n is an integer. There is one publication_n entry for each publication being synchronized. The numbering of n starts at zero. |
MobiLink user (in) |
MobiLink user name |
The MobiLink user for which you are synchronizing. |
discarded storage (in) |
number |
The number of bytes of discarded memory after the last synchronization. |
rescan (in|out) |
true | false |
If set to True by the hook, dbmlsync performs a complete rescan before the next synchronization. On entry, this value is set to False. |
script version (in) |
script version name |
The MobiLink script version to be used for the synchronization. |
subscription_n (in) | subscription name(s) | The names of subscriptions being synchronized where n is an integer. This is one subscription_n entry for each subscription being synchronized. The numbering of n starts at zero. |
When more than one -n option or -s option is specified in the command line, dbmlsync may experience fragmentation which results in discarded memory. The discarded memory can be recovered by rescanning the database transaction log. This hook allows you to decide if dbmlsync should rescan the database transaction log to recover memory.
When no other condition has been met that would force a rescan, this hook is called immediately after the sp_hook_dbmlsync_process_exit_code hook.
Hook procedures can be created by any user with the MANAGE REPLICATION system privilege. However, to ensure that the hook can access the #hook_dict table, which is used to pass information in and out of hooks, hooks must meet one of the following requirements:
Be owned by a user with the SELECT ANY TABLE and UPDATE ANY TABLE system privileges.
Be defined using the SQL SECURITY INVOKER clause of the CREATE PROCEDURE statement.
The following example cause a log scan if the discarded storage is greater than 1000 bytes.
CREATE PROCEDURE sp_hook_dbmlsync_log_rescan () BEGIN IF EXISTS(SELECT * FROM #hook_dict WHERE name = 'Discarded storage' AND value>1000) THEN UPDATE #hook_dict SET value ='true' WHERE name='Rescan'; END IF; END; |
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |