1. 查詢所有的分割槽表
SELECT * FROM DBA_TAB_PARTITIONS ;
2. 建立分割槽
alter table {TABLE_NAME} add partition SYS_P202403 values less than (TO_DATE('2024-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202404 values less than (TO_DATE('2024-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202405 values less than (TO_DATE('2024-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202406 values less than (TO_DATE('2024-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202407 values less than (TO_DATE('2024-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202408 values less than (TO_DATE('2024-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202409 values less than (TO_DATE('2024-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202410 values less than (TO_DATE('2024-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202411 values less than (TO_DATE('2024-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), partition SYS_P202412 values less than (TO_DATE('2024-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'));