배포자 및 게시자 정보 스크립트

이 스크립트는 시스템 테이블 및 복제 저장 프로시저를 사용하여 배포자 및 게시자의 개체에 대한 일반적인 질문에 대해 응답할 수 있습니다. 스크립트는 "현재 상태로" 사용할 수 있으며 사용자 지정 스크립트의 기준도 제공할 수 있습니다. 스크립트를 사용자 환경에서 실행하려면 다음 두 가지를 수정해야 합니다.

  • 사용자의 게시 데이터베이스 이름을 사용할 수 있도록 use AdventureWorks 줄을 변경합니다.
  • exec sp_helparticle @publication='<PublicationName>' 줄에서 주석(--)을 제거하고 <PublicationName>을 게시 이름으로 바꿉니다.
--********** Execute at the Distributor in the master database **********--

use master
go

--Is the current server a Distributor?
--Is the distribution database installed?
--Are there other Publishers using this Distributor?
exec sp_get_distributor

--Is the current server a Distributor?
select is_distributor from sys.servers where name='repl_distributor' and data_source=@@servername

--Which databases on the Distributor are distribution databases?
select name from sys.databases where is_distributor = 1

--What are the Distributor and distribution database properties?
exec sp_helpdistributor
exec sp_helpdistributiondb
exec sp_helpdistpublisher


--********** Execute at the Publisher in the master database **********--

--Which databases are published for replication and what type of replication?
exec sp_helpreplicationdboption

--Which databases are published using snapshot replication or transactional replication?
select name as tran_published_db from sys.databases where is_published = 1
--Which databases are published using merge replication?
select name as merge_published_db from sys.databases where is_merge_published = 1

--What are the properties for Subscribers that subscribe to publications at this Publisher?
exec sp_helpsubscriberinfo


--********** Execute at the Publisher in the publication database **********--

use AdventureWorks
go

--What are the snapshot and transactional publications in this database? 
exec sp_helppublication
--What are the articles in snapshot and transactional publications in this database?
--REMOVE COMMENTS FROM NEXT LINE AND REPLACE <PublicationName> with the name of a publication
--exec sp_helparticle @publication='<PublicationName>'

--What are the merge publications in this database? 
exec sp_helpmergepublication
--What are the articles in merge publications in this database?
exec sp_helpmergearticle -- to return information on articles for a single publication, specify @publication='<PublicationName>'

--Which objects in the database are published?
select name as published_object, schema_id, is_published as is_tran_published, is_merge_published, is_schema_published
from sys.tables where is_published = 1 or is_merge_published = 1 or is_schema_published = 1
union
select name as published_object, schema_id, 0, 0, is_schema_published
from sys.procedures where is_schema_published = 1
union
select name as published_object, schema_id, 0, 0, is_schema_published
from sys.views where is_schema_published = 1

--Which columns are published in snapshot or transactional publications in this database?
select object_name(object_id) as tran_published_table, name as published_column from sys.columns where is_replicated = 1

--Which columns are published in merge publications in this database?
select object_name(object_id) as merge_published_table, name as published_column from sys.columns where is_merge_published = 1

참고 항목

개념

복제 관리자를 위한 질문과 대답

관련 자료

sp_get_distributor(Transact-SQL)
sp_helparticle(Transact-SQL)
sp_helpdistributiondb(Transact-SQL)
sp_helpdistpublisher(Transact-SQL)
sp_helpdistributor(Transact-SQL)
sp_helpmergearticle(Transact-SQL)
sp_helpmergepublication(Transact-SQL)
sp_helppublication(Transact-SQL)
sp_helpreplicationdboption(Transact-SQL)
sp_helpsubscriberinfo(Transact-SQL)
sys.columns(Transact-SQL)
sys.databases(Transact-SQL)
sys.procedures(Transact-SQL)
sys.servers(Transact-SQL)
sys.tables(Transact-SQL)
sys.views(Transact-SQL)

도움말 및 정보

SQL Server 2005 지원 받기