oracle 数据字典中的表相关信息
象空间分配和数据库用户等等有关数据库的信息。
数据字典表(Data Dictionary Table) 用以存储表、索引、约束及其他数据结构信息。这些对象通常以$结尾(如tab$、obj$、ts$)
在创建数据库的时候通过运行sql.bsq脚本来创建,这个文件包含了每个数据字典表的定义及注释说明。该文件在$ORCLE_HOME/rdbms/admin目录下,通过这些内容可以深入了解数据库的对象信息。
如之前我们看到的数据库启动时创建的bootstrap$表
又比如undo表
可以通过查看这些文件获取到各个字段的注释信息,这样就了解这些字段的意义。
这里找到了一个通过obj的id找到一个对像名称与类型编号,所属用户编号。
SQL> select o.NAME,o.TYPE#,o.OBJ#,o.OWNER# from OBJ$ o WHERE o.obj# = 108787;
NAME TYPE# OBJ# OWNER#
--------------- ---------- ---------- ----------
SIM_KQJF 2 108787 99
现在想知道这个对象的类型与用户。
SQL> select u.USER#,u.NAME from user$ u where u.USER#='99';
USER# NAME
---------- ---------------
99 NEDC
通过查询user$表中的信息得到了用户名称 。
但是对象类型却看不出来。通过检查sql.bsq内容,知道了,运行的bsq文件,搜索 create table obj$ 后,
得知dcore.bsq文档中有相关建表说明。最后根据TYPE#=2 信息得知,2 = TABLE 明显是一个普通表。
create table obj$ /* object table */
( obj# number not null, /* object number */
dataobj# number, /* data layer object number */
owner# number not null, /* owner user number */
name varchar2("M_IDEN") not null, /* object name */
namespace number not null, /* namespace of object (see KQD.H): */
/* 1 = TABLE/PROCEDURE/TYPE, 2 = BODY, 3 = TRIGGER, 4 = INDEX, 5 = CLUSTER, */
/* 8 = LOB, 9 = DIRECTORY, */
/* 10 = QUEUE, 11 = REPLICATION OBJECT GROUP, 12 = REPLICATION PROPAGATOR, */
/* 13 = JAVA SOURCE, 14 = JAVA RESOURCE */
/* 58 = (Data Mining) MODEL */
subname varchar2("M_IDEN"), /* subordinate to the name */
type# number not null, /* object type (see KQD.H): */
/* 1 = INDEX, 2 = TABLE, 3 = CLUSTER, 4 = VIEW, 5 = SYNONYM, 6 = SEQUENCE, */
/* 7 = PROCEDURE, 8 = FUNCTION, 9 = PACKAGE, 10 = NON-EXISTENT, */
/* 11 = PACKAGE BODY, 12 = TRIGGER, 13 = TYPE, 14 = TYPE BODY, */
/* 19 = TABLE PARTITION, 20 = INDEX PARTITION, 21 = LOB, 22 = LIBRARY, */
/* 23 = DIRECTORY , 24 = QUEUE, */
/* 25 = IOT, 26 = REPLICATION OBJECT GROUP, 27 = REPLICATION PROPAGATOR, */
/* 28 = JAVA SOURCE, 29 = JAVA CLASS, 30 = JAVA RESOURCE, 31 = JAVA JAR, */
/* 32 = INDEXTYPE, 33 = OPERATOR , 34 = TABLE SUBPARTITION, */
/* 35 = INDEX SUBPARTITION */
/* 82 = (Data Mining) MODEL */
/* 92 = OLAP CUBE DIMENSION, 93 = OLAP CUBE */
/* 94 = OLAP MEASURE FOLDER, 95 = OLAP CUBE BUILD PROCESS */
ctime date not null, /* object creation time */
mtime date not null, /* DDL modification time */
stime date not null, /* specification timestamp (version) */
status number not null, /* status of object (see KQD.H): */
/* 1 = VALID/AUTHORIZED WITHOUT ERRORS, */
/* 2 = VALID/AUTHORIZED WITH AUTHORIZATION ERRORS, */
/* 3 = VALID/AUTHORIZED WITH COMPILATION ERRORS, */
/* 4 = VALID/UNAUTHORIZED, 5 = INVALID/UNAUTHORIZED */
remoteowner varchar2("M_IDEN"), /* remote owner name (remote object) */
linkname varchar2("M_XDBI"), /* link name (remote object) */
flags number, /* 0x01 = extent map checking required */
/* 0x02 = temporary object */
/* 0x04 = system generated object */
/* 0x08 = unbound (invoker's rights) */
/* 0x10 = secondary object */
/* 0x20 = in-memory temp table */
/* 0x80 = dropped table (RecycleBin) */
/* 0x100 = synonym VPD policies */
/* 0x200 = synonym VPD groups */
/* 0x400 = synonym VPD context */
/* 0x4000 = nested table partition */
oid$ raw(16), /* OID for typed table, typed view, and type */
spare1 number, /* sql version flag: see kpul.h */
spare2 number, /* object version number */
spare3 number, /* base user# */
spare4 varchar2(1000),
spare5 varchar2(1000),
spare6 date
)
storage (initial 10k next 100k maxextents unlimited pctincrease 0)
/
目录 返回
首页