변경 테이블 CDC 메서드를 사용하면 로그를 더 짧은 시간 동안 보존하여 저장공간을 절약할 수 있지만 트랜잭션 로그 메서드에 비해 처리량이 낮습니다. 이 방법은 트랜잭션 로그보다 제한사항이 적습니다. 예를 들어, 로그 잘림으로 인해 스트림이 영구적으로 실패할 위험성이 없으며, 암호화된 테이블의 복제를 지원합니다. 자세한 내용은 알려진 제한사항을 참고하세요.
이 CDC 메서드를 사용할 때는 전용 변경 테이블을 사용하여 소스에 대한 변경사항을 추적합니다. 트랜잭션 로그는 여전히 사용되지만 제한된 범위 내에서만 사용되며 장기간 보관할 필요가 없습니다. DML 이벤트가 소스 테이블에 적용되면 변경사항이 해당 변경 테이블에 복제됩니다.
변경 테이블은 소스 테이블과 구조는 동일하지만 변경사항의 메타데이터를 포함하는 추가 열이 있습니다. 커밋된 트랜잭션만 커밋 작업의 로그 시퀀스 넘버(LSN)와 함께 변경 테이블에 추가됩니다.
Datastream에서 소스 스키마의 DDL 변경사항을 처리하는 방법
변경 테이블 CDC 메서드를 사용하면 각 변경 테이블에 대해 캡처 인스턴스가 생성됩니다. 각 캡처 인스턴스는 캡처하고 추적하는 열 목록과 연결됩니다. 기본적으로 캡처 인스턴스를 만든 후 소스에서 데이터 정의 언어 (DDL) 변경이 발생하면 인스턴스에서 변경사항을 무시합니다. 하지만 스트림과 캡처 인스턴스가 생성된 후 소스 스키마에 추가된 열을 복제하도록 SQL Server 스트림을 구성할 수 있습니다.
시작하기 전에
Datastream 사용자에게 db_owner 권한이 할당되어 있는지 확인합니다.
소스 스키마에 추가된 열 복제
스트림이 생성된 후 소스 스키마에 추가된 열을 Datastream에서 복제하도록 지원하려면 스트림에 enable_ddl_support_for_ct 라벨을 추가해야 합니다.
DataStream은 5분마다 cdc.ddl_history 테이블에서 새 DDL을 확인합니다. 스트림 구성에 포함된 테이블에 새 열이 추가되면 Datastream은 테이블에 두 개의 캡처 인스턴스가 있는지 확인합니다.
그렇지 않으면 Datastream이 새 캡처 인스턴스를 만들고 DDL이 발생한 순간까지 원래 캡처 인스턴스 데이터를 읽은 다음 새 캡처 인스턴스에서 읽기를 시작합니다.
이 경우 최대 캡처 인스턴스 수에 도달했기 때문에 DDL 변경사항을 처리할 수 없다는 로그 항목이 추가됩니다.
트랜잭션 로그
이 CDC 메서드를 사용할 때는 Datastream이 트랜잭션 로그에서 직접 소스의 변경사항을 읽습니다. 이 메서드는 더 적은 리소스를 필요로 하며
데이터를 더 빠르게 검색할 수 있지만 더 많은 제한 사항이 있습니다.
데이터 손실을 방지하기 위해서는 Datastream이 로그를 읽기 전에 로그가 잘리지 않는 것이 중요합니다. 반면에 로그 파일을 너무 오래 보관하면 스토리지 공간을 차지하여 결국 데이터베이스 인스턴스가 읽기 전용 모드로 전환될 수 있습니다.
CDC 리더가 로그를 읽을 수 있는 충분한 시간을 확보하는 동시에 로그 자르기를 허용하여 스토리지 공간을 확보하기 위해서는 폴링 간격 변경과 자르기 보호 장치 설정과 같은 추가 구성 단계를 적용해야 합니다.
이러한 단계는 Datastream에 다운타임이 발생하거나 소스 데이터베이스와 Datastream 사이에 연결 문제가 있더라도 Datastream이 데이터를 읽을 수 있도록 보장하여 추가적인 보호 레이어를 제공합니다.
SQL Server 데이터베이스를 소스로 사용할 경우의 알려진 제한사항은 다음과 같습니다.
스트림이 테이블 10,000개로 제한됩니다.
행 개수가 5억 개를 초과하는 테이블은 다음 조건이 충족되지 않는 한 백필할 수 없습니다.
테이블에 고유 색인이 포함됩니다.
색인 열 중에 null이 허용되는 열이 없습니다.
색인의 모든 열이 스트림에 포함됩니다.
지연된 내구성 또는 가속화된 데이터베이스 복구(ADR)가 사용 설정된 데이터베이스는 지원되지 않습니다.
시스템 테이블에 변경사항 스트리밍은 지원되지 않습니다.
Windows Active Directory(AD) 인증은 지원되지 않습니다.
다음 데이터 유형은 지원되지 않으며 대상에 복제되지 않습니다.
SQL_VARIANT
HIERARCHYID
GEOMETRY
GEOGRAPHY
Datastream은 사용자 정의 데이터 유형을 복제하지만 대상에 저장되는 데이터 유형은 사용자 정의 유형을 파생하는 기본 데이터 유형입니다. 예를 들어 USERNAME 데이터 유형을 기반으로 VARCHAR(50) 데이터 유형을 정의하는 경우 데이터는 대상에 VARCHAR(50)으로 저장됩니다.
Datastream은 고유한 검색이 없는 테이블의 대용량 객체 열(TEXT, NTEXT, XML, IMAGE) 및 최대 가변 길이 열(VARCHAR(MAX), VARBINARY(MAX), NVARCHAR(MAX))에 대해서는 CDC를 지원하지 않습니다.
큰 객체 열이 스트림에 포함되지 않으면 CDC가 지원됩니다.
Datastream은 변경 테이블 CDC 메서드를 사용할 때 다음 소스 스키마 변경사항을 복제할 수 없습니다.
열 삭제: 이러한 열의 데이터는 NULL 값으로 대체됩니다.
데이터 유형 수정: Datastream은 데이터를 대상에 삽입하려고 시도하고 데이터가 거부되면 오류가 발생합니다.
열 이름 바꾸기: CDC가 사용 설정된 경우에는 SQL Server에 지원되지 않습니다.
이러한 스키마 변경으로 인해 데이터가 손상되거나 이벤트를 처리하지 못할 수 있습니다.
Datastream은 데이터 마스킹을 지원하지 않습니다. 데이터가 마스킹 없이 복제됩니다.
Datastream은 데이터 계층 애플리케이션 패키지(DACPAC) 패키지를 사용하여 데이터베이스에 적용된 변경사항 복제를 지원하지 않습니다.
Datastream은 WRITETEXT 또는 UPDATETEXT 문을 사용할 때 만들어진 변경사항을 복제하지 않습니다.
열이 PERSISTED로 표시되지 않는 한 Datastream은 계산된 열의 복제를 지원하지 않습니다.
Datastream은 PAGE, COLUMNSTORE 또는 COLUMNSTORE ARCHIVE 압축 유형을 지원하지 않습니다.
트랜잭션 로그 방법 사용 시 추가 제한사항
트랜잭션 로그 CDC 메서드를 사용하는 경우 다음 추가 제한사항이 적용됩니다.
투명 데이터 암호화(TDE)는 지원되지 않습니다.
열 수준 암호화는 지원되지 않습니다. 이러한 열의 데이터는 NULL 값으로 대체됩니다.
트랜잭션 로그 CDC 메서드를 사용하는 경우 Datastream은 스트림이 생성된 후 소스 스키마에 추가된 열의 복제를 지원하지 않습니다.
새 열이 대상에 복제되지 않습니다.
Datastream은 ROLLBACK TO SAVEPOINT 문을 지원하지 않습니다.
이러한 롤백 이벤트는 무시되며 대상에 복제되지 않습니다.
DataStream은 다음 유형의 테이블에서 8KB를 초과하는 행에 대해 CDC를 지원하지 않습니다.
고유한 색인이 없는 테이블
가변 길이 열이 하나 이상(VARCHAR, VARBINARY, NVARCHAR) 있는 클러스터링되지 않은 고유한 색인만 포함된 테이블
Datastream은 다음 유형의 테이블에서 대형 객체 열(TEXT, NTEXT, XML, IMAGE)에 대해 CDC를 지원하지 않습니다.
고유한 색인이 없는 테이블
가변 길이 열이 하나 이상(VARCHAR, VARBINARY, NVARCHAR) 있는 클러스터링되지 않은 고유한 색인만 포함된 테이블
큰 객체 열이 스트림에 포함되지 않은 경우 해당 테이블에 유효한 검색이 있는 경우에만 CDC가 지원됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eDatastream captures data changes from SQL Server databases using either change tables or transaction logs, with change tables offering lower storage needs but slower throughput, and transaction logs providing faster retrieval but with more limitations.\u003c/p\u003e\n"],["\u003cp\u003eSupported SQL Server versions include Enterprise (2008 and later), Standard (2016 SP1 and later), and Developer (2008 and later) for self-managed instances, as well as Amazon RDS, Azure SQL Database (S3 tier and above), and Cloud SQL for SQL Server.\u003c/p\u003e\n"],["\u003cp\u003eThere are limitations when using SQL Server as a source, such as a maximum of 10,000 tables per stream, the inability to backfill tables with more than 500 million rows without specific indexing conditions, and certain data types and features that are not supported.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the transaction logs CDC method, additional limitations apply, including the lack of support for Transparent Data Encryption (TDE), Column Level Encryption, and the \u003ccode\u003eROLLBACK TO SAVEPOINT\u003c/code\u003e statement.\u003c/p\u003e\n"],["\u003cp\u003eSchema changes when using the change tables CDC method such as adding, dropping, renaming, or modifying data types in columns are not supported and can cause data corruption or processing failure.\u003c/p\u003e\n"]]],[],null,["# Source SQL Server database\n\nThis page contains information about:\n\n- The behavior of how Datastream handles data that's being pulled from a source SQL Server database.\n- The versions of SQL Server databases that Datastream supports.\n- Known limitations for using SQL Server database as a source.\n\nBehavior\n--------\n\nDatastream tracks data manipulation language (DML) changes using one\nof the following CDC methods:\n\n- [Change tables](#change-tables)\n- [Transaction logs](#transaction-logs)\n\n### Change tables\n\nThe change tables CDC method lets users retain logs for a shorter time, and thus\nsave storage space, but supports lower throughput compared to the transaction\nlogs method. The method has fewer limitations than transaction logs. For example,\nit eliminates the risk of log truncation leading to streams failing permanently,\nand supports replication of encrypted tables. For more information, see\n[Known limitations](#sqlserverknownlimitations).\n\nWhen using this CDC method, changes to the source are tracked using dedicated\nchange tables. Transaction logs are still used, but to a limited extent, and you\ndon't need to retain them for longer periods. As DML events are applied to the\nsource tables, the changes are replicated to the corresponding change tables.\nThe change tables have the same structure as the source tables, but with extra\ncolumns to include the metadata for the changes. Only committed transactions are\nadded to the change tables, along with the log sequence number (LSN) of the\ncommit operation.\n| **Note:** Datastream only replicates changes from the default capture instance whose name is [`\u003cschema_name\u003e_\u003ctable_name\u003e`](https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/cdc-capture-instance-ct-transact-sql?view=sql-server-ver16).\n\n### Transaction logs\n\nWhen using this CDC method, Datastream reads changes in the source\ndirectly from transaction logs. This method requires fewer resources and allows\nfor faster data retrieval, but has [more limitations](#tl-limitations).\n\nTo prevent data loss, it's important that the logs aren't truncated before\nDatastream reads them. On the other hand, if you keep the log files for\ntoo long, they take up storage space, which might eventually cause the database\ninstance to enter read-only mode.\n\nTo make sure that the CDC reader has enough time to read the logs while allowing\nlog truncation to free up storage space, you need to apply additional configuration\nsteps, such as changing polling intervals and setting up a truncation safeguard.\nThese steps provide an additional layer of protection to ensure that Datastream\ncan read the data even if there's downtime on the Datastream side or a\nconnectivity issue between the source database and Datastream.\n\nFor detailed instructions on how to apply these additional measures, see the\n[Configure a source SQL Server database](/datastream/docs/configure-your-source-sql-server-database)\npage and select your database type.\n\nVersions\n--------\n\nDatastream supports the following versions and editions of SQL Server\ndatabases:\n\n- Self-managed (on-premise or cloud-hosted) using the following versions:\n - Enterprise: 2008 and later\n - Standard: 2016 SP1 and later\n - Developer: 2008 and later\n- Amazon RDS for SQL Server\n- Azure SQL Database (tier S3 and above).\n\n | **Note:** Only supported when using the change tables CDC method.\n- Cloud SQL for SQL Server\n\nDatastream doesn't support the following versions of SQL Server databases:\n\n- SQL Server Standard edition from version 2008 to 2014\n- SQL Server Express\n- SQL Server Web\n\nKnown limitations\n-----------------\n\nKnown limitations for using SQL Server database as a source include:\n\n- Streams are limited to 10,000 tables.\n- A table that has more than 500 million rows can't be backfilled unless the following conditions are met:\n 1. The table has a unique index.\n 2. None of the index columns are nullable.\n 3. All columns of the index are included in the stream.\n- Databases with delayed durability or accelerated database recovery (ADR) enabled aren't supported.\n- Streaming changes to system tables isn't supported.\n- Windows Active Directory (AD) authentication isn't supported.\n- The following data types aren't supported, and aren't replicated to the destination:\n - `SQL_VARIANT`\n - `HIERARCHYID`\n - `GEOMETRY`\n - `GEOGRAPHY`\n- Datastream replicates user-defined data types, however it's the base data type from which you derive your user-defined type that is stored in the destination. For example, if you define a `USERNAME` data type based on the `VARCHAR(50)` data type, the data is stored in the destination as `VARCHAR(50)`.\n- Datastream doesn't support CDC for large object columns (`TEXT`,\n `NTEXT`, `XML`, `IMAGE`) and maximum variable length columns\n (`VARCHAR(MAX)`, `VARBINARY(MAX)`, `NVARCHAR(MAX)`) in tables without a unique\n index.\n\n If large object columns aren't included in the stream, CDC is supported.\n- Datastream doesn't support replicating source schema changes when\n using the change tables CDC method. The following schema changes might cause data\n corruption or failure to process the events:\n\n - Adding columns: the new columns aren't replicated to the destination.\n - Dropping columns: data in these columns is replaced with `NULL` values.\n - Modifying data types: Datastream tries to insert the data to the destination and raises an error if the data is rejected.\n - Renaming columns: not supported for SQL Server when CDC is enabled.\n- Datastream doesn't support data masking. Data is replicated without\n masking.\n\n- Datastream doesn't support replicating changes applied to the database\n using the Data Tier Application Package (DACPAC) package.\n\n- Datastream doesn't replicate changes made using the `WRITETEXT` or\n `UPDATETEXT` statements.\n\n- Datastream doesn't support replicating [computed columns](https://learn.microsoft.com/en-us/sql/relational-databases/tables/specify-computed-columns-in-a-table) unless the column is marked `PERSISTED`.\n\n- Datastream doesn't support `PAGE`, `COLUMNSTORE` or `COLUMNSTORE ARCHIVE` compression types.\n\n### Additional limitations when using the transaction logs method\n\nIf you use the transaction logs CDC method, the following additional limitations\napply:\n\n- Transparent Data Encryption (TDE) isn't supported.\n- Column Level Encryption isn't supported. Data in these columns is replaced with `NULL` values.\n- Datastream doesn't support the `ROLLBACK TO SAVEPOINT` statement. Such rollback events are ignored and aren't replicated to the destination.\n- Datastream doesn't support CDC for rows greater than 8 KB in the following types of tables:\n - Tables without a unique index\n - Tables containing only a unique, non-clustered index with one or more variable length columns (`VARCHAR`, `VARBINARY`, `NVARCHAR`)\n- Datastream doesn't support CDC for large object columns (`TEXT`,\n `NTEXT`, `XML`, `IMAGE`) in the following types of tables:\n\n - Tables without a unique index\n - Tables containing only a unique, non-clustered index with one or more variable length columns (`VARCHAR`, `VARBINARY`, `NVARCHAR`)\n\n If large object columns aren't included in the stream, CDC is only supported\n for such tables if they have valid indexes.\n\nWhat's next\n-----------\n\n- Learn how to [configure a SQL Server source](/datastream/docs/configure-your-source-sql-server-database) for use with Datastream."]]