Hi,
We have a large table in our data warehouse, (2.2TB, over 5 billion records), range-partitioned by month. The table includes a CLOB column. Each month as the partition becomes static it is moved to a separate tablespace and compressed. That tablespace can then be excluded from overnight backups for performance reasons.
We are coming close to running out of storage capacity and would like to archive the older partitions to AWS S3 storage and drop the partitions from the database until more on-prem storage becomes available at which point we want to bring the older data back into the database.
I had thought that having the older partitions in a separate tablespace, including data segments and corresponding LOB segments would mean that the data would be self-contained and the datafiles could simply be archived and retrieved at a later point in time.
However, I have found there is a global LOB index which spans partitions in both tablespaces.
I'm considering moving the older partitions into a separate table, but would welcome any suggestions for a better approach.
Regards,
Stuart.
Hi, This table is range partitioned, not list, here's the DDL, I've omitted most of the columns and partitions for brevity:
CREATE TABLE DWSTGLM.FCT_LM_REQUESTS (
FCT_LM_REQUESTS_KEY NUMBER,
ID VARCHAR2(50 CHAR),
TIMESTAMP TIMESTAMP,
TIMESTAMP_YEAR NUMBER,
TIMESTAMP_MONTH VARCHAR2(4000 CHAR),
TIMESTAMP_DAY DATE,
USER_ID VARCHAR2(4000 CHAR),
~
ASSIGNMENT_ID VARCHAR2(4000 CHAR),
URL CLOB,
USER_AGENT VARCHAR2(4000 CHAR),
~
HTTP_VERSION VARCHAR2(4000 CHAR),
EXTRACT_DATE DATE
)
PARTITION BY RANGE(TIMESTAMP_MONTH)
(PARTITION REQUESTS_MIN
VALUES LESS THAN ('2016-06') TABLESPACE DWSTGLMDATA NOLOGGING,
PARTITION REQUESTS_201606
VALUES LESS THAN ('2016-07') TABLESPACE DWSTGLMDATA NOLOGGING,
PARTITION REQUESTS_201607
VALUES LESS THAN ('2016-08') TABLESPACE DWSTGLMDATA NOLOGGING,
~
VALUES LESS THAN ('2017-06') TABLESPACE DWSTGLMDATA NOLOGGING,
PARTITION REQUESTS_201706
VALUES LESS THAN ('2017-07') TABLESPACE DWSTGLMDATA NOLOGGING,
PARTITION REQUESTS_MAX
VALUES LESS THAN (MAXVALUE) TABLESPACE DWSTGLMDATA NOLOGGING);
select index_name from user_lobs where table_name = 'FCT_LM_REQUESTS';
SYS_IL0007478673C00015$$
select index_name, partitioning_type, locality from user_part_indexes
where index_name = 'SYS_IL0007478673C00015$$';
SYS_IL0007478673C00015$$ RANGE LOCAL
select index_name, partition_name, high_value, tablespace_name from user_ind_partitions where index_name = 'SYS_IL0007478673C00015$$';
SYS_IL0007478673C00015$$ SYS_IL_P52953 '2016-06' DWSTGLMDATA
SYS_IL0007478673C00015$$ SYS_IL_P27543 '2016-07' DWSTGLMDATARO
SYS_IL0007478673C00015$$ SYS_IL_P27544 '2016-08' DWSTGLMDATARO
~
SYS_IL0007478673C00015$$ SYS_IL_P52952 '2021-06' DWSTGLMDATARO
SYS_IL0007478673C00015$$ SYS_IL_P47213 '2021-07' DWSTGLMDATA
~
SYS_IL0007478673C00015$$ SYS_IL_P47219 '2022-01' DWSTGLMDATA
SYS_IL0007478673C00015$$ SYS_IL_P47220 MAXVALUE DWSTGLMDATA
I see that this is a partitioned global index. The partitions from 2016 to May 2021 have been moved to the DWSTGLMDATARO tablespace, along with their corresponding LOB segments, with the min, max and remaining 2021 partitions in DWSTGLMDATA.
The intention was to take the DWSTGLMDATARO tablespace offline and copy the datafiles to S3, then drop the partitions it contains and the tablespace to recover the space.
The reason I'm concerned is that our DBA was looking at whether converting to a transportable tablespace would be a good option, so he ran the check utility which returned:
ORA-39910: Partitioned Global index DWSTGLM.SYS_IL0007478673C00015$$ in tablespace DWSTGLMDATARO points to partition REQUESTS_MIN of table DWSTGLM.FCT_LM_REQUESTS in tablespace DWSTGLMDATA outside of transportable set.
ORA-39921: Default Partition (Table) Tablespace DWSTGLMDATA for FCT_LM_REQUESTS not contained in transportable set.
Regards,
Stuart.