sp_helptracertokens (Transact-SQL)
Her biri için bir satır döndürür izleme belirteci , ekledi gecikmesini belirlemek için yayına.Bu saklı yordam, yayın veritabanı üzerinde yayımcı adresindeki veya dağıtım veritabanı üzerinde dağıtımcı adresindeki yürütülür.
Sözdizimi
sp_helptracertokens [ @publication = ] 'publication'
[ , [ @publisher = ] 'publisher' ]
[ , [ @publisher_db = ] 'publisher_db' ]
Bağımsız değişkenler
[ @publication= ] 'publication'
Is the name of the publication in which tracer tokens were inserted.publication is sysname, with no default.[ @publisher= ] 'publisher'
The name of the Publisher.publisher is sysname, with a default of NULL.Not
This parameter should only be specified for non-Microsoft SQL Server Publishers.
[ @publisher_db= ] 'publisher_db'
The name of the publication database.publisher_db is sysname, with a default value of NULL.Saklı yordam Yayımcı tarafında yürütülecek olan bu parametre yoksayılır.
Sonuç kümesi
Sütun adı |
Veri türü |
Açıklama |
---|---|---|
tracer_id |
int |
Tanımlayan bir izleme belirteci kaydı. |
publisher_commit |
datetime |
Belirteç kaydı adresindeki Yayımcı uygulamasında Taahhüt edilen saat ve tarih yayın veritabanı. |
Dönüş Kodu Değerleri
0 (başarılı) veya 1 (başarısız)
Açıklamalar
sp_helptracertokens 'deki işlem çoğaltma kullanılır.
sp_helptracertokens elde etmek için kullanılan izleme belirteci kimlikleri yürütürken sp_helptracertokenhistory (Transact-SQL).
Örnek
DECLARE @publication AS sysname;
DECLARE @tokenID AS int;
SET @publication = N'AdvWorksProductTran';
USE [AdventureWorks2008R2]
-- Insert a new tracer token in the publication database.
EXEC sys.sp_posttracertoken
@publication = @publication,
@tracer_token_id = @tokenID OUTPUT;
SELECT 'The ID of the new tracer token is ''' +
CONVERT(varchar,@tokenID) + '''.'
GO
-- Wait 10 seconds for the token to make it to the Subscriber.
WAITFOR DELAY '00:00:10';
GO
-- Get latency information for the last inserted token.
DECLARE @publication AS sysname;
DECLARE @tokenID AS int;
SET @publication = N'AdvWorksProductTran';
CREATE TABLE #tokens (tracer_id int, publisher_commit datetime)
-- Return tracer token information to a temp table.
INSERT #tokens (tracer_id, publisher_commit)
EXEC sys.sp_helptracertokens @publication = @publication;
SET @tokenID = (SELECT TOP 1 tracer_id FROM #tokens
ORDER BY publisher_commit DESC)
DROP TABLE #tokens
-- Get history for the tracer token.
EXEC sys.sp_helptracertokenhistory
@publication = @publication,
@tracer_id = @tokenID;
GO
İzinler
Yalnızca üyeleri sysadmin sabit sunucu rolü db_owner sabit veritabanı rolü yayın veritabanı, veya db_owner sabit veritabanı veya replmonitor rolleri dağıtım veritabanında yürütebilirsiniz sp_helptracertokenhistory.