MySQL: DDLレプリケーション
MySQLでのDDLレプリケーションについて学習します。
MySQLでのDDLレプリケーションの制限
-
ケース1: DDLまたは
TRACKSCHEMACHANGES
が有効で、表が取得リストにある場合。Extractは次のエラーで異常終了します: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.エラー・メッセージに示されているように対処する必要があります。
Extractのパラメータ・ファイルでTRANLOGOPTIONS WARNCREATEASSELECT
パラメータを使用し、後続の'CREATE TABLE AS SELECT'
操作が見つかった場合、Extractレポートに次の警告メッセージが発行され、Extractは処理を続行します。"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
が無効になっており、表がExtractリストにある場合。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.
-
ケース3:表が取得リストにない場合、DDLまたは
TRACKSCHEMACHANGES
が有効かどうかに関係なく、すべての表操作が無視されます。