-- Name:
-- sp_IHreplflush
-- Description:
-- HREPL: Request log reader to flush cache
-- Security:
-- Internal
-- Requires Certificate signature for catalog access
-- Returns:
-- Success/failure
-- Notes:
-- This procedure is used when administering heterogeneous publications, to request a flush of the log reader cache.
-- The log reader uses this timestamp to determine whether its cache is up to date or needs to be refreshed. This
-- procedure is typically called within a transaction that updates publication or article data that is needed by
-- the log reader to correctly process publisher data, but when no corresponding update will be applied at the
-- publisher, such as adding or dropping publications, or changing a data type mapping. A different mechanism is
-- used to coordinate updates to article meta data represented at both the publisher and distributor.
-- Owner:
--
create procedure sys.sp_IHreplflush
(
@publisher sysname
)
AS
BEGIN
declare @retcode int
declare @publisher_id int
select @retcode = 0
select @publisher_id = NULL
-- Determine publisher id
select @publisher_id = srvid
from master.dbo.sysservers
where upper(srvname collate database_default) = upper(@publisher) collate database_default
if @@error<>0 or @retcode <> 0 or @publisher IS NULL
BEGIN
RAISERROR(21618, 16, -1, @publisher)
return(1)
END
-- insert time stamp in IHpublishers to indicate when a log reader flush was requested
update IHpublishers set flush_request_time = GetDate()
where publisher_id = @publisher_id
return(0)
END