UNREGISTER STORAGE UNIT
Description
The UNREGISTER STORAGE UNIT syntax is used to unregister storage units from the current database.
Syntax
UnregisterStorageUnit ::=
'UNREGISTER' 'STORAGE' 'UNIT' ifExists? storageUnitName (',' storageUnitName)* ignoreTables?
ifExists ::=
'IF' 'EXISTS'
storageUnitName ::=
identifier
ignoreTables ::=
'IGNORE' 'SINGLE' 'TABLES' | 'IGNORE' 'BROADCAST' 'TABLES' |
'IGNORE' ('SINGLE' ',' 'BROADCAST' | 'BROADCAST' ',' 'SINGLE') 'TABLES'Supplement
UNREGISTER STORAGE UNITonly removes storage unit registrations from ShardingSphere and does not drop the underlying databases;- Storage units already used by rules can not be unregistered.
Storage unit '%s' still used by '%s'.will be prompted when unregistering storage units used by rules; - When the storage units to be unregistered are only used by single table rules or broadcast rules, and the user confirms that this restriction can be ignored,
IGNORE SINGLE TABLES,IGNORE BROADCAST TABLES,IGNORE SINGLE, BROADCAST TABLES, orIGNORE BROADCAST, SINGLE TABLEScan be added to unregister the storage units; ifExistsclause is used to avoidStorage unit not existserror.
Example
- Unregister a storage unit
UNREGISTER STORAGE UNIT ds_0;- Unregister multiple storage units
UNREGISTER STORAGE UNIT ds_0, ds_1;- Unregister storage unit and ignore single tables
UNREGISTER STORAGE UNIT ds_0 IGNORE SINGLE TABLES;- Unregister storage unit and ignore broadcast tables
UNREGISTER STORAGE UNIT ds_0 IGNORE BROADCAST TABLES;- Unregister storage unit, ignore single and broadcast tables
UNREGISTER STORAGE UNIT ds_0 IGNORE SINGLE, BROADCAST TABLES;- Unregister storage unit, ignore broadcast and single tables
UNREGISTER STORAGE UNIT ds_0 IGNORE BROADCAST, SINGLE TABLES;- Unregister storage unit with
ifExistsclause
UNREGISTER STORAGE UNIT IF EXISTS ds_0;Reserved word
UNREGISTER, STORAGE, UNIT, IF, EXISTS, IGNORE, SINGLE, BROADCAST, TABLES