Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What's the meaning of ROWID?

Re: What's the meaning of ROWID?

From: Martin Haltmayer <Martin_Haltmayer_at_KirchGruppe.de>
Date: 1998/03/05
Message-ID: <34FE3E07.1E8E5C9A@KirchGruppe.de>#1/1

Great! Thanks a lot.

Martin Haltmayer

Thomas Kyte wrote:
>
> A copy of this was sent to Martin Haltmayer <Martin_Haltmayer_at_KirchGruppe.de>
> (if that email address didn't require changing)
> On Tue, 03 Mar 1998 14:50:00 +0100, you wrote:
>
> >How can you have twice the same combination of (FILE the row is in, BLOCK within
> >the file the row is in, SLOT in the block the row is in)?
> >
>
> clusters...
>
> SQL> CREATE CLUSTER personnel
> 2 ( department_number NUMBER(2) )
> 3 SIZE 512;
>
> Cluster created.
>
> SQL>
> SQL> create index personnel_idx on cluster personnel;
>
> Index created.
>
> SQL>
> SQL> CREATE TABLE demo_emp
> 2 (empno NUMBER PRIMARY KEY,
> 3 ename VARCHAR2(10) NOT NULL,
> 4 deptno NUMBER(2) NOT NULL )
> 5 CLUSTER personnel (deptno);
>
> Table created.
>
> SQL>
> SQL>
> SQL> CREATE TABLE demo_dept
> 2 (deptno NUMBER(2),
> 3 dname VARCHAR2(9),
> 4 loc VARCHAR2(9))
> 5 CLUSTER personnel (deptno);
>
> Table created.
>
> SQL>
> SQL> insert into demo_dept values ( 10, 'ABC', 'DEF' );
>
> 1 row created.
>
> SQL> insert into demo_emp values ( 1, 'Tom', 10 );
>
> 1 row created.
>
> SQL>
> SQL> select rowid from demo_dept;
>
> ROWID
> ------------------
> 00000233.0000.0006
>
> SQL> select rowid from demo_emp;
>
> ROWID
> ------------------
> 00000233.0000.0006
>
> >Martin Haltmayer
> >
> >Thomas Kyte wrote:
> >>
> >> A copy of this was sent to Jimmy <c6635500_at_comp.polyu.edu.hk>
> >> (if that email address didn't require changing)
> >> On Mon, 02 Mar 1998 12:38:54 -0800, you wrote:
> >>
> >> >Hello all,
> >> >
> >> > Could anyone tells me what is the meaning of rowid? Is rowid unique
> >> >with each record in a table? Is the lastest record with the largest
> >> >rowid in a table?
> >> >
> >> >Thanks,
> >> >Jimmy
> >>
> >> A rowid in Oracle is a physical address of a row. In Oracle7, it is the
> >>
> >> - FILE the row is in
> >> - BLOCK within the file the row is in
> >> - SLOT in the block the row is in
> >>
> >> In Oracle8, the internal format of the rowid is still file/block/slot however
> >> the file# is a relative file number (relative within a tablespace).
> >>
> >> Externally, in Oracle7, you can see the file/block/slot easily in the external
> >> representation of the rowid
> >>
> >> SQL> select rowid from dual;
> >> ROWID
> >> ------------------
> >> 0000033D.0000.0001
> >>
> >> In Oracle8, they added more data to the external representation of the rowid, so
> >> that it is not as 'readable' (but they added the dbms_rowid package to extract
> >> all of the useful information):
> >>
> >> SQL> select rowid from dual;
> >> ROWID
> >> ------------------
> >> AAAACsAABAAAAGiAAA
> >>
> >> A rowid is unique within a table -- and only within a table. The same Oracle7
> >> rowid (believe it or not) can appear within the same database more then once. A
> >> rowid is assigned to a row when it is inserted and stays with that row until it
> >> is deleted (so if you insert a row, remove the row from the DB and then
> >> re-insert it, it will probably get a different rowid the second time).
> >>
> >>
> >> Thomas Kyte
> >> tkyte_at_us.oracle.com
> >> Oracle Government
> >> Herndon VA
> >>
> >> http://govt.us.oracle.com/ -- downloadable utilities
> >>
> >> ----------------------------------------------------------------------------
> >> Opinions are mine and do not necessarily reflect those of Oracle Corporation
> >>
> >> Anti-Anti Spam Msg: if you want an answer emailed to you,
> >> you have to make it easy to get email to you. Any bounced
> >> email will be treated the same way i treat SPAM-- I delete it.
>
>
> Thomas Kyte
> tkyte_at_us.oracle.com
> Oracle Government
> Herndon VA
>
> http://govt.us.oracle.com/ -- downloadable utilities
>
> ----------------------------------------------------------------------------
> Opinions are mine and do not necessarily reflect those of Oracle Corporation
>
> Anti-Anti Spam Msg: if you want an answer emailed to you,
> you have to make it easy to get email to you. Any bounced
> email will be treated the same way i treat SPAM-- I delete it.
Received on Thu Mar 05 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US