ALTER DB_DISCOVERY RULE

Description

The ALTER DB_DISCOVERY RULE syntax is used to alter a database discovery rule.

Syntax

  1. AlterDatabaseDiscoveryRule ::=
  2. 'ALTER' 'DB_DISCOVERY' 'RULE' databaseDiscoveryDefinition ( ',' databaseDiscoveryDefinition)*
  3. databaseDiscoveryDefinition ::=
  4. ruleName '(' 'STORAGE_UNITS' '(' storageUnitName ( ',' storageUnitName )* ')' ',' 'TYPE' '(' 'NAME' '=' typeName ( ',' 'PROPERTIES' 'key' '=' 'value' ( ',' 'key' '=' 'value' )* )? ',' 'HEARTBEAT' '(' 'key' '=' 'value' ( ',' 'key' '=' 'value' )* ')' ')'
  5. ruleName ::=
  6. identifier
  7. storageUnitName ::=
  8. identifier
  9. typeName ::=
  10. identifier
  11. discoveryHeartbeatName ::=
  12. identifier

Supplement

  • discoveryType specifies the database discovery service type, ShardingSphere has built-in support for MySQL.MGR;

Example

  • Alter database discovery rule
  1. ALTER DB_DISCOVERY RULE db_discovery_group_0 (
  2. STORAGE_UNITS(su_0, su_1, su_2),
  3. TYPE(NAME='MySQL.MGR',PROPERTIES('group-name'='92504d5b-6dec')),
  4. HEARTBEAT(PROPERTIES('keep-alive-cron'='0/5 * * * * ?'))
  5. );

Reserved word

ALTER, DB_DISCOVERY, RULE, STORAGE_UNITS, TYPE, NAME, PROPERTIES, HEARTBEAT