DDL 复制 - MySQL
了解 MySQL 中的 DDL 复制。
MySQL 中 DDL 复制的限制
-
案例 1:如果启用了 DDL 或
TRACKSCHEMACHANGES,并且该表位于捕获列表中。提取异常终止,出现以下错误:DDL statement "CREATE TABLE AS SELECT" is detected for table '*table-name*' at binary log number '*binlog number*' and offset 'binlog offset'. The DDL operation "CREATE TABLE AS SELECT" is not supported. Execute all 'CREATE TABLE AS SELECT' DDL operations manually to the target database and start Extract by adding Extract parameter TRANLOGOPTIONS WARNCREATEASSELECT. Once Extract gets past the 'CREATE TABLE AS SELECT' operation, restart Extract after disabling the parameter TRANLOGOPTIONS WARNCREATEASSELECT.您需要按照错误消息中的建议执行操作。
在提取参数文件中使用参数
TRANLOGOPTIONS WARNCREATEASSELECT时,如果发现后续的'CREATE TABLE AS SELECT'操作,提取将在提取报表中发出以下警告消息后继续。"DDL statement 'CREATE TABLE AS SELECT' is detected for table '*table-name*' at binary log number '*binlog number*' and offset '*binlog offset*'. The DDL operation 'CREATE TABLE AS SELECT' is not supported. The DDL and the associated DMLs are ignored." -
案例 2:当禁用 DDL 复制或
TRACKSCHEMACHANGES且该表位于“提取”列表中时。When both DDL replication / TRACKSCHEMACHANGES are not enabled in the capture, the DDL and associated DML operations with CREATE TABLE AS SELECT are ignored. User needs to issue the same "CREATE TABLE AS SELECT" in the target as it was issued in the source.
注:有关详细信息,请参阅《 Parameters and Functions Reference for Oracle GoldenGate 》中的 TRANLOGOPTIONS WARNCREATEASSELECT。