Database Reference
In-Depth Information
We only stored six
DEPTNO
values per block now, leaving sufficient room for all of the
EMP
data to be stored on the
same block with their corresponding
DEPT
records.
Here is a bit of puzzle to amaze and astound your friends with. Many people mistakenly believe a rowid uniquely
identifies a row in a database, and that given a rowid you can tell what table the row came from. In fact,
you cannot
.
You can and will get duplicate rowids from a cluster. For example, after executing the preceding code you should find:
EODA@ORA12CR1> select rowid from emp
2 intersect
3 select rowid from dept;
ROWID
------------------
AAAE+/AAEAAABErAAA
AAAE+/AAEAAABErAAB
...
AAAE+/AAGAAAFdvAAE
AAAE+/AAGAAAFdvAAF
36 rows selected.
Every rowid assigned to the rows in
DEPT
has been assigned to the rows in
EMP
as well. That is because it takes a
table
and
row
ID
to uniquely identify a row. The rowid pseudo-column is unique only within a table.
I also find that many people believe the cluster object to be an esoteric object that no one really uses—everyone
just uses normal tables. In fact, you use clusters every time you use Oracle. Much of the data dictionary is stored in
various clusters, for example running the following as
SYS
:
SYS@ORA12CR1> break on cluster_name
SYS@ORA12CR1> select cluster_name, table_name
2 from user_tables
3 where cluster_name is not null
4 order by 1;
CLUSTER_NAME TABLE_NAME
------------------------------ ------------------------------
C_COBJ# CDEF$
CCOL$
C_FILE#_BLOCK# SEG$
UET$
C_MLOG# SLOG$
MLOG$
C_OBJ# LIBRARY$
ASSEMBLY$
ATTRCOL$
TYPE_MISC$
VIEWTRCOL$
OPQTYPE$
ICOL$
IND$
CLU$
TAB$
COL$
LOB$