设为首页 加入收藏

TOP

SYNONYMS(十)
2015-11-21 01:33:20 来源: 作者: 【 】 浏览:2
Tags:SYNONYMS
cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse &nbs

通过格式化后,看的是不是很清楚!
发现v$version的内容来自真实表x$version
SQL> select * from dba_synonyms where synonym_name='V$VERSION';
OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
------------------------------ ------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------------------------------------------------------
PUBLIC V$VERSION SYS V_$VERSION

而v$version是v_$version的公有同义词
SQL> select text from dba_views where view_name='V_$VERSION';

TEXT
--------------------------------------------------------------------------------
select "BANNER" from v$version
v_$version是视图
那么v_$version和x$version是什么关系呢?下面通过sql_trace来跟踪:
QL> alter session set sql_trace=true;


会话已更改。


SQL> select * from v_$version;


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production


SQL> alter session set sql_trace=false;

下面是摘自trace文件:
Trace file /u01/app/oracle/diag/rdbms/orcl3939/orcl3939/trace/orcl3939_ora_10586.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: localhost.localdomain
Release: 2.6.18-194.el5
Version: #1 SMP Mon Mar 29 20:06:41 EDT 2010
Machine: i686
Instance name: orcl3939
Redo thread mounted by this instance: 1
Oracle process number: 19
Unix process pid: 10586, image: oracle@localhost.localdomain (TNS V1-V3)




*** 2015-06-05 20:43:31.754
*** SESSION ID:(191.5) 2015-06-05 20:43:31.754
*** CLIENT ID:() 2015-06-05 20:43:31.754
*** SERVICE NAME:(SYS$USERS) 2015-06-05 20:43:31.754
*** MODULE NAME:(sqlplus@localhost.localdomain (TNS V1-V3)) 2015-06-05 20:43:31.754
*** ACTION NAME:() 2015-06-05 20:43:31.754

=====================
PARSING IN CURSOR #3 len=32 dep=0 uid=0 oct=42 lid=0 tim=1433508211754004 hv=1569151342 ad='3ffed0' sqlid='4tk6t8tfsfqbf'
alter session set sql_trace=true
END OF STMT
EXEC #3:c=0,e=122,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=0,tim=1433508211753998
=====================
PARSING IN CURSOR #4 len=52 dep=0 uid=0 oct=47 lid=0 tim=1433508211754638 hv=1029988163 ad='322727f0' sqlid='9babjv8yq8ru3'
BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;
END OF STMT
PARSE #4:c=0,e=15,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=1433508211754637
EXEC #4:c=0,e=132,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=0,tim=1433508211754829


*** 2015-06-05 20:43:42.545
CLOSE #3:c=0,e=6,dep=0,type=0,tim=1433508222545170
CLOSE #4:c=0,e=16,dep=0,type=3,tim=1433508222545254
=====================
PARSING IN CURSOR #4 len=37 dep=1 uid=0 oct=3 lid=0 tim=1433508222546045 hv=1398610540 ad='38d9993c' sqlid='grwydz59pu6mc'
select text from view$ where rowid=:1
END OF STMT
PARSE #4:c=0,e=36,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,plh=3684871272
首页 上一页 7 8 9 10 下一页 尾页 10/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇study of oracle lesson one 下一篇Datazen安装

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: