<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged cloud-migration</title>
<link>https://coderlegion.com/tag/cloud-migration</link>
<description>Powered by Question2Answer</description>
<item>
<title>MySQL HeatWave: Migrating Your Data to HeatWave Service</title>
<link>https://coderlegion.com/7832/mysql-heatwave-migrating-your-data-to-heatwave-service</link>
<description>&lt;p&gt;Migrating data to MySQL HeatWave is a critical step in leveraging the cloud's power for your database workloads. MySQL Shell dump utilities provide the recommended method for exporting data from source MySQL databases and importing them into HeatWave DB systems. These utilities offer HeatWave-specific compatibility checks, parallel processing, and automatic modifications to ensure smooth migrations.&lt;/p&gt;
&lt;p&gt;This guide covers dump utilities, compatibility checks, and best practices for successful data migration to MySQL HeatWave.&lt;/p&gt;
&lt;h3 id=&quot;understanding-data-migration&quot;&gt;Understanding Data Migration&lt;/h3&gt;
&lt;p&gt;Data migration to MySQL HeatWave involves moving data from a source MySQL database (on-premises, cloud, or other infrastructure) to a target MySQL HeatWave DB system in Oracle Cloud Infrastructure.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Migration Process&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Export data from source using MySQL Shell dump utilities&lt;/li&gt;
&lt;li&gt;Store dump files in OCI Object Storage or locally&lt;/li&gt;
&lt;li&gt;Run compatibility checks for HeatWave&lt;/li&gt;
&lt;li&gt;Apply necessary modifications&lt;/li&gt;
&lt;li&gt;Import data into HeatWave DB system using &lt;code&gt;util.loadDump()&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;mysql-shell-dump-utilities&quot;&gt;MySQL Shell Dump Utilities&lt;/h3&gt;
&lt;p&gt;MySQL Shell provides three dump utilities: util.dumpInstance(), util.dumpSchemas(), and util.dumpTables(). Each serves different migration scenarios.&lt;/p&gt;
&lt;h4 id=&quot;1-util-dumpinstance-&quot;&gt;1. util.dumpInstance()&lt;/h4&gt;
&lt;p&gt;Exports all compatible schemas to Object Storage bucket or local files, including users, events, routines, and triggers by default&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Exports&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All user schemas (excludes system schemas)&lt;/li&gt;
&lt;li&gt;User accounts and privileges&lt;/li&gt;
&lt;li&gt;Events, routines, and triggers&lt;/li&gt;
&lt;li&gt;Complete database structure&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What It Excludes&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;System schemas: mysql, sys, performance_schema, information_schema, ndbinfo&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example Usage&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpInstance(&quot;/path/to/dump&quot;, {
  ocimds: true,
  threads: 8,
  compatibility: [&quot;force_innodb&quot;, &quot;strip_definers&quot;, &quot;strip_tablespaces&quot;]
})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;To Object Storage&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpInstance(&quot;&quot;, {
  osBucketName: &quot;myMigrationBucket&quot;,
  osNamespace: &quot;my-namespace&quot;,
  ocimds: true,
  threads: 16,
  compatibility: [&quot;force_innodb&quot;, &quot;strip_definers&quot;, &quot;strip_restricted_grants&quot;, 
                  &quot;strip_tablespaces&quot;, &quot;create_invisible_pks&quot;]
})
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;2-util-dumpschemas-&quot;&gt;2. util.dumpSchemas()&lt;/h4&gt;
&lt;p&gt;Exports selected schemas with all tables, triggers, routines, and events of those schemas&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Exports&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All tables in specified schemas&lt;/li&gt;
&lt;li&gt;Triggers associated with tables&lt;/li&gt;
&lt;li&gt;Routines (stored procedures and functions)&lt;/li&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Views&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example Usage&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpSchemas([&quot;sales&quot;, &quot;inventory&quot;, &quot;customers&quot;], &quot;/path/to/dump&quot;, {
  ocimds: true,
  threads: 4,
  compatibility: [&quot;force_innodb&quot;, &quot;strip_definers&quot;]
})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Multiple Schemas to Object Storage&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpSchemas(
  [&quot;tpch&quot;, &quot;employees&quot;], 
  &quot;&quot;, 
  {
    osBucketName: &quot;mysqlData&quot;,
    osNamespace: &quot;abcdefghijkl&quot;,
    ocimds: true,
    threads: 16,
    compatibility: [&quot;force_innodb&quot;, &quot;strip_restricted_grants&quot;, 
                    &quot;strip_definers&quot;, &quot;strip_tablespaces&quot;, &quot;create_invisible_pks&quot;]
  }
)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-util-dumptables-&quot;&gt;3. util.dumpTables()&lt;/h4&gt;
&lt;p&gt;Exports selected tables or views from a schema, including triggers of exported tables&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Exports&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Specified tables or views&lt;/li&gt;
&lt;li&gt;Triggers associated with those tables&lt;/li&gt;
&lt;li&gt;Schema structure needed to recreate tables&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example Usage&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpTables(&quot;sales&quot;, [&quot;orders&quot;, &quot;order_items&quot;, &quot;customers&quot;], &quot;/path/to/dump&quot;, {
  ocimds: true,
  threads: 2,
  compatibility: [&quot;force_innodb&quot;]
})
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;dump-utility-options&quot;&gt;Dump Utility Options&lt;/h3&gt;
&lt;p&gt;Dump utilities support parallel dumping with multiple threads, file compression, OCI Object Storage streaming, and MySQL HeatWave compatibility checks and modifications&lt;/p&gt;
&lt;h4 id=&quot;essential-options&quot;&gt;Essential Options&lt;/h4&gt;
&lt;h5 id=&quot;ocimds&quot;&gt;ocimds&lt;/h5&gt;
&lt;p&gt;Enables HeatWave Service compatibility checks. When set to &lt;code&gt;true&lt;/code&gt;, the dump cannot proceed if incompatibilities exist.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ocimds: true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Critical&lt;/strong&gt;: Dumps loaded into HeatWave must be created with &lt;code&gt;ocimds: true&lt;/code&gt;.&lt;/p&gt;
&lt;h5 id=&quot;threads&quot;&gt;threads&lt;/h5&gt;
&lt;p&gt;Number of parallel threads for dump operation. More threads = faster dumps but higher source load.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;threads: 16  // Use 4-16 for most workloads
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;compatibility&quot;&gt;compatibility&lt;/h5&gt;
&lt;p&gt;Array of modifications to apply during export to ensure HeatWave compatibility.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;compatibility: [&quot;force_innodb&quot;, &quot;strip_definers&quot;, &quot;strip_tablespaces&quot;, 
                &quot;create_invisible_pks&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;bytesperchunk&quot;&gt;bytesPerChunk&lt;/h5&gt;
&lt;p&gt;Defines chunk size for large datasets. Default is 64MB.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;bytesPerChunk: &quot;128M&quot;  // For large datasets
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;compression&quot;&gt;compression&lt;/h5&gt;
&lt;p&gt;Compression algorithm for dump files.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;compression: &quot;zstd&quot;  // Options: zstd (default), gzip, none
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;maxrate&quot;&gt;maxRate&lt;/h5&gt;
&lt;p&gt;Maximum data read throughput during dump (in bytes per second).&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;maxRate: &quot;50M&quot;  // Limit to 50 MB/s to reduce source impact
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;advanced-options&quot;&gt;Advanced Options&lt;/h4&gt;
&lt;h5 id=&quot;dryrun&quot;&gt;dryRun&lt;/h5&gt;
&lt;p&gt;Displays what would be dumped and results of compatibility checks without proceeding&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mode: &quot;dryrun&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Always run dryRun first&lt;/strong&gt; to identify issues before actual export.&lt;/p&gt;
&lt;h5 id=&quot;consistent&quot;&gt;consistent&lt;/h5&gt;
&lt;p&gt;Ensures data consistency by using FLUSH TABLES WITH READ LOCK.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;consistent: true  // Default
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;excludeschemas-includeschemas&quot;&gt;excludeSchemas / includeSchemas&lt;/h5&gt;
&lt;p&gt;Filter which schemas to dump.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;excludeSchemas: [&quot;test&quot;, &quot;staging&quot;]
// Or
includeSchemas: [&quot;production&quot;, &quot;analytics&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;excludetables-includetables&quot;&gt;excludeTables / includeTables&lt;/h5&gt;
&lt;p&gt;Filter tables within schemas (for dumpSchemas and dumpInstance).&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;excludeTables: [&quot;sales.temp_*&quot;, &quot;logs.old_*&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;defaultcharacterset&quot;&gt;defaultCharacterSet&lt;/h5&gt;
&lt;p&gt;Specify character set for dump files.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;defaultCharacterSet: &quot;utf8mb4&quot;  // Recommended
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;performing-a-dry-run&quot;&gt;Performing a Dry Run&lt;/h3&gt;
&lt;p&gt;Always perform a dry run before actual export to identify compatibility issues&lt;/p&gt;
&lt;h4 id=&quot;dry-run-command&quot;&gt;Dry Run Command&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpInstance(&quot;&quot;, {
  mode: &quot;dryrun&quot;,
  ocimds: true
})
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;what-dry-run-does&quot;&gt;What Dry Run Does&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Connects to source database&lt;/li&gt;
&lt;li&gt;Analyzes schemas, tables, and objects&lt;/li&gt;
&lt;li&gt;Runs HeatWave compatibility checks&lt;/li&gt;
&lt;li&gt;Lists all objects to be dumped&lt;/li&gt;
&lt;li&gt;Reports compatibility issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Does not export any data&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;sample-dry-run-output&quot;&gt;Sample Dry Run Output&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;Checking for compatibility with MySQL HeatWave Service

Compatibility issues with MySQL HeatWave Service 8.0.32
1) Schema 'sales'
  Table 'legacy_orders' uses MyISAM storage engine (issue: engine)
  Table 'customers' has no primary key (issue: no_pk)
  View 'active_orders' has DEFINER='admin'@'localhost' (issue: definer)

2) Schema 'inventory'
  Table 'items' uses MyISAM storage engine (issue: engine)
  
Compatibility issues found. Use 'compatibility' option to apply modifications.
Suggested options: [&quot;force_innodb&quot;, &quot;strip_definers&quot;, &quot;create_invisible_pks&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;heatwave-compatibility-checks&quot;&gt;HeatWave Compatibility Checks&lt;/h3&gt;
&lt;p&gt;Setting ocimds option to true enables compatibility checks that list all issues when instance is dumped&lt;/p&gt;
&lt;h4 id=&quot;common-compatibility-issues&quot;&gt;Common Compatibility Issues&lt;/h4&gt;
&lt;h5 id=&quot;1-non-innodb-storage-engines&quot;&gt;1. Non-InnoDB Storage Engines&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: HeatWave only supports InnoDB&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Use &lt;code&gt;force_innodb&lt;/code&gt; compatibility option&lt;/p&gt;
&lt;h5 id=&quot;2-missing-primary-keys&quot;&gt;2. Missing Primary Keys&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: High Availability requires primary keys on all tables&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Use &lt;code&gt;create_invisible_pks&lt;/code&gt; or &lt;code&gt;ignore_missing_pks&lt;/code&gt;&lt;/p&gt;
&lt;h5 id=&quot;3-definer-clauses&quot;&gt;3. DEFINER Clauses&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Requires special privileges to create with custom definer&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Use &lt;code&gt;strip_definers&lt;/code&gt;&lt;/p&gt;
&lt;h5 id=&quot;4-tablespace-clauses&quot;&gt;4. Tablespace Clauses&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: HeatWave has tablespace restrictions&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Use &lt;code&gt;strip_tablespaces&lt;/code&gt;&lt;/p&gt;
&lt;h5 id=&quot;5-restricted-grants&quot;&gt;5. Restricted Grants&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Some privileges not supported in HeatWave&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Use &lt;code&gt;strip_restricted_grants&lt;/code&gt;&lt;/p&gt;
&lt;h5 id=&quot;6-external-authentication&quot;&gt;6. External Authentication&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Some authentication plugins not supported&lt;br&gt;
&lt;strong&gt;Solution&lt;/strong&gt;: Use &lt;code&gt;skip_invalid_accounts&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;heatwave-compatibility-modifications&quot;&gt;HeatWave Compatibility Modifications&lt;/h3&gt;
&lt;p&gt;Compatibility options automatically modify exported data to resolve compatibility issues&lt;/p&gt;
&lt;h4 id=&quot;available-compatibility-options&quot;&gt;Available Compatibility Options&lt;/h4&gt;
&lt;h5 id=&quot;force-innodb&quot;&gt;force_innodb&lt;/h5&gt;
&lt;p&gt;Modifies ENGINE clause of CREATE TABLE statements to specify InnoDB for tables using incompatible storage engines&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Does&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Changes &lt;code&gt;ENGINE=MyISAM&lt;/code&gt; to &lt;code&gt;ENGINE=InnoDB&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Changes other engines (MEMORY, CSV, etc.) to InnoDB&lt;/li&gt;
&lt;li&gt;Leaves InnoDB tables unchanged&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Before
CREATE TABLE orders (...) ENGINE=MyISAM;

-- After
CREATE TABLE orders (...) ENGINE=InnoDB;
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;strip-definers&quot;&gt;strip_definers&lt;/h5&gt;
&lt;p&gt;Removes DEFINER=account clause from views, routines, events, and triggers, changing SQL SECURITY to INVOKER&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Does&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Removes DEFINER clause&lt;/li&gt;
&lt;li&gt;Changes SQL SECURITY from DEFINER to INVOKER&lt;/li&gt;
&lt;li&gt;Objects created with default definer (user loading schema)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Before
CREATE DEFINER=`admin`@`localhost` VIEW active_orders AS ...

-- After
CREATE VIEW active_orders AS ...
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;strip-tablespaces&quot;&gt;strip_tablespaces&lt;/h5&gt;
&lt;p&gt;Removes TABLESPACE clause from CREATE TABLE statements so tables are created in default tablespaces&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Does&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Removes TABLESPACE option from CREATE TABLE&lt;/li&gt;
&lt;li&gt;Comments out DATA DIRECTORY, INDEX DIRECTORY, ENCRYPTION options&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Before
CREATE TABLE orders (...) TABLESPACE=ts1;

-- After
CREATE TABLE orders (...);
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;create-invisible-pks&quot;&gt;create_invisible_pks&lt;/h5&gt;
&lt;p&gt;Adds invisible primary keys to tables without primary keys, required for High Availability DB systems&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What It Does&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Adds invisible AUTO_INCREMENT column named &lt;code&gt;my_row_id&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Sets as primary key&lt;/li&gt;
&lt;li&gt;No impact on applications (column is invisible)&lt;/li&gt;
&lt;li&gt;Requires MySQL 8.0.24+ on target&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Before
CREATE TABLE logs (
  timestamp DATETIME,
  message TEXT
);

-- After
CREATE TABLE logs (
  my_row_id BIGINT UNSIGNED AUTO_INCREMENT INVISIBLE PRIMARY KEY,
  timestamp DATETIME,
  message TEXT
);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Alternative&lt;/strong&gt;: &lt;code&gt;ignore_missing_pks&lt;/code&gt; - ignores missing PKs but cannot load to HA systems.&lt;/p&gt;
&lt;h5 id=&quot;strip-restricted-grants&quot;&gt;strip_restricted_grants&lt;/h5&gt;
&lt;p&gt;Removes privileges that are restricted in MySQL HeatWave Service&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Restricted Privileges&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SUPER&lt;/li&gt;
&lt;li&gt;FILE&lt;/li&gt;
&lt;li&gt;RELOAD&lt;/li&gt;
&lt;li&gt;BINLOG_ADMIN&lt;/li&gt;
&lt;li&gt;Others specific to managed service&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;skip-invalid-accounts&quot;&gt;skip_invalid_accounts&lt;/h5&gt;
&lt;p&gt;Skips user accounts with external authentication plugins not supported in HeatWave.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Also removes&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Accounts without passwords (except roles)&lt;/li&gt;
&lt;li&gt;Accounts using unsupported plugins&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;applying-compatibility-options&quot;&gt;Applying Compatibility Options&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpInstance(&quot;&quot;, {
  osBucketName: &quot;migrationBucket&quot;,
  ocimds: true,
  compatibility: [
    &quot;force_innodb&quot;,
    &quot;strip_definers&quot;,
    &quot;strip_restricted_grants&quot;,
    &quot;strip_tablespaces&quot;,
    &quot;create_invisible_pks&quot;
  ]
})
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;step-by-step-migration-process&quot;&gt;Step-by-Step Migration Process&lt;/h3&gt;
&lt;h4 id=&quot;step-1-prepare-source-database&quot;&gt;Step 1: Prepare Source Database&lt;/h4&gt;
&lt;p&gt;Ensure MySQL Shell is installed and source is accessible:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh --version  # Should be 8.0.21 or later
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;step-2-run-dry-run&quot;&gt;Step 2: Run Dry Run&lt;/h4&gt;
&lt;p&gt;Identify compatibility issues:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh admin@source_server:3306 -- util dump-instance &quot;&quot; \
  --mode=dryrun \
  --ocimds=true
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;step-3-analyze-dry-run-output&quot;&gt;Step 3: Analyze Dry Run Output&lt;/h4&gt;
&lt;p&gt;Review compatibility issues and note suggested options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Storage engine issues → &lt;code&gt;force_innodb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Missing PKs → &lt;code&gt;create_invisible_pks&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Definer clauses → &lt;code&gt;strip_definers&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Tablespace issues → &lt;code&gt;strip_tablespaces&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;step-4-export-data-with-modifications&quot;&gt;Step 4: Export Data with Modifications&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;To Local Files&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh admin@source_server:3306 -- util dump-instance /backup/migration \
  --ocimds=true \
  --threads=8 \
  --bytesPerChunk=128M \
  --compatibility='[&quot;force_innodb&quot;,&quot;strip_definers&quot;,&quot;strip_tablespaces&quot;,&quot;create_invisible_pks&quot;]'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;To Object Storage&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh admin@source_server:3306 -- util dump-instance &quot;&quot; \
  --osBucketName=migrationBucket \
  --osNamespace=my-namespace \
  --ocimds=true \
  --threads=16 \
  --compression=zstd \
  --compatibility='[&quot;force_innodb&quot;,&quot;strip_definers&quot;,&quot;strip_restricted_grants&quot;,&quot;strip_tablespaces&quot;,&quot;create_invisible_pks&quot;]'
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;step-5-import-data-into-heatwave&quot;&gt;Step 5: Import Data into HeatWave&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;From Object Storage&lt;/strong&gt; (during DB system creation):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select &quot;Import data from Object Storage&quot;&lt;/li&gt;
&lt;li&gt;Provide bucket details&lt;/li&gt;
&lt;li&gt;HeatWave automatically imports during provisioning&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;To Existing DB System&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh admin@heatwave_endpoint:3306 -- util load-dump /backup/migration \
  --threads=16 \
  --progressFile=/tmp/load-progress.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;From Object Storage to Existing System&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh admin@heatwave_endpoint:3306 -- util load-dump migrationBucket \
  --osBucketName=migrationBucket \
  --osNamespace=my-namespace \
  --threads=16
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;best-practices&quot;&gt;Best Practices&lt;/h3&gt;
&lt;h4 id=&quot;1-always-use-ocimds-true&quot;&gt;1. Always Use ocimds: true&lt;/h4&gt;
&lt;p&gt;Ensures HeatWave compatibility checks run during export. Dumps without this cannot be loaded into HeatWave.&lt;/p&gt;
&lt;h4 id=&quot;2-run-dry-run-first&quot;&gt;2. Run Dry Run First&lt;/h4&gt;
&lt;p&gt;Identify compatibility issues before actual export to avoid failed migrations&lt;/p&gt;
&lt;h4 id=&quot;3-use-appropriate-thread-count&quot;&gt;3. Use Appropriate Thread Count&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Small databases (&amp;lt; 10GB): 2-4 threads&lt;/li&gt;
&lt;li&gt;Medium databases (10-100GB): 8-12 threads&lt;/li&gt;
&lt;li&gt;Large databases (&amp;gt; 100GB): 16-32 threads&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Balance&lt;/strong&gt;: More threads = faster but higher source load.&lt;/p&gt;
&lt;h4 id=&quot;4-chunk-large-tables&quot;&gt;4. Chunk Large Tables&lt;/h4&gt;
&lt;p&gt;For very large tables, use bytesPerChunk:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;bytesPerChunk: &quot;256M&quot;  // For tables &amp;gt; 10GB
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;5-use-compression&quot;&gt;5. Use Compression&lt;/h4&gt;
&lt;p&gt;Reduces storage and transfer costs:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;compression: &quot;zstd&quot;  // Best compression ratio and speed
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;6-monitor-dump-progress&quot;&gt;6. Monitor Dump Progress&lt;/h4&gt;
&lt;p&gt;Dumps display progress including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Total rows to dump&lt;/li&gt;
&lt;li&gt;Rows dumped so far&lt;/li&gt;
&lt;li&gt;Percentage complete&lt;/li&gt;
&lt;li&gt;Throughput (rows/sec, MB/sec)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;7-test-with-subset-first&quot;&gt;7. Test with Subset First&lt;/h4&gt;
&lt;p&gt;For large migrations, test with single schema:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;util.dumpSchemas([&quot;test_schema&quot;], ...)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Validate before full migration.&lt;/p&gt;
&lt;h4 id=&quot;8-plan-for-downtime&quot;&gt;8. Plan for Downtime&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Read-only mode during export for consistency&lt;/li&gt;
&lt;li&gt;Or use consistent: true for point-in-time snapshot&lt;/li&gt;
&lt;li&gt;Plan maintenance window for production migrations&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;9-validate-after-import&quot;&gt;9. Validate After Import&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Check row counts
SELECT COUNT(*) FROM imported_table;

-- Verify structure
SHOW CREATE TABLE imported_table;

-- Test queries
SELECT * FROM imported_table LIMIT 10;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;10-keep-dump-files&quot;&gt;10. Keep Dump Files&lt;/h4&gt;
&lt;p&gt;Retain dump files until migration validated:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Local backups or Object Storage&lt;/li&gt;
&lt;li&gt;Useful for troubleshooting&lt;/li&gt;
&lt;li&gt;Allows re-import if needed&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;/h3&gt;
&lt;h4 id=&quot;issue-1-dump-fails-with-compatibility-errors&quot;&gt;Issue 1: Dump Fails with Compatibility Errors&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Export aborts with list of incompatible objects&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Run dry run to see all issues&lt;/li&gt;
&lt;li&gt;Apply suggested compatibility options&lt;/li&gt;
&lt;li&gt;For manual issues, fix source schema&lt;/li&gt;
&lt;li&gt;Re-run export&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;issue-2-out-of-memory-during-dump&quot;&gt;Issue 2: Out of Memory During Dump&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Process killed, &quot;out of memory&quot; errors&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reduce thread count&lt;/li&gt;
&lt;li&gt;Increase system memory&lt;/li&gt;
&lt;li&gt;Use bytesPerChunk to process smaller chunks&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;issue-3-load-fails-with-local-infile-error&quot;&gt;Issue 3: Load Fails with &quot;local_infile&quot; Error&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Import fails, local_infile error&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On HeatWave DB system
SET GLOBAL local_infile = ON;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(Default is ON in HeatWave, but verify)&lt;/p&gt;
&lt;h4 id=&quot;issue-4-tables-missing-after-import&quot;&gt;Issue 4: Tables Missing After Import&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Some tables not imported&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check excluded tables in dump command&lt;/li&gt;
&lt;li&gt;Verify tables exported in dump metadata&lt;/li&gt;
&lt;li&gt;Check for errors in load-progress.json&lt;/li&gt;
&lt;li&gt;Ensure compatibility options applied correctly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Migrating data to MySQL HeatWave using MySQL Shell dump utilities provides a reliable, efficient path to the cloud. By understanding the three dump utilities, running compatibility checks, and applying appropriate modifications, you can ensure smooth migrations with minimal issues.&lt;/p&gt;
&lt;p&gt;Key takeaways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use util.dumpInstance()&lt;/strong&gt; for complete database migrations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use util.dumpSchemas()&lt;/strong&gt; for selective schema migrations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use util.dumpTables()&lt;/strong&gt; for specific table exports&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Always run dry run first&lt;/strong&gt; to identify compatibility issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Apply compatibility options&lt;/strong&gt; to auto-fix common issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test with subset&lt;/strong&gt; before full migration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor and validate&lt;/strong&gt; throughout the process&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whether migrating from on-premises, other clouds, or between HeatWave regions, MySQL Shell dump utilities provide the tools needed for successful data migration to MySQL HeatWave.&lt;/p&gt;
</description>
<category>mysql</category>
<guid isPermaLink="true">https://coderlegion.com/7832/mysql-heatwave-migrating-your-data-to-heatwave-service</guid>
<pubDate>Wed, 26 Nov 2025 10:08:43 +0000</pubDate>
</item>
<item>
<title>MySQL HeatWave: Replicating to DB System (Inbound Replication)</title>
<link>https://coderlegion.com/7467/mysql-heatwave-replicating-to-db-system-inbound-replication</link>
<description>&lt;p&gt;Inbound replication enables data replication from external MySQL sources into HeatWave DB systems, supporting migrations, disaster recovery, and hybrid cloud architectures.&lt;/p&gt;
&lt;h3 id=&quot;what-is-inbound-replication-&quot;&gt;What is Inbound Replication?&lt;/h3&gt;
&lt;p&gt;Uses a replication channel to copy transactions from a MySQL source to a HeatWave DB system replica.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous&lt;/strong&gt;: Replicas don't need permanent connection; can reconnect to receive updates&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single Source&lt;/strong&gt;: One source per replica (multi-source not supported)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Source Independence&lt;/strong&gt;: Source doesn't control replica; replica connects using replication credentials&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not Managed&lt;/strong&gt;: You configure and maintain the channel and network connectivity&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;supported-scenarios&quot;&gt;Supported Scenarios&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;On-Premises to DB System&lt;/strong&gt;: Cloud migrations, hybrid architectures, disaster recovery&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloud Compute to DB System&lt;/strong&gt;: Cross-cloud replication, migrating self-managed to HeatWave&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DB System to DB System&lt;/strong&gt;: Cross-region replication, geographic redundancy&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;replication-architecture&quot;&gt;Replication Architecture&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Source Database:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MySQL 5.7+ (on-premises, OCI compute, HeatWave DB System, or other clouds)&lt;/li&gt;
&lt;li&gt;Binary logging enabled&lt;/li&gt;
&lt;li&gt;Row-based replication format&lt;/li&gt;
&lt;li&gt;GTID mode enabled (recommended)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Replica Database:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MySQL HeatWave DB System in private subnet&lt;/li&gt;
&lt;li&gt;Applies transactions from source asynchronously&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Flow:&lt;/strong&gt; Source commits to binary log → Channel retrieves transactions → Replica receives and applies&lt;/p&gt;
&lt;h3 id=&quot;limitations&quot;&gt;Limitations&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Row-Based Only&lt;/strong&gt;: Statement-based and mixed replication not supported&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous Only&lt;/strong&gt;: Semi-synchronous not supported&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single Source&lt;/strong&gt;: Multi-source replication not supported&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MySQL Schema Not Replicated&lt;/strong&gt;: User/privilege changes don't replicate; manage separately&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GTID Tags&lt;/strong&gt;: Pre-May 2024 systems need upgrade for GTID tag support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Applier Privileges&lt;/strong&gt;: Replication fails if applier lacks privileges for statements&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HeatWave Cluster&lt;/strong&gt;: ALTER TABLE SECONDARY_LOAD/UNLOAD don't affect target cluster&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;High Availability&lt;/strong&gt;: Channel suspends during HA upgrades, resumes after completion&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h3&gt;
&lt;h4 id=&quot;source-requirements&quot;&gt;Source Requirements&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;1. Enable GTID (Recommended):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SET GLOBAL enforce_gtid_consistency = ON;
SET GLOBAL gtid_mode = OFF_PERMISSIVE;
SET GLOBAL gtid_mode = ON_PERMISSIVE;
SET GLOBAL gtid_mode = ON;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;2. Enable Binary Logging:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SET GLOBAL log_bin = ON;
SET GLOBAL binlog_format = 'ROW';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;3. Extend Binary Log Retention:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- For AWS RDS:
CALL mysql.rds_set_configuration('binlog retention hours', 24);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;4. Create Replication User:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CREATE USER 'repl_user'@'%' 
  IDENTIFIED BY 'StrongPassword123!' 
  REQUIRE SSL;
GRANT REPLICATION SLAVE ON *.* TO 'repl_user'@'%';
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;5. Network Connectivity&lt;/strong&gt;: Allow replica access to source MySQL port (3306) with SSL/TLS&lt;/p&gt;
&lt;h4 id=&quot;replica-requirements&quot;&gt;Replica Requirements&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Active HeatWave DB system&lt;/li&gt;
&lt;li&gt;Network path to source (VPN, FastConnect, PrivateLink)&lt;/li&gt;
&lt;li&gt;Matching &lt;code&gt;lower_case_table_names&lt;/code&gt; value with source&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;connectivity-options&quot;&gt;Connectivity Options&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;On-Premises to HeatWave:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FastConnect&lt;/strong&gt;: Up to 10 Gbps, low latency, production workloads&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Site-to-Site VPN&lt;/strong&gt;: 250 Mbps per tunnel, cost-effective, dev/test&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Cloud to HeatWave:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AWS: PrivateLink or VPN&lt;/li&gt;
&lt;li&gt;Azure: OCI-Azure interconnect or VPN&lt;/li&gt;
&lt;li&gt;GCP: Partner Interconnect or VPN&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;dedicated-replication-user-benefits&quot;&gt;Dedicated Replication User Benefits&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Minimum Privileges&lt;/strong&gt;: Grant only REPLICATION SLAVE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restrict Host&lt;/strong&gt;: Limit to replica IP/subnet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enforce Encryption&lt;/strong&gt;: Use REQUIRE SSL&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CREATE USER 'repl_user'@'10.0.1.%' 
  IDENTIFIED BY 'SecurePassword!' 
  REQUIRE SSL;
GRANT REPLICATION SLAVE ON *.* TO 'repl_user'@'10.0.1.%';
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;loading-initial-data&quot;&gt;Loading Initial Data&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Export from Source:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh user@source_host:3306 -- util dump-instance /path/to/dump \
  --excludeSchemas=mysql,sys,performance_schema,information_schema \
  --ocimds=true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Import to Replica:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh admin@replica_host:3306 -- util load-dump /path/to/dump \
  --progressFile=/path/to/progress.json
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;creating-replication-channel&quot;&gt;Creating Replication Channel&lt;/h3&gt;
&lt;h4 id=&quot;using-oci-console&quot;&gt;Using OCI Console&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to DB System → Resources → Channels&lt;/li&gt;
&lt;li&gt;Click Create channel&lt;/li&gt;
&lt;li&gt;Configure settings (source hostname, port, credentials, SSL mode)&lt;/li&gt;
&lt;li&gt;Click Create&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;using-oci-cli&quot;&gt;Using OCI CLI&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel create-from-mysql --generate-full-command-json-input &amp;gt; channel-config.json
# Edit channel-config.json with your settings
oci mysql channel create-from-mysql --from-json file://channel-config.json
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;positioning-options&quot;&gt;Positioning Options&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;GTID Auto-Positioning (Recommended):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automatic transaction tracking&lt;/li&gt;
&lt;li&gt;No manual position needed&lt;/li&gt;
&lt;li&gt;Requires &lt;code&gt;gtid_mode=ON&lt;/code&gt; on source&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Binary Log Positioning:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Get position on source:
SHOW MASTER STATUS;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use File and Position values when creating channel&lt;/p&gt;
&lt;h3 id=&quot;managing-channels&quot;&gt;Managing Channels&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Start:&lt;/strong&gt; &lt;code&gt;oci mysql channel update --channel-id &amp;lt;ID&amp;gt; --is-enabled true&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stop:&lt;/strong&gt; &lt;code&gt;oci mysql channel update --channel-id &amp;lt;ID&amp;gt; --is-enabled false&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reset:&lt;/strong&gt; &lt;code&gt;oci mysql channel reset --channel-id &amp;lt;ID&amp;gt; --from-json '{&quot;resetType&quot;: &quot;POSITION&quot;}'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Delete:&lt;/strong&gt; &lt;code&gt;oci mysql channel delete --channel-id &amp;lt;ID&amp;gt; --force&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&quot;monitoring-replication&quot;&gt;Monitoring Replication&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Check Status:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SHOW REPLICA STATUS\G
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Key Metrics:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Replica_IO_Running&lt;/code&gt;: Should be &quot;Yes&quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Replica_SQL_Running&lt;/code&gt;: Should be &quot;Yes&quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Seconds_Behind_Source&lt;/code&gt;: Replication lag&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Last_Error&lt;/code&gt;: Error messages&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Channel States:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ACTIVE: Running normally&lt;/li&gt;
&lt;li&gt;NEEDS_ATTENTION: Requires intervention&lt;/li&gt;
&lt;li&gt;INACTIVE: Stopped&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;best-practices-1&quot;&gt;Best Practices&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Enable GTID&lt;/strong&gt;: Simplifies management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use SSL/TLS&lt;/strong&gt;: Encrypt replication traffic&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monitor Lag&lt;/strong&gt;: Alert on &amp;gt;60 seconds lag&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test Failover&lt;/strong&gt;: Regular failover testing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Binary Log Retention&lt;/strong&gt;: 24-48 hours recommended&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Health Checks&lt;/strong&gt;: Automate monitoring&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gradual Migration&lt;/strong&gt;: Phased approach for migrations&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;NEEDS_ATTENTION State:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check error logs in channel details&lt;/li&gt;
&lt;li&gt;Verify connectivity and credentials&lt;/li&gt;
&lt;li&gt;Confirm SSL configuration and firewall rules&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Increasing Lag:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Increase replica resources&lt;/li&gt;
&lt;li&gt;Check network bandwidth&lt;/li&gt;
&lt;li&gt;Optimize source queries&lt;/li&gt;
&lt;li&gt;Break large transactions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;MySQL Schema Errors:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manage users independently on replica&lt;/li&gt;
&lt;li&gt;Avoid mysql schema changes during replication&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;SSL Failures:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify source SSL enabled&lt;/li&gt;
&lt;li&gt;Use &quot;REQUIRED&quot; mode&lt;/li&gt;
&lt;li&gt;Check certificate validity&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;key-takeaways&quot;&gt;Key Takeaways&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Asynchronous replication tolerates disconnections&lt;/li&gt;
&lt;li&gt;Use GTID mode for simplified management&lt;/li&gt;
&lt;li&gt;Always encrypt replication traffic&lt;/li&gt;
&lt;li&gt;Monitor lag, errors, and channel health continuously&lt;/li&gt;
&lt;li&gt;Understand limitations: row-based only, single source, mysql schema restrictions&lt;/li&gt;
&lt;li&gt;Test thoroughly before production cutover&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Inbound replication provides flexible, reliable data migration and hybrid cloud capabilities for MySQL HeatWave workloads.&lt;/p&gt;
&lt;h3 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/doc/replication.html&quot;&gt;MySQL HeatWave Inbound Replication Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/doc/configuring-source-server.html&quot;&gt;Source Configuration Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/doc/creating-replication-channel.html&quot;&gt;Creating a Replication Channel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/mysql-database/&quot;&gt;MySQL HeatWave Service Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/en-us/iaas/database-management/&quot;&gt;OCI Database Management&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://coderlegion.com/7467/mysql-heatwave-replicating-to-db-system-inbound-replication</guid>
<pubDate>Tue, 18 Nov 2025 09:39:47 +0000</pubDate>
</item>
</channel>
</rss>