Oracle 데이터 Type에 용량좀 알려주세요!~ 0 3 2,649

by 준 [2008.07.11 16:22:05]


데이터형에 따라서 데이터 size가 달라지잖아요!~^^

VARchar2나 varchar같은 경우는 VARchar2(30)하면 30byte 차지하잖아요!!

그런데 NUMBER(11)이면 11byte 차지하는 것 맞나여??

Float(126) 이 4byte가 맞나여??

혼돈되서 질문 드립니다.

by 문동섭 [2008.07.11 16:50:14]
오라클 11g 공식 문서의 내용입니다. 참고하세요.

Internal Numeric Format

Oracle 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 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.

Zero and positive and negative infinity (only generated on import from Version 5 Oracle databases) are stored using unique representations. Zero and negative infinity each require 1 byte; positive infinity requires 2 bytes.

by 채용근 [2008.07.11 16:51:37]

by 준 [2008.07.11 17:00:12]
답변 감사드려요!~^^*
댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입