Wednesday, 24 August 2016

DataTypes


select db_block_size from v$parameter;


Number DataType

Oracle Database stores numeric data in variable-length format.Each value is stored in scientific notation, with 1 byte used to store the exponent and up to 20 bytes to store the mantissa.The resulting value is limited to 38 digits of precision. Oracle Database does not store leading and trailing zeros. For example, the number 412 is stored in a format similar to 4.12 x 102, with 1 byte used to store the exponent(2) and 2 bytes used to store the three significant digits of the mantissa(4,1,2). Negative numbers include the sign in their length.
Taking this into account, the column size in bytes for a particular numeric data value NUMBER(p), where p is the precision of a given value, can be calculated using the following formula:
ROUND((length(p)+s)/2))+1
where s equals zero if the number is positive, and s equals 1 if the number is negative.
Date & Time DataType
Oracle Database uses its own internal format to store dates. Date data is stored in fixed-length fields of 7 bytes each, corresponding to century(BC / AD), year, month, day, hour, minute, and second.
Date - 7 Bytes
Timestamp(upto 6 presion) - 7 to 11 Bytes,    24-AUG-2016 08:14:38.321983 PM 
Timestamp with Time Zone - 13 bytes
Timestamp with Local Time - 11 Bytes