You can also add a series of partitions using dates. As before, you must execute the wgn_partition_tables procedure as the schema owner. The prototype is shown below:
wgn_partition_tables( partition_dates IN WGN_PARTITION_DATES_TAB , db_type IN NUMBER DEFAULT wgn_db_type_CMS , Partition_Options IN NUMBER DEFAULT 0 /* 1 = wgn_opt_Partition_NonPart_Tabs, 2 = wgn_opt_Convert_to_Part, 3 = wgn_opt_Convert_to_NonPart */ , new_tablespace IN VARCHAR2 DEFAULT NULL , new_indextablespace IN VARCHAR2 DEFAULT NULL , pdebug IN BOOLEAN DEFAULT FALSE );
Where:
Is a WGN_PARTITION_DATES_TAB table of partition dates.
Specifies the database that you want to partition:
(Default) Specifies the CMS database tables.
Specifies the data warehouse tables.
Specifies both databases. That is, you want to partition tables in the CMS database and the data warehouse.
Specifies how you want to partition the database:
(Default) Creates partitions only in existing partitioned tables.
Converts all non-partitioned tables to partitioned tables.
Converts existing partitioned tables to partitioned tables based on the new partitioning scheme.
Converts existing partitioned tables to non-partitioned tables.
Important! If the Partition_Options parameter is set to a non-default value, existing tables are copied and replaced with new tables partitioned as specified. The old copies of the tables are renamed BK<x>_<TableName>. This operation creates a complete copy of the data and consumes a significant amount of storage!
Specifies which tablespace to use. (If a custom tablespace is specified, the custom tablespace takes precedence.)
Specifies which tablespace to use for new indexes.
(Optional) Specifies whether a debug trace is produced. It defaults to false.
Examples
This command creates two partitions for CMS tables, with dates 25 June 2011 and 29 June 2011.
SQL> EXEC Wgn_Partition_Util.wgn_partition_tables( partition_dates => WGN_PARTITION_DATES_TAB( WGN_PARTITION_DATE(TO_DATE('25 Jun 2011'), NULL, NULL) , WGN_PARTITION_DATE(TO_DATE('29 Jun 2011'), NULL, NULL) ) , db_type => Wgn_Partition_Util.wgn_db_type_CMS , pdebug => True );
This command uses the Wgn_Partition_Util.get_partition_dates function to return the CMS partition dates. The command then uses these dates to partition the data warehouse using dates that match the CMS partition dates:
SQL> EXEC Wgn_Partition_Util.wgn_partition_tables( partition_dates => Wgn_Partition_Util.get_partition_dates(Wgn_Partition_Util.wgn_db_type_cms) , db_type => Wgn_Partition_Util.wgn_db_type_DW , Partition_Options => Wgn_Partition_Util.wgn_opt_Convert_to_Partitioned , new_tablespace => 'WGNDWTSF' , new_indextablespace => 'WGNDWTSFIDX' pdebug => True );
Copyright © 2014 CA.
All rights reserved.
|
|