Oracle ROWID与RDBA
1.1 Rowid的意义
1. Rowid就是用来标记表中每一行的行地址的,分为逻辑rowid,物理rowid和外部rowid,一般索引组织表的行地址使用逻辑rowid,堆组织表、 表簇、表分区、和索引分区的行地址使用物理rowid。外部rowid则是用来标识外来表(非oracle数据库的表)的行。
3. Oracle 数据库在内部使用 rowids用于构造索引,最常见的 B 树索引,包含一个被划分成多个键范围的排序列表。索引键值(就是叶子节点)中存储了表每条记录的rowid,通过索引查找实际就是通过索引,找到记录的rowid,从而定位到表中的rowid代表的行。
所以,Rowid存在的意义:
Rowidsare the fastest means of accessing particular rows. –加快访问
Rowidsprovide the ability to see how a table is organized. –提供研究表组织方式的途径
Rowidsare unique identifiers for rows in a given table. –rowid是表中每一行的唯一标识符
1.2 Rowid也是一种数据类型
HR >alter table test addrowid_1 rowid; ---增加一列可rowid的行
Table altered.
HR >insert into testvalues(sysdate-2,'AAAXR0AAdAAAAHdAAA');---插入要按照rowid规则,否则无效
1 row created.
HR >select t.*,t.