이 페이지에서는 아직 기본 키가 없는 Oracle 테이블을 마이그레이션하는 방법을 설명합니다.
Database Migration Service를 사용하려면 대상 PostgreSQL 테이블에 기본 키가 있어야 합니다.
기본 Database Migration Service 변환 작업공간은 기본 키가 없는 테이블에 rowid 열을 만들어 이를 자동으로 처리합니다.
하지만 Ora2Pg 마이그레이션 도구와 함께 기존 변환 작업공간을 사용 중이고 Oracle 소스 테이블에 기본 키가 없는 경우 키를 수동으로 만들어야 합니다.
다음 섹션에서는 Oracle 소스 테이블의 기본 키를 만드는 방법에 관한 옵션을 제공합니다.
기존 열을 사용하여 기본 키 만들기
테이블에 이미 열 또는 열 조합을 기반으로 하는 논리적 기본 키가 있을 수 있습니다. 예를 들어 고유 제약 조건 또는 색인이 구성된 열이 있을 수 있습니다. 이 열을 사용하여 대상 PostgreSQL 인스턴스에서 새 기본 키를 생성합니다.
rowid 열을 사용하여 기본 키 만들기
Oracle 데이터베이스는 rowid 가상 열을 사용하여 테이블의 각 행 위치를 저장합니다. 기본 키가 없는 Oracle 테이블을 마이그레이션하려면 대상 PostgreSQL 데이터베이스에 새 rowid 열을 추가합니다. Database Migration Service는 소스 Oracle rowid의사 열의 해당 숫자 값으로 열을 채웁니다.
[[["이해하기 쉬움","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-04-17(UTC)"],[[["This guide addresses migrating Oracle tables without primary keys to PostgreSQL, a requirement for Database Migration Service."],["The default Database Migration Service workspace automatically creates `rowid` columns as primary keys, but the legacy workspace requires manual key creation."],["You can create a primary key by leveraging existing unique columns or indexes in the Oracle source table."],["Another option is creating a new `rowid` column in the PostgreSQL destination, which Database Migration Service populates using Oracle's `rowid` pseudocolumn values."],["If no other option works, you may create a primary key encompassing all columns of the table, ensuring it does not exceed PostgreSQL's maximum key length."]]],[]]