EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATION
Previews a move of one collocation between member clusters of a database cluster group for Aurora before you start it.
Description
The preview validates the statement and reports what the move would do, without starting a job. It runs every precheck that the routing layer runs and moves nothing. It reports precheck errors and warnings in its result rather than failing. It reports the following:
-
Validation errors, such as a missing table or an incompatible configuration
-
The count of database and table mappings that the move will update
-
The collocation that the move resolved, on the
Collocationline -
Whether the move turns on the binary log on your behalf
A wrong object name or a missing dependency shows here while the source is still the only copy.
Syntax
EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATIONcollocation_groupFROMsource_member_cluster_aliasTOtarget_member_cluster_alias[move_option[,move_option]]move_option: MANUAL_CUTOVER = { 0 | 1 } | PRESERVE_GRANTS_FOR = ('user' [, ...])
Parameters and options
The parameters and options are the same as for ALTER DBCLUSTERGROUP MOVE COLLOCATION.
Where it runs and required privileges
Run the statement at the routing endpoint, outside a transaction, in a session that isn't pinned. Inside a transaction, the statement returns error 1179. The router user needs dbclustergroup_move_admin or dbclustergroup_super_admin. For the privileges for database cluster groups for Aurora, see Privileges.
Usage notes
Keep the following in mind when you use the statement.
-
Read back the number of table and database mappings the preview reports within the collocation to confirm that it matches your expectation.
-
A move runs a lighter set of checks before it creates the job, and the job runs its own prechecks on the member clusters after that, so a move that passes the preview can still fail on the job. That failure appears in the job's
move_inforow. -
Preview a move of a default collocation, whose name is the member cluster alias, before you start it. That collocation holds every object on the member cluster that you mapped without a collocation, so read the number of table and database mappings that the preview reports.
-
Check that the statement starts with
EXPLAIN. Without it, the same text starts a move.
EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATION returns one row in one column. The column holds a report in the tree format of MySQL EXPLAIN:
mysql> EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATION `collocation_group` FROM `source_member_cluster_alias` TO `target_member_cluster_alias`\G *************************** 1. row *************************** EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATION: Status: Success (1 warning) Collocation:collocation_groupCutover Type: AUTOMATIC Database data mapping updates: 0 Table data mapping updates: 1 Warnings: Binary logging is disabled on the source 'source_member_cluster_alias'; the data-movement job will enable it dynamically for the duration of the move, and will check the binlog filter lists then. Long-running transactions on the source can delay the start of the move. 1 row in set (0.03 sec)
Status reads Success, Success (, or n warnings)ERROR (. n errors, n warnings)Collocation names the collocation that the move resolved. Cutover Type reads AUTOMATIC or MANUAL. The two update lines count the database-level and table-level data mappings of the collocation that the move updates. The Errors: and Warnings: lists appear only when they have entries. If the binary log is off on the source member cluster, a warning tells you that the job turns it on: Binary logging is disabled on the source 'source_member_cluster_alias'; the data-movement job will enable it dynamically for the duration of the move, and will check the binlog filter lists then. Long-running transactions on the source can delay the start of the move.
Examples
The following example previews a move of cg_06 from cluster_b to cluster_c that waits for a manual cutover.
EXPLAIN ALTER DBCLUSTERGROUP MOVE COLLOCATION cg_06 FROM cluster_b TO cluster_c MANUAL_CUTOVER = 1;
Errors
The statement can return the following errors, and the syntax errors of ALTER DBCLUSTERGROUP MOVE COLLOCATION. For all data movement errors, see Data movement errors.
Related statements
For more information, see the following: