<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged oracle-database-administration</title>
<link>https://coderlegion.com/tag/oracle-database-administration</link>
<description>Powered by Question2Answer</description>
<item>
<title>MySQL HeatWave: Replication Channels and Troubleshooting</title>
<link>https://coderlegion.com/7603/mysql-heatwave-replication-channels-and-troubleshooting</link>
<description>&lt;p&gt;Replication channels are the cornerstone of MySQL HeatWave inbound replication, establishing the connection between source databases and replica DB systems. Understanding channel states, operations, and troubleshooting techniques is essential for maintaining reliable data replication. This guide covers channel management, lifecycle states, common errors, and proven troubleshooting strategies.&lt;/p&gt;
&lt;h3 id=&quot;understanding-replication-channels&quot;&gt;Understanding Replication Channels&lt;/h3&gt;
&lt;p&gt;A replication channel represents a path through which changes produced by transactions on a source MySQL server or DB system are replicated to a target DB system.&lt;/p&gt;
&lt;h4 id=&quot;what-channels-do&quot;&gt;What Channels Do&lt;/h4&gt;
&lt;p&gt;Each channel identifies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A replication source (hostname, port, credentials)&lt;/li&gt;
&lt;li&gt;Configuration required to connect to that source&lt;/li&gt;
&lt;li&gt;How to copy transactions from source to replica&lt;/li&gt;
&lt;li&gt;Replication positioning (GTID or binary log)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: Channels have their own lifecycle and can be enabled, disabled, reset, and resumed independently.&lt;/p&gt;
&lt;h3 id=&quot;channel-states&quot;&gt;Channel States&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave channels exist in either final states (stable) or transient states (temporary during operations).&lt;/p&gt;
&lt;h4 id=&quot;final-states&quot;&gt;Final States&lt;/h4&gt;
&lt;h5 id=&quot;1-active&quot;&gt;1. ACTIVE&lt;/h5&gt;
&lt;p&gt;Channel is replicating data successfully.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Characteristics&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Both IO and SQL threads running&lt;/li&gt;
&lt;li&gt;Transactions flowing from source to replica&lt;/li&gt;
&lt;li&gt;May have slight replication lag (normal)&lt;/li&gt;
&lt;li&gt;No errors reported&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Console Indicator&lt;/strong&gt;: Green icon with &quot;Active&quot; text&lt;/p&gt;
&lt;h5 id=&quot;2-inactive&quot;&gt;2. INACTIVE&lt;/h5&gt;
&lt;p&gt;Channel is not replicating; replication has been stopped.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Reasons&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Channel manually disabled by administrator&lt;/li&gt;
&lt;li&gt;Created with &quot;Enable automatically&quot; unchecked&lt;/li&gt;
&lt;li&gt;DB system is stopped&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Console Indicator&lt;/strong&gt;: Gray icon with &quot;Inactive&quot; text&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To Resume&lt;/strong&gt;: Enable the channel through console or CLI&lt;/p&gt;
&lt;h5 id=&quot;3-needs-attention&quot;&gt;3. NEEDS_ATTENTION&lt;/h5&gt;
&lt;p&gt;Channel is not replicating due to an error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Causes&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Source server unreachable&lt;/li&gt;
&lt;li&gt;Authentication failure&lt;/li&gt;
&lt;li&gt;Binary log files purged on source&lt;/li&gt;
&lt;li&gt;SSL/TLS configuration mismatch&lt;/li&gt;
&lt;li&gt;Incompatible transactions&lt;/li&gt;
&lt;li&gt;DB system is in INACTIVE state&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Console Indicator&lt;/strong&gt;: Red/orange icon with &quot;Needs Attention&quot; text&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Action Required&lt;/strong&gt;: Check channel details page for error messages, resolve issue, then resume channel&lt;/p&gt;
&lt;h5 id=&quot;4-deleted&quot;&gt;4. DELETED&lt;/h5&gt;
&lt;p&gt;Channel has been permanently removed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Characteristics&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Appears briefly before removal from list&lt;/li&gt;
&lt;li&gt;Cannot be recovered&lt;/li&gt;
&lt;li&gt;All channel configuration deleted&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;transient-states&quot;&gt;Transient States&lt;/h4&gt;
&lt;p&gt;These are temporary states during channel operations:&lt;/p&gt;
&lt;h5 id=&quot;1-creating&quot;&gt;1. CREATING&lt;/h5&gt;
&lt;p&gt;Channel is being created and configured.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt;: Typically 1-3 minutes&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next State&lt;/strong&gt;: ACTIVE (if auto-enabled) or INACTIVE&lt;/p&gt;
&lt;h5 id=&quot;2-updating&quot;&gt;2. UPDATING&lt;/h5&gt;
&lt;p&gt;Channel is performing an update operation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Occurs During&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enabling or disabling channel&lt;/li&gt;
&lt;li&gt;Modifying channel configuration&lt;/li&gt;
&lt;li&gt;Resuming after error resolution&lt;/li&gt;
&lt;li&gt;DB system operations affecting channel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt;: Typically 30 seconds to 2 minutes&lt;/p&gt;
&lt;h5 id=&quot;3-deleting&quot;&gt;3. DELETING&lt;/h5&gt;
&lt;p&gt;Channel deletion is in progress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt;: Typically 1-2 minutes&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next State&lt;/strong&gt;: DELETED&lt;/p&gt;
&lt;h3 id=&quot;channel-operations&quot;&gt;Channel Operations&lt;/h3&gt;
&lt;h4 id=&quot;enabling-a-channel&quot;&gt;Enabling a Channel&lt;/h4&gt;
&lt;p&gt;Starts replication from the source if no errors exist.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to Databases → HeatWave MySQL → Channels&lt;/li&gt;
&lt;li&gt;Select channel → Actions → &lt;strong&gt;Enable&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Channel transitions: INACTIVE → UPDATING → ACTIVE&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel update \
  --channel-id &amp;lt;CHANNEL_OCID&amp;gt; \
  --is-enabled true
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;disabling-a-channel&quot;&gt;Disabling a Channel&lt;/h4&gt;
&lt;p&gt;Stops replication and puts channel into INACTIVE state.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When to Disable&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Maintenance on source server&lt;/li&gt;
&lt;li&gt;Temporary halt of replication&lt;/li&gt;
&lt;li&gt;Troubleshooting issues&lt;/li&gt;
&lt;li&gt;Before configuration changes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;: Channel → Actions → &lt;strong&gt;Disable&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel update \
  --channel-id &amp;lt;CHANNEL_OCID&amp;gt; \
  --is-enabled false
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;resuming-a-channel&quot;&gt;Resuming a Channel&lt;/h4&gt;
&lt;p&gt;Restarts replication after error is resolved. Used when channel is in NEEDS_ATTENTION state.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;: Channel → Actions → &lt;strong&gt;Resume&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel resume \
  --channel-id &amp;lt;CHANNEL_OCID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Behavior&lt;/strong&gt;: Channel transitions to UPDATING, then ACTIVE if error resolved&lt;/p&gt;
&lt;h4 id=&quot;resetting-a-channel&quot;&gt;Resetting a Channel&lt;/h4&gt;
&lt;p&gt;Removes all replication position data except channel configuration. Channel must be INACTIVE first.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: Resets replication position - will re-replicate transactions&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;: Channel → Actions → &lt;strong&gt;Reset&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel reset \
  --channel-id &amp;lt;CHANNEL_OCID&amp;gt; \
  --from-json '{&quot;resetType&quot;: &quot;POSITION&quot;}'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Recovering from corrupted replication position&lt;/li&gt;
&lt;li&gt;Starting replication from beginning&lt;/li&gt;
&lt;li&gt;After major source database changes&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;deleting-a-channel&quot;&gt;Deleting a Channel&lt;/h4&gt;
&lt;p&gt;Permanently removes channel and all associated configuration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;: Channel details → &lt;strong&gt;Delete&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel delete \
  --channel-id &amp;lt;CHANNEL_OCID&amp;gt; \
  --force
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;troubleshooting-inbound-replication&quot;&gt;Troubleshooting Inbound Replication&lt;/h3&gt;
&lt;h4 id=&quot;step-1-identify-source-of-failure&quot;&gt;Step 1: Identify Source of Failure&lt;/h4&gt;
&lt;p&gt;When channel enters NEEDS_ATTENTION state, determine the root cause:&lt;/p&gt;
&lt;h5 id=&quot;check-channel-details-page&quot;&gt;Check Channel Details Page&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to channel in console&lt;/li&gt;
&lt;li&gt;Click channel name to view details&lt;/li&gt;
&lt;li&gt;Review &lt;strong&gt;Error&lt;/strong&gt; section for messages&lt;/li&gt;
&lt;li&gt;Check &lt;strong&gt;Last Error&lt;/strong&gt; timestamp&lt;/li&gt;
&lt;li&gt;Note error code and description&lt;/li&gt;
&lt;/ol&gt;
&lt;h5 id=&quot;check-replication-status-on-replica&quot;&gt;Check Replication Status on Replica&lt;/h5&gt;
&lt;p&gt;Connect to replica DB system and query:&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 Fields&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; (checks source connection)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Replica_SQL_Running&lt;/code&gt;: Should be &quot;Yes&quot; (checks transaction application)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Last_IO_Errno&lt;/code&gt;: IO thread error code&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Last_IO_Error&lt;/code&gt;: IO thread error message&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Last_SQL_Errno&lt;/code&gt;: SQL thread error code&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Last_SQL_Error&lt;/code&gt;: SQL thread error message&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Seconds_Behind_Source&lt;/code&gt;: Replication lag&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Performance Schema Query&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SELECT * FROM performance_schema.replication_connection_status\G
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;step-2-identify-communication-failures&quot;&gt;Step 2: Identify Communication Failures&lt;/h4&gt;
&lt;p&gt;Verify connectivity between replica and source:&lt;/p&gt;
&lt;h5 id=&quot;test-network-connectivity&quot;&gt;Test Network Connectivity&lt;/h5&gt;
&lt;p&gt;From replica DB system or compute instance in same VCN:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Test if source is reachable
telnet &amp;lt;source_hostname&amp;gt; 3306

# Or use netcat
nc -zv &amp;lt;source_hostname&amp;gt; 3306

# Check DNS resolution
nslookup &amp;lt;source_hostname&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;test-replication-user-authentication&quot;&gt;Test Replication User Authentication&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysql -h &amp;lt;source_hostname&amp;gt; \
      -P 3306 \
      -u &amp;lt;repl_user&amp;gt; \
      -p
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If successful, authentication works; issue is elsewhere.&lt;/p&gt;
&lt;h3 id=&quot;common-error-codes-and-solutions&quot;&gt;Common Error Codes and Solutions&lt;/h3&gt;
&lt;h4 id=&quot;error-2003-can-t-connect-to-mysql-server&quot;&gt;Error 2003: Can't Connect to MySQL Server&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;: &quot;Can't connect to MySQL server on '' (error_code)&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Meaning&lt;/strong&gt;: Replica cannot establish network connection to source&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Causes&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Source MySQL server not running&lt;/li&gt;
&lt;li&gt;Firewall blocking port 3306&lt;/li&gt;
&lt;li&gt;Network path doesn't exist&lt;/li&gt;
&lt;li&gt;Wrong hostname or IP address&lt;/li&gt;
&lt;li&gt;Source server not listening on expected port&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Verify source is running&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source server
SHOW GLOBAL STATUS LIKE 'Uptime';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Check firewall rules&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# On source server (Linux)
sudo iptables -L | grep 3306

# Or for firewalld
sudo firewall-cmd --list-all | grep 3306
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Verify MySQL listening on port&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# On source server
sudo netstat -tlnp | grep 3306
# Or
sudo ss -tlnp | grep 3306
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Check bind-address&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source server
SHOW VARIABLES LIKE 'bind_address';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Should be &lt;code&gt;0.0.0.0&lt;/code&gt; or specific IP (not &lt;code&gt;127.0.0.1&lt;/code&gt; for remote connections)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test from replica network&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;telnet &amp;lt;source_ip&amp;gt; 3306
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;error-1045-access-denied&quot;&gt;Error 1045: Access Denied&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;: &quot;Access denied for user ''@'' (using password: YES/NO)&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Meaning&lt;/strong&gt;: Authentication failed - wrong credentials or user doesn't have access from replica IP&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Causes&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Incorrect username or password&lt;/li&gt;
&lt;li&gt;User not granted access from replica IP&lt;/li&gt;
&lt;li&gt;User exists but lacks REPLICATION SLAVE privilege&lt;/li&gt;
&lt;li&gt;Blank users on source conflicting&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Verify replication user exists&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source server
SELECT User, Host FROM mysql.user WHERE User = 'repl_user';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Check user privileges&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SHOW GRANTS FOR 'repl_user'@'%';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Should include: &lt;code&gt;GRANT REPLICATION SLAVE ON *.*&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Verify replica IP is allowed&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source
SELECT User, Host FROM mysql.user WHERE User = 'repl_user';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Host should be &lt;code&gt;%&lt;/code&gt;, replica subnet (e.g., &lt;code&gt;10.0.1.%&lt;/code&gt;), or specific IP&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remove blank users&lt;/strong&gt; (common issue):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source
SELECT User, Host FROM mysql.user WHERE User = '';
DROP USER ''@'localhost';
DROP USER ''@'&amp;lt;hostname&amp;gt;';
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Test authentication&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysql -h &amp;lt;source&amp;gt; -u repl_user -p
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;error-3159-insecure-connection&quot;&gt;Error 3159: Insecure Connection&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;: &quot;Connections using insecure transport are prohibited while --require_secure_transport=ON&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Meaning&lt;/strong&gt;: Source requires SSL/TLS but channel not configured for it&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option 1: Configure SSL in channel&lt;/strong&gt; (recommended)&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Edit channel configuration&lt;/li&gt;
&lt;li&gt;Set SSL mode to &quot;REQUIRED&quot; or higher&lt;/li&gt;
&lt;li&gt;Provide SSL certificates if using VERIFY_CA or VERIFY_IDENTITY&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Option 2: Disable require_secure_transport on source&lt;/strong&gt; (not recommended)&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source server
SET GLOBAL require_secure_transport = OFF;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Verify SSL configuration&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source
SHOW VARIABLES LIKE 'require_secure_transport';
SHOW VARIABLES LIKE 'have_ssl';
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;error-13114-binary-log-files-purged&quot;&gt;Error 13114: Binary Log Files Purged&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Error Message&lt;/strong&gt;: &quot;Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'&quot; or &quot;The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Meaning&lt;/strong&gt;: Binary log files needed by replica have been deleted from source&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common Causes&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;GTID not supported or configured&lt;/li&gt;
&lt;li&gt;Binary log retention too short&lt;/li&gt;
&lt;li&gt;Long replication outage&lt;/li&gt;
&lt;li&gt;Binary logs manually purged&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Solution 1: Fix GTID-Purged (For GTID-based replication)&lt;/strong&gt;&lt;/p&gt;
&lt;h5 id=&quot;step-1-retrieve-gtid-executed-from-logical-dump&quot;&gt;Step 1: Retrieve gtid_executed from logical dump&lt;/h5&gt;
&lt;p&gt;When exporting source data with MySQL Shell:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh user@source -- util dump-instance /path/to/dump \
  --ocimds=true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Capture &lt;code&gt;gtid_executed&lt;/code&gt; value from dump metadata.&lt;/p&gt;
&lt;p&gt;Or query source directly:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On source
SHOW GLOBAL VARIABLES LIKE 'gtid_executed';
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;step-2-set-gtid-purged-on-replica&quot;&gt;Step 2: Set gtid_purged on replica&lt;/h5&gt;
&lt;p&gt;Connect to replica and execute:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- On replica
CALL sys.SET_GTID_PURGED('&amp;lt;gtid_executed_value&amp;gt;');
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CALL sys.SET_GTID_PURGED('3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5');
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;step-3-resume-channel&quot;&gt;Step 3: Resume channel&lt;/h5&gt;
&lt;p&gt;After setting gtid_purged, resume replication:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel resume --channel-id &amp;lt;CHANNEL_OCID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Solution 2: Rebuild Replication (If GTID fix fails)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For severe cases:&lt;/p&gt;
&lt;h5 id=&quot;step-1-delete-channel-and-replica-db-system&quot;&gt;Step 1: Delete channel and replica DB system&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql channel delete --channel-id &amp;lt;CHANNEL_OCID&amp;gt; --force
oci mysql db-system delete --db-system-id &amp;lt;DB_SYSTEM_OCID&amp;gt; --force
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;step-2-take-new-snapshot-of-source&quot;&gt;Step 2: Take new snapshot of source&lt;/h5&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh user@source -- util dump-instance /path/to/new-dump \
  --excludeSchemas=mysql,sys,performance_schema,information_schema \
  --ocimds=true
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;step-3-create-new-db-system&quot;&gt;Step 3: Create new DB system&lt;/h5&gt;
&lt;p&gt;Create DB system and import data during creation or after.&lt;/p&gt;
&lt;h5 id=&quot;step-4-create-and-enable-channel&quot;&gt;Step 4: Create and enable channel&lt;/h5&gt;
&lt;p&gt;Create new channel with proper GTID positioning from new dump.&lt;/p&gt;
&lt;h3 id=&quot;best-practices-for-channel-management&quot;&gt;Best Practices for Channel Management&lt;/h3&gt;
&lt;h4 id=&quot;1-monitor-channel-health&quot;&gt;1. Monitor Channel Health&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Set up alerts&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Channel state changes to NEEDS_ATTENTION&lt;/li&gt;
&lt;li&gt;Replication lag exceeds threshold (e.g., 60 seconds)&lt;/li&gt;
&lt;li&gt;IO or SQL thread stops&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Regular checks&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;h4 id=&quot;2-maintain-adequate-binary-log-retention&quot;&gt;2. Maintain Adequate Binary Log Retention&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;On source server&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Set binary log expiration (seconds)
SET GLOBAL binlog_expire_logs_seconds = 172800; -- 48 hours
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;For AWS RDS&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;CALL mysql.rds_set_configuration('binlog retention hours', 48);
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-document-channel-configuration&quot;&gt;3. Document Channel Configuration&lt;/h4&gt;
&lt;p&gt;Maintain records of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Source connection details&lt;/li&gt;
&lt;li&gt;Replication user credentials&lt;/li&gt;
&lt;li&gt;SSL configuration&lt;/li&gt;
&lt;li&gt;GTID settings&lt;/li&gt;
&lt;li&gt;Network paths used&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-test-before-production&quot;&gt;4. Test Before Production&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Create test channel in non-production&lt;/li&gt;
&lt;li&gt;Verify connectivity&lt;/li&gt;
&lt;li&gt;Test failover scenarios&lt;/li&gt;
&lt;li&gt;Document lessons learned&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;5-plan-for-maintenance-windows&quot;&gt;5. Plan for Maintenance Windows&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Before source maintenance&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify replication lag is minimal&lt;/li&gt;
&lt;li&gt;Optionally disable channel&lt;/li&gt;
&lt;li&gt;Perform maintenance&lt;/li&gt;
&lt;li&gt;Re-enable channel&lt;/li&gt;
&lt;li&gt;Monitor for catch-up&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;6-use-gtid-when-possible&quot;&gt;6. Use GTID When Possible&lt;/h4&gt;
&lt;p&gt;Benefits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Auto-positioning simplifies management&lt;/li&gt;
&lt;li&gt;Easier recovery from failures&lt;/li&gt;
&lt;li&gt;Better failover capabilities&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;advanced-troubleshooting&quot;&gt;Advanced Troubleshooting&lt;/h3&gt;
&lt;h4 id=&quot;replication-lag-increasing&quot;&gt;Replication Lag Increasing&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: &lt;code&gt;Seconds_Behind_Source&lt;/code&gt; continuously growing&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Diagnose&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;-- Check what's being executed
SHOW REPLICA STATUS\G

-- Check running queries on replica
SHOW PROCESSLIST;

-- Check for lock waits
SELECT * FROM sys.innodb_lock_waits;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Increase replica resources (upgrade shape)&lt;/li&gt;
&lt;li&gt;Optimize slow queries on source&lt;/li&gt;
&lt;li&gt;Break large transactions into smaller batches&lt;/li&gt;
&lt;li&gt;Check for long-running transactions&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;channel-constantly-failing&quot;&gt;Channel Constantly Failing&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Channel repeatedly enters NEEDS_ATTENTION&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Diagnose&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check error patterns (same error repeating?)&lt;/li&gt;
&lt;li&gt;Review source server logs&lt;/li&gt;
&lt;li&gt;Check network stability&lt;/li&gt;
&lt;li&gt;Verify source server load&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fix root cause (network, authentication, binary logs)&lt;/li&gt;
&lt;li&gt;Consider increasing connection timeouts&lt;/li&gt;
&lt;li&gt;Upgrade source server resources if overloaded&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;mysql-schema-changes-causing-failures&quot;&gt;MySQL Schema Changes Causing Failures&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Remember&lt;/strong&gt;: Changes to mysql schema are not replicated and cause replication to stop&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manage user accounts independently&lt;/li&gt;
&lt;li&gt;Skip problematic transaction:&lt;pre&gt;&lt;code class=&quot;language-sql&quot;&gt;SET GLOBAL sql_replica_skip_counter = 1;
START REPLICA;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Better: Avoid mysql schema changes during active replication&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Effective channel management and troubleshooting are crucial for reliable MySQL HeatWave inbound replication. By understanding channel states, recognizing common error codes, and following best practices, you can maintain healthy replication and quickly resolve issues.&lt;/p&gt;
&lt;p&gt;Key takeaways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Monitor channel states&lt;/strong&gt;: ACTIVE, INACTIVE, NEEDS_ATTENTION are key indicators&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check channel details&lt;/strong&gt;: Error messages provide crucial troubleshooting information&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Common errors have common fixes&lt;/strong&gt;: Network (2003), authentication (1045), SSL (3159), binary logs (13114)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use GTID&lt;/strong&gt;: Simplifies management and recovery&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maintain binary log retention&lt;/strong&gt;: Prevent purged log issues&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test thoroughly&lt;/strong&gt;: Validate connectivity and authentication before production&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://coderlegion.com/7603/mysql-heatwave-replication-channels-and-troubleshooting</guid>
<pubDate>Fri, 21 Nov 2025 16:28:02 +0000</pubDate>
</item>
</channel>
</rss>