在SQL * Plus中描述 - 它是调用包还是运行SQL? (或者是其他东西?)

时间:2011-10-14 08:45:30

标签: oracle sqlplus

当我在SQL * Plus中描述Oracle TYPE时,SQL * Plus在“引擎盖下”做了什么“ - 它是否调用DBMS_METADATA(或类似的)?还是直接查询数据字典?

还是别的什么呢?

1 个答案:

答案 0 :(得分:3)

显然,您可以使用alter session set sql_trace=true来回答此类问题。

对于

create type desc_type as object (
 dummy varchar2(1),

 constructor function desc_type (a number) return self as result,

 final member procedure m 

);
/

alter session set sql_trace=true;

desc desc_type

alter session set sql_trace=false;

drop type desc_type
/

我在跟踪文件中找到以下相关的SQL语句:

select procedure#,procedurename,properties,itypeobj# 
  from procedureinfo$ where obj#=:1 
 order by procedurename desc, overload# desc

select position#,
       sequence#,
       level#,
       argument,
       type#,
       charsetid,
       charsetform,
       properties,
       nvl(length, 0),
       nvl(precision#, 0),
       nvl(scale, 0),
       nvl(radix, 0),
       type_owner,
       type_name,
       type_subname,
       type_linkname,
       pls_type 
  from argument$ 
 where obj#=:1 and procedure#=:2 order by sequence# desc

select max(procedure#) from procedurec$ where obj#=:1

select max(procedure#) from procedureplsql$ where obj#=:1

select max(procedure#) from procedurejava$ where obj#=:1

select procedure#,entrypoint# from procedurec$ 
 where obj#=:1 order by procedure#

select procedure#,entrypoint# 
 from procedureplsql$ where obj#=:1 order by procedure#

select procedure#,ownerlength,classlength,methodlength,siglength, flagslength,cookiesize 
  from procedurejava$ where obj#=:1 order by procedure#

select ownername,classname,methodname,signature,flags 
  from procedurejava$ where obj#=:1 and procedure#=:2 order by procedure#

select count(*) 
  from vtable$ where obj#=:1

select vindex,itypetoid,imethod#,iflags,itypeowner,itypename 
  from vtable$ where obj#=:1 order by vindex

select externtype, externname 
  from type$ where tvoid=:1

因此,在引擎盖下,SQL * Plus使用纯SQL。