---- PARTITIONS MAP PER ROW IN TABLE ---------------------
WITH parts AS
(SELECT --+ materialize
data_object_id,
subobject_name
FROM dba_objects
WHERE object_name = '<table_name>' )
SELECT subobject_name,
col1
FROM owner.table_name t,
parts
WHERE data_object_id = DBMS_MView.PMarker(t.rowid)
ORDER BY 1;
--------------------------------------------------------
Partition example
.....
PARTITION BY RANGE(cd_d)
subpartition BY RANGE (ig_p)
SUBPARTITION TEMPLATE(
SUBPARTITION d_bal_subp_old VALUES LESS THAN (TO_DATE(' 2007-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2008 VALUES LESS THAN (TO_DATE(' 2008-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2009 VALUES LESS THAN (TO_DATE(' 2009-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2010 VALUES LESS THAN (TO_DATE(' 2010-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2011 VALUES LESS THAN (TO_DATE(' 2011-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2012 VALUES LESS THAN (TO_DATE(' 2012-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2012 VALUES LESS THAN (maxvalue) TABLESPACE D_BAL
(
PARTITION d_bal_part1
VALUES LESS THAN (To_Date('27.12.9085','dd.mm.yyyy'))
TABLESPACE D_BAL,
PARTITION d_bal_part_null
VALUES LESS THAN (maxvalue)
TABLESPACE D_BAL
) ;
WITH parts AS
(SELECT --+ materialize
data_object_id,
subobject_name
FROM dba_objects
WHERE object_name = '<table_name>' )
SELECT subobject_name,
col1
FROM owner.table_name t,
parts
WHERE data_object_id = DBMS_MView.PMarker(t.rowid)
ORDER BY 1;
--------------------------------------------------------
Partition example
.....
PARTITION BY RANGE(cd_d)
subpartition BY RANGE (ig_p)
SUBPARTITION TEMPLATE(
SUBPARTITION d_bal_subp_old VALUES LESS THAN (TO_DATE(' 2007-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2008 VALUES LESS THAN (TO_DATE(' 2008-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2009 VALUES LESS THAN (TO_DATE(' 2009-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2010 VALUES LESS THAN (TO_DATE(' 2010-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2011 VALUES LESS THAN (TO_DATE(' 2011-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2012 VALUES LESS THAN (TO_DATE(' 2012-12-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE D_BAL,
SUBPARTITION d_bal_subp_2012 VALUES LESS THAN (maxvalue) TABLESPACE D_BAL
(
PARTITION d_bal_part1
VALUES LESS THAN (To_Date('27.12.9085','dd.mm.yyyy'))
TABLESPACE D_BAL,
PARTITION d_bal_part_null
VALUES LESS THAN (maxvalue)
TABLESPACE D_BAL
) ;
Komentarze
Prześlij komentarz