33 lines
822 B
MySQL
33 lines
822 B
MySQL
|
USE [DB_GRAND_HOTEL];
|
|||
|
GO
|
|||
|
|
|||
|
-- rajouter une partition :
|
|||
|
-- 1) cr<63>er le stockage
|
|||
|
ALTER DATABASE [DB_GRAND_HOTEL]
|
|||
|
ADD FILEGROUP FG_PART_2009;
|
|||
|
ALTER DATABASE [DB_GRAND_HOTEL]
|
|||
|
ADD FILE (NAME = 'F_PART_2009',
|
|||
|
FILENAME = 'H:\DATABASE_SQL\SQL2019FBIN2\DATA\HOTEL_PART_2009.ndf',
|
|||
|
SIZE = 25,
|
|||
|
FILEGROWTH = 10)
|
|||
|
TO FILEGROUP FG_PART_2009;
|
|||
|
|
|||
|
-- 2) modifier le schema de paritionnement
|
|||
|
ALTER PARTITION SCHEME PS_DATE_FACTURE
|
|||
|
NEXT USED FG_PART_2009;
|
|||
|
GO
|
|||
|
|
|||
|
-- 3) ajouter le "piquet" de partitionnement
|
|||
|
ALTER PARTITION FUNCTION PF_DATE_FACTURE()
|
|||
|
SPLIT RANGE ('2009-01-01');
|
|||
|
|
|||
|
-- autres possibilit<69>s
|
|||
|
-- XXX) r<>aranger les partitions => ALTER PARTITION FUNCTION ... MERGE
|
|||
|
|
|||
|
-- XXX) supprimer les donn<6E>es de certainers partitions => TRUNCATE PARTITION
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|