1 CHANGE_STORAGE_MAP Changes the storage map definition for a relation. You can also change which index Oracle Rdb uses when it stores new records whether records will be stored in a compressed format, and whether data will be reorganized. 2 Format (B)0CHANGE STORAGE MAP map-name qq>qqk lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj mwqqqqqqqqqqq>qqqqqqqqqqwqwqqqqqqqqqqqqqqq>qqqqqqqqqqqqqqwk m> map-storage-clause qj m> change-relation-map-clause qjx lqqqqqqqqqqqqqqqqqqqqqqqqqqq END qqqqqwqqqqqqqq>qqqqqqwqqqqq> STORAGE MAP qqqq> . mq> map-name qqqj 3 map-name The name of the storage map you want to modify. 3 map-storage-clause (B)0map-storage-clause = STORE qw> map-within-clause qqqqqqqqqqqqqqqqqqqqqqqqqqwqk m> USING qw> field-name qw> map-within-clause qj x mqqqqq , qqqqqqqqqqqqqqwqq> m> default-threshold-clause qj Used to define a storage map. This clause lets you specify which storage area files will be used to store rows from the relation: o All rows of a relation can be associated with a single storage area. o Rows of a relation can be randomly distributed among several storage areas. o Rows of a relation can be systematically distributed, or partitioned, among several storage areas by specifying upper limits on the values for a column in a particular storage area. This is called horizontal partitioning. If you omit the storage map definition, the default is to store all the rows for a relation in the main RDB$SYSTEM storage area. 4 map-within-clause (B)0map-within-clause = WITHIN qwq> area-name qwqqqqqqqqqqqqqq>qqqqqqqqqqqqqqqwqk x m> WITH LIMIT OF qw> literal qwj x x mqqqq , qqqqqqqqqqqqqqqqqqwqwqk x mq> FOR qwqwqw> rel-name qwqqqqqqqqqqqqqqqu x x x x x mqqqq , relation-name.field-name qwj x x x x mqqqqqqqqqqqq , qqqqqqqqqqwqqwqqqqqqqqq> x mq> threshold-clause qj x mqqqqqqqqqqqqq ; THRESHOLDS ARE qqqqqqqqqqk lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq> mq> ,val2 qqwqqqqq>qqqqu mq> ,val3 qj Specifies associated threshold values for each storage area with uniform format that is specified in the map-within-clause. By setting threshold values, you can make sure that Oracle Rdb does not overlook a page with sufficient space to store compressed data. The threshold values specify when the page is marked as FULL in the SPAM page free space inventory lists. For example, if you set default values of 70, 85, and 95 percent, ranges of guaranteed free space on each data page are 30, 15, and 5 percent, respectively. If you do not set default values, the values are (0,0,0). With values of (0,0,0), Oracle Rdb will use the record length when setting the SPAM fullness. Oracle Rdb will never store a record on a page at threshold 3. The value you set for the highest threshold can be used to reserve space on the page for future record growth. If you specify a value of 40 for the "val1" parameter, but do not specify values for the "val2" or "val3" parameters, the threshold values will be set at (40,100,100). If you use data compression, you should use logical area thresholds to obtain optimum storage performance. 4 USING_field-name The names of the fields whose values will be used as limits for partitioning the relation across multiple storage areas. Oracle Rdb compares values in the fields to the values in the WITH LIMIT OF clause to determine where to initially store the record. 4 default-threshold-clause (B)0default-threshold-clause = qq> DEFAULT THRESHOLDS ARE qqk lqqqqqqqqqqqqq ( qq> val1 qwqqqqqqqqqqq>qqqqqqqqqqwq> ) qq> mq> ,val2 qqwqqqqq>qqqqu mq> ,val3 qj Specifies associated threshold values for each storage area with uniform format that is NOT specified in the map-within-clause. By setting threshold values, you can make sure that Oracle Rdb does not overlook a page with sufficient space to store compressed data. The threshold values specify when the page is marked as FULL in the SPAM page free space inventory lists. For example, if you set default values of 70, 85, and 95 percent, ranges of guaranteed free space on each data page are 30, 15, and 5 percent, respectively. If you do not set default values, the values are (0,0,0). With values of (0,0,0), Oracle Rdb will use the record length when setting the SPAM fullness. Oracle Rdb will never store a record on a page at threshold 3. The value you set for the highest threshold can be used to reserve space on the page for future record growth. If you specify a value of 40 for the "val1" parameter, but do not specify values for the "val2" or "val3" parameters, the threshold values will be set at (40,100,100). If you use data compression, you should use logical area thresholds to obtain optimum storage performance. 3 change-relation-map-clause (B)0change-relation-map-clause = qqwwq> NO PLACEMENT VIA INDEX qqqqqqqqqqqqqqqwq> xmq> PLACEMENT VIA INDEX qq> index-name qqu twq> DISABLE qqwq> COMPRESSION qqqqqqqqqqqqu xmq> ENABLE qqqj x mqq> REORGANIZE qqqqqwqqqqqq>qqqqwqqqqqqqqqj tq> AREAS qqu mq> PAGES qqj 4 PLACEMENT_VIA_INDEX Indicates that Oracle Rdb should attempt to store a record in a way that optimizes access to that record via the indicated path. Oracle Rdb chooses a target page for any record being stored by rules that take into account the type of index defined (sorted or hashed), the type of storage areas involved (uniform or mixed), and how indexes and relations are assigned to each other. The index named in the PLACEMENT VIA INDEX clause must be defined for the same relation that the storage map is being defined for. 4 NO_PLACEMENT_VIA_INDEX Negates the PLACEMENT VIA INDEX clause, so that subsequent records stored are not stored via the index named in the PLACEMENT VIA INDEX clause. This option is only available on the CHANGE STORAGE MAP statement. If you specify the CHANGE STORAGE MAP statement without the PLACEMENT VIA INDEX option or the NO PLACEMENT VIA INDEX option, the statement executes as if the clause specified on the DEFINE STORAGE MAP statement or last CHANGE STORAGE MAP statement had been used. 4 COMPRESSION_clause Specifies whether data compression will be enabled or disabled for the records when they are stored. ENABLE COMPRESSION is the default. 4 REORGANIZE_clause Causes rows previously stored in specified relations to be moved according to the partitions specified in the CHANGE STORAGE MAP statement. 2 More To change a storage map for a relation with the CHANGE STORAGE MAP statement, you need the Oracle Rdb CHANGE privilege for the relation. If the database is created with the DICTIONARY IS REQUIRED option, you must invoke the database by path name, rather than file name, before you issue this statement. You must specify either a store-clause, a [NO]PLACEMENT VIA INDEX clause, a REORGANIZE clause, or a COMPRESSION clause in a CHANGE STORAGE MAP statement. In the change-relation-map-clause, you can select one or more of the three clauses ([NO]PLACEMENT VIA INDEX clause, REORGANIZE clause, or COMPRESSION clause) in any order, but you cannot repeat a clause. Note that when the REORGANIZE clause is used, records are moved and assigned to new dbkeys. If you omit the store-clause in the CHANGE STORAGE MAP statement, you can create a second index by mistake. You must execute this statement in a read/write transaction. If there is no active transaction and you issue this statement, Oracle Rdb starts a read/write transaction implicitly. Other users are allowed to be attached to the database when you issue the CHANGE STORAGE MAP statement. However, they are not allowed to be using the relation whose map is being changed. 2 Examples Example 1 The following example disables compression for the CANDIDATES_MAP storage map: RDO> CHANGE STORAGE MAP CANDIDATES_MAP cont> DISABLE COMPRESSION cont> END CANDIDATES_MAP STORAGE MAP. Example 2 The following example assigns new limits for storage areas: RDO> CHANGE STORAGE MAP EMPLOYEES_MAP cont> STORE USING EMPLOYEE_ID cont> WITHIN EMPIDS_LOW WITH LIMIT OF "00300"; cont> EMPIDS_MID WITH LIMIT OF "00600"; cont> EMPIDS_OVER cont> END EMPLOYEES_MAP STORAGE MAP. Current data will not be moved according to the new limits. However, when new data is stored, it will be stored according to the new limits in the storage map. Example 3 The following example defines a new storage area EMPIDS_MID2 to handle the employee IDs 600-900, and to reorganize the data from one existing storage area, EMPIDS_OVER. The current data which is stored within the limits of employee IDs 601-900 will be moved according to the new limits. When the new data is stored, it will be stored according to the new limits set in the storage map definition. RDO> CHANGE STORAGE MAP EMPLOYEES_MAP cont> STORE USING EMPLOYEE_ID cont> WITHIN EMPIDS_LOW WITH LIMIT of "00300"; cont> EMPIDS_MID WITH LIMIT OF "00600"; cont> EMPIDS_MID2 WITH LIMIT OF "00900"; cont> EMPIDS_OVER cont> REORGANIZE cont> END EMPLOYEES_MAP STORAGE MAP.