sp_dropdistributor(Transact-SQL)

배포자를 제거합니다. 이 저장 프로시저는 배포 데이터베이스를 제외한 모든 데이터베이스의 배포자에서 실행됩니다.

항목 링크 아이콘 Transact-SQL 구문 표기 규칙

구문

sp_dropdistributor [ [ @no_checks= ] no_checks ] 
    [ , [ @ignore_distributor= ] ignore_distributor ]

인수

  • [ @no_checks=] no_checks
    배포자를 삭제하기 전에 종속 개체를 확인할 것인지 여부를 표시합니다. no_checksbit이며 기본값은 0입니다.

    0인 경우 sp_dropdistributor는 해당 배포자는 물론 모든 게시 및 배포 개체가 삭제되었는지 확인합니다.

    1인 경우 sp_dropdistributor는 배포자를 제거하기 전에 모든 게시 및 배포 개체를 삭제합니다.

  • [ @ignore_distributor=] ignore_distributor
    이 저장 프로시저가 배포자에 연결되지 않고 실행되는지 여부를 표시합니다. ignore_distributorbit이며 기본값은 0입니다.

    0인 경우 sp_dropdistributor는 배포자에 연결하여 모든 복제 개체를 제거합니다. sp_dropdistributor가 배포자에 연결할 수 없는 경우 저장 프로시저는 실패합니다.

    1인 경우에는 배포자에 연결되지 않으며 복제 개체가 제거되지 않습니다. 배포자가 제거되었거나 영구적으로 오프라인 상태인 경우에 사용합니다. 배포자에서 게시자에 대한 개체는 배포자가 나중에 다시 설치될 때까지 제거되지 않습니다.

반환 코드 값

0(성공) 또는 1(실패)

주의

sp_dropdistributor는 모든 유형의 복제에 사용됩니다.

서버에 다른 게시자 또는 배포 개체가 있는 경우 @no_checks1로 설정되어 있지 않으면 sp_dropdistributor가 실패합니다.

이 저장 프로시저는 sp_dropdistributiondb를 실행하여 배포 데이터베이스를 삭제한 후에 실행해야 합니다.

-- This script uses sqlcmd scripting variables. They are in the form
-- $(MyVariable). For information about how to use scripting variables  
-- on the command line and in SQL Server Management Studio, see the 
-- "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".

-- Disable publishing and distribution.
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB as sysname;
SET @distributionDB = N'distribution';
SET @publisher = $(DistPubServer);
SET @publicationDB = N'AdventureWorks2012';

-- Disable the publication database.
USE [AdventureWorks2012]
EXEC sp_removedbreplication @publicationDB;

-- Remove the registration of the local Publisher at the Distributor.
USE master
EXEC sp_dropdistpublisher @publisher;

-- Delete the distribution database.
EXEC sp_dropdistributiondb @distributionDB;

-- Remove the local server as a Distributor.
EXEC sp_dropdistributor;
GO

사용 권한

sysadmin 고정 서버 역할의 멤버만 sp_dropdistributor를 실행할 수 있습니다.

참고 항목

참조

sp_adddistributor(Transact-SQL)

sp_changedistributor_property(Transact-SQL)

sp_helpdistributor(Transact-SQL)

복제 저장 프로시저(Transact-SQL)

개념

게시 및 배포 해제