SELECT PARTITION
NAME, TABLE
NAME FROM information
schema.partitions WHERE TABLE
SCHEMA = 'your
database
name';
Replace `yourdatabasename` with the name of your database.
SELECT TABLE
NAME, COLUMN
NAME, CONSTRAINT
NAME, REFERENCED
TABLE
NAME, REFERENCED
COLUMN_NAME
FROM informationschema.KEY
COLUMN_USAGE
WHERE REFERENCEDTABLE
SCHEMA = 'your
database
name';
SHOW ENGINE INNODB STATUS;
Look under the `TRANSACTIONS` section for transactions that might be using the partition.
SET FOREIGN
KEY
CHECKS=0;
-- Your DROP PARTITION command here
SET FOREIGNKEY
CHECKS=1;
Be sure to replace `-- Your DROP PARTITION command here` with your actual `DROP PARTITION` command.
ALTER TABLE your
table
name DROP PARTITION partition_name;
Replace `yourtablename` with the name of your table and `partition_name` with the name of the partition you wish to drop.
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo