使用 Blitzz 将数据从 Oracle 迁移到 Azure Cosmos DB Cassandra API 帐户Migrate data from Oracle to Azure Cosmos DB Cassandra API account using Blitzz

适用于: Cassandra API

Azure Cosmos DB 中的 Cassandra API 已成为在 Oracle 上运行的企业工作负荷的极佳选择,原因各种各样,例如:Cassandra API in Azure Cosmos DB has become a great choice for enterprise workloads that are running on Oracle for a variety of reasons such as:

  • 更高的可伸缩性和可用性: 它可以消除单一故障点,并提高应用程序的可伸缩性和可用性。Better scalability and availability: It eliminates single points of failure, better scalability, and availability for your applications.

  • 显著节省成本: 使用 Azure Cosmos DB 可以节省成本,其中包括 VM、带宽以及任何适用 Oracle 许可证的成本。Significant cost savings: You can save cost with Azure Cosmos DB, which includes the cost of VM's, bandwidth, and any applicable Oracle licenses. 另外,你无需管理数据中心、服务器、SSD 存储、网络以及电力成本。Additionally, you don't have to manage the data centers, servers, SSD storage, networking, and electricity costs.

  • 无管理和监视开销: 作为一个完全托管式的云服务,Azure Cosmos DB 消除了管理和监视大量设置所带来的开销。No overhead of managing and monitoring: As a fully managed cloud service, Azure Cosmos DB removes the overhead of managing and monitoring a myriad of settings.

可以通过多种方式将数据库工作负荷从一个平台迁移到另一个平台。There are various ways to migrate database workloads from one platform to another. Blitzz 工具可以安全可靠地将各种数据库中的数据迁移到 Azure Cosmos DB,且不会造成停机。Blitzz is a tool that offers a secure and reliable way to perform zero downtime migration from a variety of databases to Azure Cosmos DB. 本文介绍如何执行所需步骤,以便使用 Blitzz 将数据从 Oracle 数据库迁移到 Azure Cosmos DB Cassandra API。This article describes the steps required to migrate data from Oracle database to Azure Cosmos DB Cassandra API using Blitzz.

使用 Blitzz 进行迁移的优势Benefits using Blitzz for migration

Blitzz 的迁移解决方案按照分步方法迁移复杂的运营工作负荷。Blitzz's migration solution follows a step by step approach to migrate complex operational workloads. 下面是 Blitzz 的零停机迁移计划的一些重要方面:The following are some of the key aspects of Blitzz's zero-downtime migration plan:

  • 它可以自动将业务逻辑(表、索引、视图)从 Oracle 数据库迁移到 Azure Cosmos DB。It offers automatic migration of business logic (tables, indexes, views) from Oracle database to Azure Cosmos DB. 无需手动创建架构。You don't have to create schemas manually.

  • Blitzz 提供大规模并行数据库复制。Blitzz offers high-volume and parallel database replication. 它可以使用称作“变更数据捕获 (CDC)”的技术,让源平台和目标平台在迁移过程中保持同步状态。It enables both the source and target platforms to be in-sync during the migration by using a technique called Change-Data-Capture (CDC). Blitzz 可以通过 CDC 从源数据库 (Oracle) 持续提取更改流,并将其应用到目标数据库 (Azure Cosmos DB)。By using CDC, Blitzz continuously pulls a stream of changes from the source database(Oracle) and applies it to the destination database(Azure Cosmos DB).

  • 它具有容错功能,可以保证数据的准确传输,即使系统出现硬件或软件故障。It is fault-tolerant and guarantees exactly once delivery of data even during a hardware or software failure in the system.

  • 它可以在传输过程中使用各种安全方法(例如 TLS/SSL、加密)对数据进行保护。It secures the data during transit using a variety of security methodologies like TLS/SSL, encryption.

  • 它提供的服务可将以 PL/SQL 编写的复杂业务逻辑转换为 Azure Cosmos DB 中的等效业务逻辑。It offers services to convert complex business logic written in PL/SQL to equivalent business logic in Azure Cosmos DB.

迁移数据的步骤Steps to migrate data

本部分介绍如何执行所需步骤,以便设置 Blitzz 并将数据从 Oracle 数据库迁移到 Azure Cosmos DB。This section describes the steps required to setup Blitzz and migrates data from Oracle database to Azure Cosmos DB.

  1. 在打算安装 Blitzz 复制器的计算机中,添加安全证书。From the computer where you plan to install the Blitzz replicant, add a security certificate. 该证书是 Blitzz 复制器与指定的 Azure Cosmos DB 帐户建立 TLS 连接所需的。This certificate is required by the Blitzz replicant to establish a TLS connection with the specified Azure Cosmos DB account. 可以使用以下步骤来添加证书:You can add the certificate with the following steps:

    wget https://cacert.omniroot.com/bc2025.crt
    mv bc2025.crt bc2025.cer
    keytool -keystore $JAVA_HOME/lib/security/cacerts -importcert -alias bc2025ca -file bc2025.cer
  2. 可以在 Blitzz 网站上请求演示版,以获取 Blitzz 安装和二进制文件。ou can get the Blitzz installation and the binary files either by requesting a demo on the Blitzz website. 或者,可以向相关团队发送电子邮件Alternatively, you can also send an email to the team.

    Blitzz 复制器工具下载

    Blitzz 复制器文件

  3. 在 CLI 终端设置源数据库配置。From the CLI terminal, set up the source database configuration. 使用 vi conf/conn/oracle.yml 命令打开配置文件,添加一个包含 Oracle 节点 IP 地址的逗号分隔的列表,并添加端口号、用户名、密码以及任何其他必需的详细信息。Open the configuration file using vi conf/conn/oracle.yml command and add a comma-separated list of IP addresses of the oracle nodes, port number, username, password, and any other required details. 以下代码显示一个示例配置文件:The following code shows an example configuration file:

    type: ORACLE
    host: localhost
    port: 53546
    service-name: IO
    username: '<Username of your Oracle database>'
    password: '<Password of your Oracle database>'
    conn-cnt: 30
    use-ssl: false

    打开 Oracle 连接编辑器

    Oracle 连接配置

    填充配置详细信息后,保存并关闭该文件。After filling out the configuration details, save and close the file.

  4. (可选)设置源数据库筛选器文件。Optionally, you can set up the source database filter file. 筛选器文件指定要迁移的架构或表。The filter file specifies which schemas or tables to migrate. 使用 vi filter/oracle_filter.yml 命令打开配置文件,输入以下配置详细信息:Open the configuration file using vi filter/oracle_filter.yml command and enter the following configuration details:

    -   schema: "io_blitzz"
    Types: [TABLE]

    填充数据库筛选器详细信息以后,保存并关闭该文件。After filling out the database filter details, save and close the file.

  5. 接下来,设置目标数据库的配置。Next you will set up the configuration of the destination database. 在定义配置之前,请创建一个 Azure Cosmos DB Cassandra API 帐户Before you define the configuration, create an Azure Cosmos DB Cassandra API account. 从数据中选择适当的分区键,然后创建密钥空间,以及用于存储迁移的数据的表。Choose the right partition key from your data and then create a Keyspace, and a table to store the migrated data.

  6. 在迁移数据之前,请将容器吞吐量提高到快速迁移应用程序所需的量。Before migrating the data, increase the container throughput to the amount required for your application to migrate quickly. 例如,可将吞吐量提高到 100000 RU。For example, you can increase the throughput to 100000 RUs. 在开始迁移之前提高吞吐量可以缩短数据迁移时间。Scaling the throughput before starting the migration will help you to migrate your data in less time.

    缩放 Azure Cosmos 容器吞吐量

    必须在迁移完成后降低吞吐量。You must decrease the throughput after the migration is complete. 可以根据存储的数据量以及每次操作所需的 RU 数,估算数据迁移后所需的吞吐量。Based on the amount of data stored and RUs required for each operation, you can estimate the throughput required after data migration. 若要详细了解如何估算所需的 RU,请参阅预配容器和数据库的吞吐量使用 Azure Cosmos DB Capacity Planner 估算 RU/秒这两篇文章。To learn more on how to estimate the RUs required, see Provision throughput on containers and databases and Estimate RU/s using the Azure Cosmos DB capacity planner articles.

  7. 在“连接字符串”窗格中获取“联系点、端口、用户名”,以及 Azure Cosmos 帐户的“主密码”。 Get the Contact Point, Port, Username, and Primary Password of your Azure Cosmos account from the Connection String pane. 需要在配置文件中使用这些值。You will use these values in the configuration file.

  8. 在 CLI 终端设置目标数据库配置。From the CLI terminal, set up the destination database configuration. 使用 vi conf/conn/cosmosdb.yml 命令打开配置文件,添加一个包含主机 URI 的逗号分隔的列表,并添加端口号、用户名、密码以及其他必需的参数。Open the configuration file using vi conf/conn/cosmosdb.yml command and add a comma-separated list of host URI, port number, username, password, and other required parameters. 下面是一个示例,介绍了配置文件中的内容:The following is an example of contents in the configuration file:

    type: COSMOSDB
    host: `<Azure Cosmos account's Contact point>`
    port: 10350
    username: 'blitzzdemo'
    password: `<Your Azure Cosmos account's primary password>'
    max-connections: 30
    use-ssl: false
  9. 接下来,使用 Blitzz 迁移数据。Next migrate the data using Blitzz. 可以按“完全”或“快照”模式运行 Blizz 复制器: You can run the Blizz replicant in full or snapshot mode:

    • “完全”模式 - 在此模式下,复制器会在迁移后继续运行,并侦听在源 Oracle 系统上发生的任何更改。Full mode - In this mode, the replicant continues to run after migration and it listens for any changes on the source Oracle system. 如果它检测到任何更改,则会将更改实时复制到目标 Azure Cosmos 帐户。If it detects any changes, they are replicated on the target Azure Cosmos account in real time.

    • “快照”模式 - 在此模式下,可以执行架构迁移和一次性数据复制。Snapshot mode - In this mode, you can perform schema migration and one-time data replication. 此选项不支持实时复制。Real-time replication isn't supported with this option.

    可以通过上述两种模式进行迁移,不会造成停机。By using the above two modes, migration can be performed with zero downtime.

  10. 若要迁移数据,请在 Blitzz 复制器 CLI 终端运行以下命令:To migrate data, from the Blitzz replicant CLI terminal, run the following command:

    ./bin/replicant full conf/conn/oracle.yaml conf/conn/cosmosdb.yaml --filter filter/oracle_filter.yaml --replace-existing

    复制器 UI 显示复制进度。The replicant UI shows the replication progress. 完成架构迁移和快照操作以后,进度会显示 100%。Once the schema migration and snapshot operation are done, the progress shows 100%. 完成迁移后,可在目标 Azure Cosmos 数据库上验证数据。After the migration is complete, you can validate the data on the target Azure Cosmos database.

    Oracle 数据迁移输出

  11. 由于你已使用“完全”模式进行迁移,因此可以执行多项操作,例如在源 Oracle 数据库上插入、更新或删除数据。Because you have used full mode for migration, you can perform operations such as insert, update, or delete data on the source Oracle database. 稍后可以验证它们是否已在目标 Azure Cosmos 数据库上实时复制。Later you can validate that they are replicated real time on the target Azure Cosmos database. 迁移后,请务必降低为 Azure Cosmos 容器配置的吞吐量。After the migration, make sure to decrease the throughput configured for your Azure Cosmos container.

  12. 可以随时停止复制器,并使用 --resume 开关重启它。You can stop the replicant any point and restart it with --resume switch. 复制会从停止的点继续,不会损害数据一致性。The replication resumes from the point it has stopped without compromising on data consistency. 以下命令演示如何使用 resume 开关。The following command shows how to use the resume switch.

    ./bin/replicant full conf/conn/oracle.yaml conf/conn/cosmosdb.yaml --filter filter/oracle_filter.yaml --replace-existing --resume

后续步骤Next steps