10g 中的这个信息是存在的,但根本没有暴露给我们。所以你只有几个选择。(在 11g 中,它只在 ALL 视图中,而不是 DBA/USER 视图,除非他们在最近的补丁中添加了它)
dba_source 将拥有它,但这是对 sql 的手动解析以获取它。
您可以创建一个新视图加入到 sys.attribute$ 并提取decode(bitand(properties, 4096), 4096, 'C', 'B')
您可以修改现有的 *type_attr 视图(尽管 Oracle 不支持该视图)。只需decode(bitand(a.properties, 4096), 4096, 'C', 'B')
在视图中添加选择部分(其中“a”是对 sys.attribute$ 的引用)。
新观点的一个例子..
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> create view type_chars
2 as
3 select ta.owner, ta.type_name, ta.attr_name, decode(bitand(a.properties, 4096), 4096, 'C', 'B') char_used
4 from sys.attribute$ a, sys.type$ t, sys.obj$ o, dba_objects ob, dba_type_attrs ta
5 where ta.owner = ob.owner
6 and ta.type_name = ob.object_name
7 and a.toid = t.toid
8 and a.version# = t.version#
9 and t.toid = o.oid$
10 and o.subname is null
11 and ob.object_id = o.obj#
12 and a.name = ta.attr_name;
View created.
SQL> create type mytype as object (a varchar2(20), b number, c varchar2(30 char));
2 /
Type created.
SQL> select * from type_chars where type_name = 'MYTYPE' and owner= user;
OWNER TYPE_NAME ATTR_NAME C
------------------------------ ------------------------------ ------------------------------ -
DTD_TRADE MYTYPE A B
DTD_TRADE MYTYPE B B
DTD_TRADE MYTYPE C C
SQL>