Database Reference
In-Depth Information
Bit Strings
Two datatypes are used for storing bit strings: RAW and BLOB . The first supports up to 2,000 bytes. The second should be
used only when bit strings are expected to be larger than 2,000 bytes. From version 11.1 onward, there are two storage
methods for BLOB : basicfile and securefile . For better performance, you should use securefile .
Another bit string datatype is LONG RAW , but it has been deprecated in favor of BLOB . You should no longer use it;
it's provided for backward compatibility only.
Datetimes
The datatypes used to store datetime values are DATE , TIMESTAMP , TIMESTAMP WITH TIME ZONE , and TIMESTAMP WITH
LOCAL TIME ZONE . All of them store the following information: year, month, day, hours, minutes, and seconds. The
length of this part is fixed at 7 bytes. The three datatypes based on TIMESTAMP might also store the fractional part of
seconds (0-9 digits, per default 6). This part is of variable length: 0-4 bytes. Lastly, TIMESTAMP WITH TIME ZONE stores
the time zone in two additional bytes. Since all of them store different information, the best-suited datatype is the one
that takes the minimum amount of space for storing the required data.
Row Migration and Row Chaining
Migrated and chained rows are often confused. In my opinion, this is for two main reasons. First, they share some
characteristics, so it's easy to confuse them. Second, Oracle, in its documentation and in the implementation of its
software, has never been very consistent in distinguishing them. So, before describing how to detect and avoid them,
it's essential to briefly describe the differences between the two.
Migration vs. Chaining
When rows are inserted into a block, the database engine reserves some free space for future updates. You define the
amount of free space reserved for updates by using the PCTFREE parameter. To illustrate, I inserted six rows in the block
depicted in Figure 16-3 . Since the limit set through PCTFREE has been reached, this block is no longer available for inserts.
 
Search WWH ::




Custom Search