Home » RDBMS Server » Server Administration » Column data in Oracle block
Column data in Oracle block [message #173387] Mon, 22 May 2006 04:37 Go to next message
gajini
Messages: 262
Registered: January 2006
Senior Member
Consider a table having 3 columns,namely EMP(c1,c2,c3)

Using data block header,Oracle identifies that a block containing rows
for EMP table.My doubt in this is,

In the row data of a block,how oracle identifies that this piece of data belong to a particular column(i.e.,column data) of EMP table i.e,how it identifies this portion of data belongs to C1,C2 & C3? Is oracle following any offset mechanism for this classification?Please suggest your answers
& views on this question.
Re: Column data in Oracle block [message #173400 is a reply to message #173387] Mon, 22 May 2006 05:31 Go to previous message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Column offsets are stored in the data dictionary (SYS.COL$). The positions of fixed length types can easily be determined. Variable length types like VARCHAR2 are length prefixed.

SQL> SELECT col#, name, type#, length
  2    FROM col$
  3   WHERE obj# = (SELECT obj#
  4                   FROM obj$
  5                  WHERE name = 'EMP'
  6                    AND owner# = (SELECT user#
  7                                    FROM user$
  8                                   where name = 'SCOTT'))
  9  /

      COL# NAME                                TYPE#     LENGTH
---------- ------------------------------ ---------- ----------
         1 EMPNO                                   2         22
         2 ENAME                                   1         10
         3 JOB                                     1          9
         4 MGR                                     2         22
         5 HIREDATE                               12          7
         6 SAL                                     2         22
         7 COMM                                    2         22
         8 DEPTNO                                  2         22

8 rows selected.
Previous Topic: SYSTEM User droped
Next Topic: Is taking off and taking on the table partitioned data that simple?
Goto Forum:
  


Current Time: Fri Sep 20 11:45:36 CDT 2024