﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-kxbin-文章分类-ORACLE</title><link>http://www.blogjava.net/kxbin/category/49610.html</link><description>成功留给有准备的人</description><language>zh-cn</language><lastBuildDate>Wed, 17 Apr 2013 08:35:34 GMT</lastBuildDate><pubDate>Wed, 17 Apr 2013 08:35:34 GMT</pubDate><ttl>60</ttl><item><title>win7 64位系统 pl sql 无法解析指定的连接标识符 解决办法</title><link>http://www.blogjava.net/kxbin/articles/397925.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 16 Apr 2013 08:25:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/397925.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/397925.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/397925.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/397925.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/397925.html</trackback:ping><description><![CDATA[<p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">系统是win764位，装好后，装了pl/sql 和toad，都连不上数据库，报错位&#8220;ql 无法解析指定的连接标识符&#8221; 解决办法，我勒个去！神马情况吗！很是郁闷，经过研究发现安装目录有问题。默认会安装在&#8220;C:\Program Files (x86)&#8221;这个目录下，，以前有空格也没问题，起初没在意，后来经过研究发现，确实是目录的问题，括号让pl/sql不爽了。于是乎，pl/sql让我也不爽了！。。</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">记录下，解决了，现在很爽。。</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">&nbsp;</p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #ffffff;">PS：如果遇到此问题，不用重装pl/sql，只需将其移动（最好copy）到其他没有空格，没有特殊字符的目录下就ok了！</p><img src ="http://www.blogjava.net/kxbin/aggbug/397925.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2013-04-16 16:25 <a href="http://www.blogjava.net/kxbin/articles/397925.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle SQL语句执行步骤</title><link>http://www.blogjava.net/kxbin/articles/388764.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Fri, 28 Sep 2012 03:28:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388764.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388764.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388764.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388764.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388764.html</trackback:ping><description><![CDATA[<p align="center" style="margin-top:15.0pt;margin-right:0cm; margin-bottom:15.0pt;margin-left:0cm;text-align:center;background:#FBFBF7"><strong><span style="font-size: 16.5pt;line-height:150%;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;">oracle SQL</span></strong><strong><span style="font-size: 16.5pt;line-height:150%;font-family:宋体;">语句执行步骤</span></strong><strong></strong></p>  <p align="left" style="line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style="line-height:200%;font-family:宋体;color:#333333;">Oracle</span><span style="line-height:200%;font-family:宋体;color:#333333;">中SQL语句执行过程中,Oracle内部解析原理如下: </span></p>  <p align="left" style="margin-bottom: 11.25pt; text-indent: 21pt; line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style=" line-height:200%;font-family:宋体;color:#333333;">　　1、当一用户第一次提交一个SQL表达式时,Oracle会将这SQL进行Hard parse,这过程有点像程序编译,检查语法、表名、字段名等相关信息（如下图），这过程会花比较长的时间，因为它要分析语句的语法与语义。然后获得最优化后的执行计划（sql plan），并在内存中分配一定的空间保存该语句与对应的执行计划等信息。</span></p>  <p align="left" style="margin-bottom: 11.25pt; text-indent: 21pt; line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style=" line-height:200%;font-family:宋体;color:#333333;">　　2、当用户第二次请求或多次请求时，Oracle会自动找到先前的语句与执行计划，而不会进行Hard parse,而是直接进行Soft parse（把语句对应的执行计划调出，然后执行）,从而减少数据库的分析时间。</span></p>  <p align="left" style="margin-bottom: 11.25pt; text-indent: 21pt; line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style=" line-height:200%;font-family:宋体;color:#333333;">　　注意的是：Oracle中只能完全相同的语句，包大小写、空格、换行都要求一样时，才会重复使用以前的分析结果与执行计划。</span></p>  <p align="left" style="margin-bottom: 11.25pt; text-indent: 21pt; line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style=" line-height:200%;font-family:宋体;color:#333333;">　　分析过程如下图：</span></p>  <p align="center" style="margin-bottom: 11.25pt;margin-left:0cm;text-align:center;text-indent:-7.05pt;line-height:200%;background:#FBFBF7"> </p>  <p align="center" style="text-align:center;line-height:200%;background:#FBFBF7"><img src="http://www.blogjava.net/images/blogjava_net/kxbin/无标题.jpg" width="554" height="382" alt="" /><br /></p>  <p align="left" style="margin-bottom: 11.25pt; text-indent: 21pt; line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style=" line-height:200%;font-family:宋体;color:#333333;">　　对于大量的、频繁访问的SQL语句，如果不采用Bind 变量的方式，哪Oracle会花费大量的Shared latch与CPU在做Hard parse处理，所以，要尽量提高语句的重用率，减少语句的分析时间，通过了解Oracle SQL语句的分析过程可以明白Oracle的内部处理逻辑，并在设计与实现上避免。</span></p>  <p align="left" style="margin-bottom: 11.25pt; text-indent: 21pt; line-height: 200%; background-color: #fbfbf7; background-position: initial initial; background-repeat: initial initial; "><span style=" line-height:200%;font-family:宋体;color:#333333;">　　在用JDBC或其它持久化数据(如Hibernate,JDO等)操作时，尽量用占位符（？）</span></p>  <p>&nbsp;&nbsp;</p>  <p><span style="font-size:12.0pt;line-height:150%; font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">ORACLE sql </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">的处理过程大致如下：</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp;1.</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">运用</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">HASH</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">算法，得到一个</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">HASH</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">值，这个值可以通过</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">V$SQLAREA.HASH_VALUE </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">查看</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444"><br /> &nbsp;2.</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">到</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">shared pool </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">中的</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"> library cache </span><span style="font-size:12.0pt;line-height: 150%;font-family:宋体;color:#444444">中查找是否有相同的</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">HASH</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">值，如果存在，则无需硬解析，进行软解析</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp;3.</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">如果</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">shared pool</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">不存在此</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">HASH</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">值，则进行语法检查，查看是否有语法错误</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp;4.</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">如果没有语法错误，就进行语义检查，检查该</span><span style="font-size: 12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">引用的对象是否存在，该用户是否具有访问该对象的权限</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp;5.</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">如果没有语义错误，对该</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">进行解析，生成解析树，执行计划</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp;6.</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">生成</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">ORACLE</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">能运行的二进制代码，运行该代码并且返回结果给用户</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">硬解析和软解析都在第</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">5</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">步进行</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">硬解析通常是昂贵的操作，大约占整个</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">执行的</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">70%</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">左右的时间，硬解析会生成执行树，执行计划，等等。</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">当再次执行同一条</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">语句的时候，由于发现</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">library cache</span><span style="font-size:12.0pt;line-height: 150%;font-family:宋体;color:#444444">中有相同的</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">HASH</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">值，这个时候不会硬解析，而会软解析，</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">那么软解析究竟是干了什么呢</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">?</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">其实软解析就是跳过了生成解析树，生成执行计划这个耗时又耗</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">CPU</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">的操作，直接利用生成的执行计划运行</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">该</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">语句。</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体; color:#444444">下面摘抄</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">eygle</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">深入解析</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">ORACLE </span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">中关于</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">执行过程的描述</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp; 1.</span><span style="font-size:12.0pt;line-height:150%;font-family: 宋体; color:#444444">首先获得</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">library cache latch,</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">根据</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">的</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">HASH_VALUE</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">在</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">library cache</span><span style="font-size:12.0pt;line-height: 150%;font-family:宋体;color:#444444">中查找是否存在此</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">HASH_VALUE</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">，如果找到这个</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">HASH_VALUE</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">，称之为软解析，</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">Server</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">获得改</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">执行计划转向第</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">4</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">步，如果找不到共享代码就进行硬解析。</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp;&nbsp;2.</span><span style="font-size:12.0pt;line-height:150%;font-family: 宋体; color:#444444">释放</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">library pool cache,</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">获得</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">shared pool latch,</span><span style="font-size:12.0pt; line-height:150%;font-family:宋体;color:#444444">查找并锁定自由空间</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">(</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">在</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">bucket </span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">中查找</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">chunk)</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">。如果找不到，报</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">ORA-04031</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">错误</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp; 3.</span><span style="font-size:12.0pt;line-height:150%;font-family: 宋体; color:#444444">释放</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">shared pool latch,</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">重新获得</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">library cache latch,</span><span style="font-size:12.0pt; line-height:150%;font-family:宋体;color:#444444">将</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">SQL</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">执行计划放入</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">library cache</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">中。</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444"><br /> &nbsp; 4.</span><span style="font-size:12.0pt;line-height:150%;font-family: 宋体; color:#444444">释放</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">library cache latch,</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">保持</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">null</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">模式的</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">library cache pin/lock.<br /> &nbsp;&nbsp;5.</span><span style="font-size:12.0pt;line-height:150%;font-family: 宋体; color:#444444">开始执行。</span><span style="font-size:12.0pt;line-height: 150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444"><br /> Library cache latch</span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">可以理解为硬</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">/</span><span style="font-size:12.0pt;line-height:150%;font-family:宋体;color:#444444">软解析的时候发生的，因为解析的时候会搜索</span><span style="font-size:12.0pt;line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;; color:#444444">library cache</span><span style="font-size:12.0pt;line-height: 150%;font-family:宋体;color:#444444">，所以会产生</span><span style="font-size:12.0pt; line-height:150%;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:#444444">library cache latch<br /> Library cache pin </span><span style="font-size:12.0pt;line-height:150%; font-family:宋体;color:#444444">是在执行的阶段发生的。</span></p><img src ="http://www.blogjava.net/kxbin/aggbug/388764.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-28 11:28 <a href="http://www.blogjava.net/kxbin/articles/388764.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux oracle10g安装</title><link>http://www.blogjava.net/kxbin/articles/388272.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Fri, 21 Sep 2012 08:49:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388272.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388272.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388272.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388272.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388272.html</trackback:ping><description><![CDATA[<div style="margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><strong style="padding: 0px; margin: 0px; ">一、安装系统</strong></div><blockquote style="padding: 0px; margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><div style="margin: 0px; ">首先安装Linux系统，根据Oracle官方文档的建议，在机器内存小于1G的情况下，swap分区大小应该设置为内存的2倍大，若内存大于2G则swap分区设置为与内存大小一样。</div></blockquote><blockquote style="padding: 0px; margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><div style="margin: 0px; ">为防止Oracle安装过程中出现乱码，建议使用英文作为系统语言，进行Oracle的安装工作</div></blockquote><div style="margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><strong style="padding: 0px; margin: 0px; ">二、安装Oracle前的系统准备工作</strong></div><blockquote style="padding: 0px; margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">1.检查需要的软件包</strong></div><div style="margin: 0px; ">可以使用rpm -qa|grep 软件包关键词命令进行检测，一般情况下会需要手动安装如下的软件包：</div><div style="margin: 0px; ">&nbsp; From RedHat AS5 Disk 1（32 Bit）</div><div style="margin: 0px; ">&nbsp; # rpm -Uvh setarch-2*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh make-3*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh glibc-2*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh libaio-0*</div><div style="margin: 0px; ">&nbsp; From RedHat AS5 Disk 2（32 Bit）</div><div style="margin: 0px; ">&nbsp; # rpm -Uvh compat-libstdc -33-3*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh compat-gcc-34-3*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh compat-gcc-34-c -3*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh gcc-4*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh libXp-1*</div><div style="margin: 0px; ">&nbsp; From RedHat AS5 Disk 3（32 Bit）</div><div style="margin: 0px; ">&nbsp; # rpm -Uvh openmotif-2*&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp; # rpm -Uvh compat-db-4*</div><div style="margin: 0px; ">如果使用DVD安装介质的话，会很方便。</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">2.修改Linux发行版本信息</strong></div><div style="margin: 0px; ">由于Oracle 10g发行的时候，RedHat Enterprise Linux 5没有发行，所以Oracle 10g并没有对RedHat Enterprise Linux 5确认支持，我们有两种方法可以让Oracle 10g支持RedHat Enterprise Linux 5。</div><div style="margin: 0px; "><em style="padding: 0px; margin: 0px; font-style: normal; "><strong style="padding: 0px; margin: 0px; ">方法一：</strong></em></div><div style="margin: 0px; ">我们需要手工修改Linux的发行注记，让Oracle 10g支持RedHat Enterprise Linux 5。</div><div style="margin: 0px; ">编辑/etc/redhat-release文件</div><div style="margin: 0px; "># vi /etc/redhat-release</div><div style="margin: 0px; ">将其中的内容Red Hat Enterprise Linux Server release 5 (Tikanga)修改为Red Hat Enterprise Linux AS release 4 (Nahant Update 4)</div><div style="margin: 0px; "><em style="padding: 0px; margin: 0px; font-style: normal; "><strong style="padding: 0px; margin: 0px; ">方法二：</strong></em></div><div style="margin: 0px; ">还有文章说修改Oracle安装包中install/oraparam.ini文件的内容，也可以让Oracle 10g支持RedHat Enterprise Linux 5，修改方法如下：</div><div style="margin: 0px; "># vi install/oraparam.ini</div><div style="margin: 0px; ">在其中的Certified Versions段落增加redhat-5</div><div style="margin: 0px; ">#[Certified Versions]&nbsp;<br style="padding: 0px; margin: 0px; " />Linux=redhat-3,SuSE-9,redhat-4,redhat-5,UnitedLinux-1.0,asianux-1,asianux-2]</div><div style="margin: 0px; ">再添加&nbsp;<br style="padding: 0px; margin: 0px; " />[Linux-redhat-5.0-optional]&nbsp;<br style="padding: 0px; margin: 0px; " />TEMP_SPACE=80&nbsp;<br style="padding: 0px; margin: 0px; " />SWAP_SPACE=150&nbsp;<br style="padding: 0px; margin: 0px; " />MIN_DISPLAY_COLORS=256</div><div style="margin: 0px; ">经我测试，发现方法二在安装之前的系统检测过程可以通过，但是在安装过程中的系统支持检测无法通过，不知道是不是我设置的有问题，希望有高手可以给我点提示。</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">3.修改系统内核参数</strong></div><div style="margin: 0px; "># vi /etc/sysctl.conf</div><div style="margin: 0px; ">kernel.shmall = 2097152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 该参数表示系统一次可以使用的共享内存总量（以页为单位）。缺省值就是2097152，通常不需要修改kernel.shmmax = 2147483648&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 该参数定义了共享内存段的最大尺寸（以字节为单位）。缺省为32M，对于oracle来说，该缺省值太低了，通常将其设置为2G&nbsp;<br style="padding: 0px; margin: 0px; " />kernel.shmmni = 4096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 这个内核参数用于设置系统范围内共享内存段的最大数量。该参数的默认值是 4096 。通常不需要更改&nbsp;<br style="padding: 0px; margin: 0px; " />kernel.sem = 250 32000 100 128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 表示设置的信号量&nbsp;<br style="padding: 0px; margin: 0px; " />fs.file-max = 65536&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 表示文件句柄的最大数量。文件句柄设置表示在linux系统中可以打开的文件数量&nbsp;<br style="padding: 0px; margin: 0px; " />net.ipv4.ip_local_port_range = 1024 65000&nbsp;<br style="padding: 0px; margin: 0px; " />net.core.rmem_default=262144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 默认的接收窗口大小&nbsp;<br style="padding: 0px; margin: 0px; " />net.core.rmem_max=262144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 接收窗口的最大大小&nbsp;<br style="padding: 0px; margin: 0px; " />net.core.wmem_default=262144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 默认的发送窗口大小&nbsp;<br style="padding: 0px; margin: 0px; " />net.core.wmem_max=262144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 发送窗口的最大大小</div><div style="margin: 0px; ">修改好内核参数后，执行如下命令使新的设置生效</div><div style="margin: 0px; "># /sbin/sysctl -p</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">4.创建Oracle用户、组、安装目录</strong></div><div style="margin: 0px; ">在这里我只讨论单主机环境，不考虑RAC环境的配置，在以后我会专门写一篇如何配置Oracle RAC环境的文章。</div><div style="margin: 0px; ">(1) 创建Oracle用户组</div><div style="margin: 0px; "># groupadd oinstall&nbsp;<br style="padding: 0px; margin: 0px; " /># groupadd dba</div><div style="margin: 0px; ">(2) 创建Oracle用户</div><div style="margin: 0px; "># useradd -m -g oinstall -G dba oracle</div><div style="margin: 0px; ">(3) 设置Oracle用户口令</div><div style="margin: 0px; "># passwd oracle</div><div style="margin: 0px; ">(4) 创建Oracle安装目录以及数据存放目录</div><div style="margin: 0px; "># mkdir -p /DBSoftware/app/oracle&nbsp;<br style="padding: 0px; margin: 0px; " /># mkdir -p /DBData/oradata</div><div style="margin: 0px; ">(5) 修改目录权限</div><div style="margin: 0px; "># chown -R oracle:oinstall /DBSoftware/app/oracle/ /DBData/oradata/&nbsp;<br style="padding: 0px; margin: 0px; " /># chmod -R 755 /DBSoftware/app/oracle/ /DBData/oradata/</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">5.添加以下内容到/etc/security/limits.conf</strong></div><div style="margin: 0px; "># vi /etc/security/limits.conf</div><div style="margin: 0px; ">oracle soft nproc 2047&nbsp;<br style="padding: 0px; margin: 0px; " />oracle hard nproc 16384&nbsp;<br style="padding: 0px; margin: 0px; " />oracle soft nofile 1024&nbsp;<br style="padding: 0px; margin: 0px; " />oracle hard nofile 65536</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">6.添加以下内容到/etc/pam.d/login</strong></div><div style="margin: 0px; "># vi /etc/pam.d/login</div><div style="margin: 0px; ">session required /lib/security/pam_limits.so&nbsp;<br style="padding: 0px; margin: 0px; " />session required pam_limits.so</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">7.添加以下内容到/etc/profile</strong></div><div style="margin: 0px; "># vi /etc/profile</div><div style="margin: 0px; ">if [ $USER = "oracle" ]; then&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; if [ $SHELL = "/bin/ksh" ]; then&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ulimit -p 16384&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ulimit -n 65536&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; else&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ulimit -u 16384 -n 65536&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; fi&nbsp;<br style="padding: 0px; margin: 0px; " />fi</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">8.配置Linux主机</strong></div><div style="margin: 0px; ">检查/etc/hosts文件中是否有localhost的记录（指向127.0.0.1即可），若没有的话，在后面配置Oracle监听的时候会出现一些问题，导致无法启动监听，在此手工添加此记录即可。</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">9.配置oracle用户环境变量</strong></div><div style="margin: 0px; "># su - oracle&nbsp;<br style="padding: 0px; margin: 0px; " />$ vi ~/.bash_profile</div><div style="margin: 0px; ">增加如下内容：</div><div style="margin: 0px; ">export ORACLE_BASE=/DBSoftware/app/oracle&nbsp;&nbsp; // 上面创建的Oracle安装文件夹&nbsp;<br style="padding: 0px; margin: 0px; " />export ORACLE_SID=orcl&nbsp;<br style="padding: 0px; margin: 0px; " />export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1</div><div style="margin: 0px; ">export PATH=$PATH:$ORACLE_HOME/bin&nbsp;<br style="padding: 0px; margin: 0px; " />export LD_LIBARY_PATH=$ORACLE_HOME/lib</div><div style="margin: 0px; ">export PATH&nbsp;<br style="padding: 0px; margin: 0px; " />umask 022</div><div style="margin: 0px; ">保存后使用如下命令，使设置生效：</div><div style="margin: 0px; ">$ source ~/.bash_profile</div></blockquote><div style="margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><strong style="padding: 0px; margin: 0px; ">三、安装Oracle，并进行相关设置</strong></div><blockquote style="padding: 0px; margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">1.解压缩安装文件</strong></div><div style="margin: 0px; ">Oracle的安装包有这样几种格式：</div><div style="margin: 0px; ">(1) zip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10201_database_linux32.zip</div><div style="margin: 0px; ">这种格式最好解压缩，直接使用命令unzip 文件名即可</div><div style="margin: 0px; ">(2) cpio.gz</div><div style="margin: 0px; ">这种格式有这样几种解压缩方式</div><div style="margin: 0px; ">a.&nbsp; # zcat XXXX.cpio.gz | cpio -idmv&nbsp;<br style="padding: 0px; margin: 0px; " />b.&nbsp; # gunzip XXXX.cpio.gz解压出XXXX.cpio文件然后再 # cpio -idvm &amp;lt; XXXX.cpio</div><div style="margin: 0px; ">解压缩完成后，设置oracle帐户可以操作安装文件所在的目录</div><div style="margin: 0px; ">chown -R oracle:oinstall 安装文件所在目录</div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">2. 用oracle帐户进入安装文件所在目录，执行如下命令即可看到安装界面：</strong></div><div style="margin: 0px; ">$ ./runInstaller</div><div style="margin: 0px; ">如果无法看到安装界面，请使用root帐户执行如下命令后再运行安装程序：</div><div style="margin: 0px; "># export DISPLAY=:0.0&nbsp;<br style="padding: 0px; margin: 0px; " /># xhost +&nbsp;<br style="padding: 0px; margin: 0px; " />$ ./runInstaller</div><div style="margin: 0px; ">出现安装界面后，根据界面提示进行相关的设置，我的建议是在安装过程中不创建数据库，只安装程序，监听和创建数据库等安装完成后再进行相关的操作。</div><div style="margin: 0px; ">安装过程中，需要使用root权限执行两个脚本。</div><div style="margin: 0px; ">&nbsp;</div><p style="padding: 0px 0px 15px; margin: 0px; "><a target="_blank" href="http://img1.51cto.com/attachment/201109/102441824.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102441824.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a></p><div style="margin: 0px; ">&nbsp;</div><p style="padding: 0px 0px 15px; margin: 0px; "><a target="_blank" href="http://img1.51cto.com/attachment/201109/102518944.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102518944.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a>&nbsp;<a target="_blank" href="http://img1.51cto.com/attachment/201109/102518845.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102518845.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a>&nbsp;<a target="_blank" href="http://img1.51cto.com/attachment/201109/102518196.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102518196.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a>&nbsp;<a target="_blank" href="http://img1.51cto.com/attachment/201109/102518276.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102518276.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a></p><p style="padding: 0px 0px 15px; margin: 0px; "><a target="_blank" href="http://img1.51cto.com/attachment/201109/102539362.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102539362.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a>&nbsp;<a target="_blank" href="http://img1.51cto.com/attachment/201109/102539562.jpg" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; "><img alt="" border="0" src="http://img1.51cto.com/attachment/201109/102539562.jpg" style="padding: 0px; margin: 0px; vertical-align: top; border: none; " /></a></p><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">3. 安装完成后，将/etc/redhat-release文件中的内容修改回Red Hat Enterprise Linux Server release 5 (Tikanga)</strong></div><div style="margin: 0px; "><strong style="padding: 0px; margin: 0px; ">4.创建监听以及创建数据库</strong></div><div style="margin: 0px; ">(1) 创建监听程序</div><div style="margin: 0px; ">使用Oracle提供的NET CONFIGURATION ASSISTANT创建TNS监听</div><div style="margin: 0px; ">$ netca</div><div style="margin: 0px; ">基本上就是一直Next就可以了，当然你也可以在这期间修改TNS的监听端口号</div><div style="margin: 0px; ">TNS监听创建完成后可以使用如下命令进行检查：</div><div style="margin: 0px; "># netstat -atln&nbsp;&nbsp;&nbsp; 检查监听端口是否打开&nbsp;<br style="padding: 0px; margin: 0px; " />$ lsnrctl status&nbsp;&nbsp;&nbsp; 检查TNS监听状态</div><div style="margin: 0px; ">确认监听已经成功启动后，即可执行Database Configure Assistant进行数据库的创建，执行命令如下：</div><div style="margin: 0px; ">$ dbca</div><div style="margin: 0px; ">在创建数据库的过程中，建议将数据库的字符集设置为Unicode UTF-8，防止出现乱码。</div></blockquote><div style="margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><strong style="padding: 0px; margin: 0px; ">四、数据库的启动脚本（转载自<a href="http://82584.blog.51cto.com/72584/110131" style="padding: 0px; margin: 0px; color: #015f91; text-decoration: none; ">[url]http://82584.blog.51cto.com/72584/110131[/url]</a>）</strong></div><blockquote style="padding: 0px; margin: 0px; color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff; "><div style="margin: 0px; "># vi /etc/rc.d/init.d/oracle</div><div style="margin: 0px; ">================================ Script File Start ================================&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;</div><div style="margin: 0px; ">#!/bin/bash&nbsp;<br style="padding: 0px; margin: 0px; " />#&nbsp;<br style="padding: 0px; margin: 0px; " /># chkconfig: 35 95 1&nbsp;<br style="padding: 0px; margin: 0px; " /># description: init script to start/stop oracle database 10g, TNS listener, EMS&nbsp;<br style="padding: 0px; margin: 0px; " /># match these values to your environment:</div><div style="margin: 0px; ">export ORACLE_BASE=/DBSoftware/app/oracle&nbsp;<br style="padding: 0px; margin: 0px; " />export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1</div><div style="margin: 0px; ">export PATH=/u01/app/oracle/bin:$ORACLE_HOME/bin:$PATH&nbsp;<br style="padding: 0px; margin: 0px; " />export ORACLE_SID=orcl&nbsp;<br style="padding: 0px; margin: 0px; " />export ORACLE_USER=oracle</div><div style="margin: 0px; "># see how we are called:&nbsp;<br style="padding: 0px; margin: 0px; " />case $1 in&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; start)&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; su - "$ORACLE_USER"&amp;lt;&amp;lt;EOO&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lsnrctl start&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqlplus /nolog&amp;lt;&amp;lt;EOS&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect / as sysdba&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startup&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; EOS&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; emctl start dbconsole&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; EOO&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; touch /var/lock/subsys/$scriptname&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; ;;&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; stop)&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; su - "$ORACLE_USER"&amp;lt;&amp;lt;EOO&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lsnrctl stop&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqlplus /nolog&amp;lt;&amp;lt;EOS&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect / as sysdba&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shutdown immediate&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; EOS&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; emctl stop dbconsole&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; EOO&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; rm -f /var/lock/subsys/scriptname&nbsp;<br style="padding: 0px; margin: 0px; " />&nbsp;&nbsp;&nbsp; ;;&nbsp;<br style="padding: 0px; margin: 0px; " />*)&nbsp;<br style="padding: 0px; margin: 0px; " />echo "Usage: $0 {start|stop}"&nbsp;<br style="padding: 0px; margin: 0px; " />;;&nbsp;<br style="padding: 0px; margin: 0px; " />esac</div><div style="margin: 0px; ">================================ Script File End ================================</div><div style="margin: 0px; ">授权 ：chown root.root /etc/rc.d/init.d/oracle</div><div style="margin: 0px; ">修改文件属性：chmod 755 /etc/rc.d/init.d/oracle</div><div style="margin: 0px; ">以后启动/关闭Oracle可以使用如下命令操作：</div><div style="margin: 0px; "># service oracle start&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 启动监听、数据库以及em&nbsp;<br style="padding: 0px; margin: 0px; " /># service oracle stop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; 关闭监听、数据库以及em</div><div style="margin: 0px; ">当然你也可以把Oracle作为系统服务，随系统启动等等。</div></blockquote><img src ="http://www.blogjava.net/kxbin/aggbug/388272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-21 16:49 <a href="http://www.blogjava.net/kxbin/articles/388272.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE锁机制</title><link>http://www.blogjava.net/kxbin/articles/388188.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 20 Sep 2012 07:25:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388188.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388188.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388188.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388188.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388188.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">数据库是一个多用户使用的共享资源。当多个用户并发地存取数据时，在数据库中就会产生多个事务同时存取同一数据的情况。若对并发操作不加控制就可能会读取和存储不正确的数据，破坏数据库的一致性。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">加锁是实现数据库并发控制的一个非常重要的技术。当事务在对某个数据对象进行操作前，先向系统发出请求，对其加锁。加锁后事务就对该数据对象有了一定的控制，在该事务释放锁之前，其他的事务不能对此数据对象进行更新操作。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">在数据库中有两种基本的锁类型：排它锁（Exclusive Locks，即X锁）和共享锁（Share Locks，即S锁）。当数据对象被加上排它锁时，其他的事务不能对它读取和修改。加了共享锁的数据对象可以被其他事务读取，但不能修改。数据库利用这两种基本的锁类型来对数据库的事务进行并发控制。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">Oracle数据库的锁类型</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">根据保护的对象不同，Oracle数据库锁可以分为以下几大类：DML锁（data locks，数据锁），用于保护数据的完整性；DDL锁（dictionary locks，字典锁），用于保护数据库对象的结构，如表、索引等的结构定义；内部锁和闩（internal locks and latches），保护 数据库的内部结构。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">DML锁的目的在于保证并发情况下的数据完整性，。在Oracle数据库中，DML锁主要包括TM锁和TX锁，其中TM锁称为表级锁，TX锁称为事务锁或行级锁。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">当Oracle执行DML语句时，系统自动在所要操作的表上申请TM类型的锁。当TM锁获得后，系统再自动申请TX类型的锁，并将实际锁定的数据行的锁标志位进行置位。这样在事务加锁前检查TX锁相容性时就不用再逐行检查锁标志，而只需检查TM锁模式的相容性即可，大大提高了系统的效率。TM锁包括了SS、SX、S、X 等多种模式，在数据库中用0－6来表示。不同的SQL操作产生不同类型的TM锁。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">在数据行上只有X锁（排他锁）。在Oracle数据库中，当一个事务首次发起一个DML语句时就获得一个TX锁，该锁保持到事务被提交或回滚。当两个或多个会话在表的同一条记录上执行 DML语句时，第一个会话在该条记录上加锁，其他的会话处于等待状态。当第一个会话提交后，TX锁被释放，其他会话才可以加锁。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">当Oracle数据库发生TX锁等待时，如果不及时处理常常会引起Oracle数据库挂起，或导致死锁的发生，产生ORA-60的错误。这些现象都会对实际应用产生极大的危害，如长时间未响应，大量事务失败等。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">悲观封锁和乐观封锁&nbsp;<br />一、悲观封锁&nbsp;<br />锁在用户修改之前就发挥作用：&nbsp;<br />Select ..for update（nowait)&nbsp;<br />Select * from tab1 for update&nbsp;<br />用户发出这条命令之后，oracle将会对返回集中的数据建立行级封锁，以防止其他用户的修改。&nbsp;<br />如果此时其他用户对上面返回结果集的数据进行dml或ddl操作都会返回一个错误信息或发生阻塞。&nbsp;<br />1：对返回结果集进行update或delete操作会发生阻塞。&nbsp;<br />2：对该表进行ddl操作将会报：Ora-00054:resource busy and acquire with nowait specified.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">原因分析&nbsp;<br />此时Oracle已经对返回的结果集上加了排它的行级锁，所有其他对这些数据进行的修改或删除操作都必须等待这个锁的释放，产生的外在现象就是其他的操作将发生阻塞，这个这个操作commit或rollback.&nbsp;<br />同样这个查询的事务将会对该表加表级锁，不允许对该表的任何ddl操作，否则将会报出ora-00054错误：:resource busy and acquire with nowait specified.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">二、乐观封锁&nbsp;<br />乐观的认为数据在select出来到update进取并提交的这段时间数据不会被更改。这里面有一种潜在的危险就是由于被选出的结果集并没有被锁定，是存在一种可能被其他用户更改的可能。因此Oracle仍然建议是用悲观封锁，因为这样会更安全。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; "><br />阻塞</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">定义：&nbsp;<br />当一个会话保持另一个会话正在请求的资源上的锁定时，就会发生阻塞。被阻塞的会话将一直挂起，直到持有锁的会话放弃锁定的资源为止。4个常见的dml语句会产生阻塞&nbsp;<br />INSERT&nbsp;<br />UPDATE&nbsp;<br />DELETE&nbsp;<br />SELECT&#8230;FOR UPDATE</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; "><br />INSERT</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">Insert发生阻塞的唯一情况就是用户拥有一个建有主键约束的表。当2个的会话同时试图向表中插入相同的数据时，其中的一个会话将被阻塞，直到另外一个会话提交或会滚。一个会话提交时，另一个会话将收到主键重复的错误。回滚时，被阻塞的会话将继续执行。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">UPDATE 和DELETE当执行Update和delete操作的数据行已经被另外的会话锁定时，将会发生阻塞，直到另一个会话提交或会滚。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">Select &#8230;for update</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">当一个用户发出select..for update的错作准备对返回的结果集进行修改时，如果结果集已经被另一个会话锁定，就是发生阻塞。需要等另一个会话结束之后才可继续执行。可以通过发出 select&#8230; for update nowait的语句来避免发生阻塞，如果资源已经被另一个会话锁定，则会返回以下错误：Ora-00054:resource busy and acquire with nowait specified.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">死锁-deadlock</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">定义:当两个用户希望持有对方的资源时就会发生死锁.&nbsp;<br />即两个用户互相等待对方释放资源时,oracle认定为产生了死锁,在这种情况下,将以牺牲一个用户作为代价,另一个用户继续执行,牺牲的用户的事务将回滚.&nbsp;<br />例子：&nbsp;<br />1：用户1对A表进行Update，没有提交。&nbsp;<br />2：用户2对B表进行Update，没有提交。&nbsp;<br />此时双反不存在资源共享的问题。&nbsp;<br />3：如果用户2此时对A表作update,则会发生阻塞，需要等到用户一的事物结束。&nbsp;<br />4：如果此时用户1又对B表作update，则产生死锁。此时Oracle会选择其中一个用户进行会滚，使另一个用户继续执行操作。&nbsp;<br />起因:&nbsp;<br />Oracle的死锁问题实际上很少见，如果发生，基本上都是不正确的程序设计造成的，经过调整后，基本上都会避免死锁的发生。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">DML锁分类表</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; "><br />表1Oracle的TM锁类型&nbsp;<br />锁模式 锁描述 解释 SQL操作&nbsp;<br />0 none&nbsp;<br />1 NULL 空 Select&nbsp;<br />2 SS(Row-S) 行级共享锁，其他对象&nbsp;<br />只能查询这些数据行 Select for update、Lock for</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">update、Lock row share</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">3 SX(Row-X) 行级排它锁，&nbsp;<br />在提交前不允许做DML操作 Insert、Update、&nbsp;<br />Delete、Lock row share</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">4 S(Share) 共享锁 Create index、Lock share&nbsp;<br />5 SSX(S/Row-X) 共享行级排它锁 Lock share row exclusive&nbsp;<br />6 X(Exclusive) 排它锁 Alter table、Drop able、Drop index、Truncate table 、Lock exclusive</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">oracle 锁问题的解决</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; "><br />可以用Spotlight软件对数据库的运行状态进行监控。</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">当出现session锁时，我们要及时进行处理.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">1. 查看哪些session锁:&nbsp;<br />SQL语句：select 'alter system kill session '''||sid||','||serial#||''';' from v$session where sid in (select sid from v$lock where block = 1);</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">SQL&gt; select 'alter system kill session '''||sid||','||serial#||''';' from v$session where sid in (select sid from v$lock where block = 1);&nbsp;<br />'ALTERSYSTEMKILLSESSION'''||SID||','||SERIAL#||''';'&nbsp;<br />--------------------------------------------------------------------------------&nbsp;<br />alter system kill session '132,731';&nbsp;<br />alter system kill session '275,15205';&nbsp;<br />alter system kill session '308,206';&nbsp;<br />alter system kill session '407,3510';</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">2. 查看session锁.&nbsp;<br />sql语句：select s.sid, q.sql_text from v$sqltext q, v$session s&nbsp;<br />where q.address = s.sql_address&nbsp;<br />and s.sid = &amp;sid&nbsp;<br />order by piece;</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">SQL&gt; select s.sid,q.sql_text from v$sqltext q, v$session s where q.address = s.sql_address and s.sid in (select sid from v$lock where block = 1) order by piece;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SID SQL_TEXT&nbsp;<br />---------- ----------------------------------------------------------------&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 77 UPDATE PROFILE_USER SET ID=1,COMPANY_ID=2,CUSTOMER_ID=3,NAMED&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 77 _INSURED_ID=4,LOGIN=5,ROLE_ID=6,PASSWORD=7,EMAIL=8,TIME_ZON&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 77 E=9 WHERE PROFILE_USER.ID=:34&nbsp;<br />3 rows selected.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; "><br />3. kill锁的进程.&nbsp;<br />SQL语句：alter system kill session '77,22198';</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">SQL&gt; alter system kill session '391,48398';&nbsp;<br />System altered.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">4. 查看谁锁了谁。<br />select s1.username || [email='@']'@'[/email] || s1.machine<br />&nbsp; || ' ( SID=' || s1.sid || ' )&nbsp; is blocking '<br />&nbsp; || s2.username || [email='@']'@'[/email] || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status<br />&nbsp; from v$lock l1, v$session s1, v$lock l2, v$session s2<br />&nbsp; where s1.sid=l1.sid and s2.sid=l2.sid<br />&nbsp; and l1.BLOCK=1 and l2.request &gt; 0<br />&nbsp; and l1.id1 = l2.id1<br />&nbsp; and l2.id2 = l2.id2 ;</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">注：&nbsp;<br />&gt; ： 重定向输出，将文件的标准输出重新定向输出到文件，或将数据文件作为另一程序的标准输入内容。&nbsp;<br />| ：UNIX管道：将一文件的输出作为另一文件的输入.</p><p style="color: #333333; font-family: Verdana, Arial, sans-serif, 'Lucida Grande'; font-size: 13px; line-height: 23px; background-color: #d6d3d6; ">在执行SQL语句试：alter system kill session '391,48398'(sid为391); 应当注意对于sid在100以下的应当谨慎，可能该进程对应某个application，如对应某个事务,可以kill.</p><div></div><img src ="http://www.blogjava.net/kxbin/aggbug/388188.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-20 15:25 <a href="http://www.blogjava.net/kxbin/articles/388188.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle 数据库实例启动关闭过程</title><link>http://www.blogjava.net/kxbin/articles/388185.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 20 Sep 2012 06:59:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388185.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388185.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388185.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388185.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388185.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 转载自http://blog.csdn.net/robinson_0612/article/details/5542983--&gt;Oracle&nbsp;数据库实例启动关闭过程--================================/*&nbsp;&nbsp;&nbsp;&nbsp;Oracle数据库实例的启动，严格来说应该是实例的启动，数据库仅仅是在实例启动后进行装载。Oracl...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/388185.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/388185.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-20 14:59 <a href="http://www.blogjava.net/kxbin/articles/388185.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle for update和for update nowait的区别（二）</title><link>http://www.blogjava.net/kxbin/articles/388099.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 19 Sep 2012 14:28:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388099.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388099.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388099.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388099.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388099.html</trackback:ping><description><![CDATA[<p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">对比区别：<br />　　select * from TTable1 for update 锁定表的所有行，只能读不能写<br />　　2&nbsp; select * from TTable1 where pkid = 1 for update 只锁定pkid=1的行<br />　　3&nbsp; select * from Table1 a join Table2 b on a.pkid=b.pkid for update 锁定两个表的所有记录<br />　　4 select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update 锁定两个表的中满足条件的行<br />　　5. select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update of a.pkid 只锁定Table1中满足条件的行<br />　　for update 是把所有的表都锁点 for update of 根据of 后表的条件锁定相对应的表<br />　　-----------<br />　　关于NOWAIT(如果一定要用FOR UPDATE，我更建议加上NOWAIT)<br />　　当有LOCK冲突时会提示错误并结束STATEMENT而不是在那里等待(比如:要查的行已经被其它事务锁了,当前的锁事务与之冲突,加上nowait,当前的事务会结束会提示错误并立即结束 STATEMENT而不再等待).<br />　　如果加了for update后 该语句用来锁定特定的行（如果有where子句，就是满足where条件的那些行）。当这些行被锁定后，其他会话可以选择这些行，但不能更改或删除这些行，直到该语句的事务被commit语句或rollback语句结束为止。<br />　　因为FOR&nbsp;&nbsp; UPDATE子句获得了锁，所以COMMIT将释放这些锁。当锁释放了，该游标就无效了。<br />　　就是这些区别了<br />&nbsp;<br />关于oracle中的select...for update of columns<br />问题，如下：select * from emp where empno = 7369 for update; 会对表中员工编号为7369的记录进行上锁。其他用户无法对该记录进行操作，只能查询。select * from emp where empno = 7369 for update of sal; 这条语句是不是意味着只对表中的7369 这一行的sal字段的数据进行了上锁，其他数据则可以被其他用户做更新操作呢。学员测试结果为二条语句的效果是一样的。其他用户对整行都无法更新，那么是不是意味着 for update of columns这句没有什么意义呢？</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">&nbsp; 这个问题估计很多玩ORACLE的同学们都没有去思考过【网上相关的帖子不多】。现在将其功能讲解一下。</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">&nbsp; 从单独一张表的操作来看，上面二条语句的效果确实是相同的。但是如果涉及到多表操作的时候 for update of columns就起到了非常大的作用了。现假定有二个用户，scott和mm。</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">scott执行语句：select * from emp e,dept d where e.deptno = d.deptno for update; --对二张表都进行了整表锁定<br />mm执行语句：select * from scott.dept for update wait 3; --试图锁定scott用户的dept表</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">结果是：<br />ERROR 位于第 1 行:<br />ORA-30006: 资源已被占用; 执行操作时出现 WAIT 超时</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">现在，scott用户先进行解锁rollback,再在for update语句后面加上of columns，进行测试</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">scott执行语句：select * from emp e,dept d where e.deptno = d.deptno for update of sal ;<br />mm执行语句：select * from scott.dept for update wait 3;</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">结果是：<br />成功锁定了dept表的数据.</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">mm再次执行语句：select * from scott.emp for update wait 3;</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">结果是：<br />ERROR 位于第 1 行:<br />ORA-30006: 资源已被占用; 执行操作时出现 WAIT 超时</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">通过这段代码案例，我们可以得到结论，for update of columns 用在多表连接锁定时，可以指定要锁定的是哪几张表，而如果表中的列没有在for update of 后面出现的话，就意味着这张表其实并没有被锁定，其他用户是可以对这些表的数据进行update操作的。这种情况经常会出现在用户对带有连接查询的视图进行操作场景下。用户只锁定相关表的数据，其他用户仍然可以对视图中其他原始表的数据来进行操作。<br />&nbsp;<br /><a href="http://www.2cto.com/database/Oracle/" target="_blank" style="color: #333333; text-decoration: none; ">Oracle</a>&nbsp;的for update行锁<br />　SELECT...FOR UPDATE 语句的语法如下：<br />　　SELECT ... FOR UPDATE [OF column_list][WAIT n|NOWAIT][SKIP LOCKED];<br />其中：<br />　　OF 子句用于指定即将更新的列，即锁定行上的特定列。<br />　　WAIT 子句指定等待其他用户释放锁的秒数，防止无限期的等待。<br />　　&#8220;使用FOR UPDATE WAIT&#8221;子句的优点如下：<br />　　１防止无限期地等待被锁定的行；<br />　　２允许应用程序中对锁的等待时间进行更多的控制。<br />　　３对于交互式应用程序非常有用，因为这些用户不能等待不确定<br />　　４ 若使用了skip locked，则可以越过锁定的行，不会报告由wait n 引发的&#8216;资源忙&#8217;异常报告</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">示例:<br />create table t(a varchar2(20),b varchar2(20));<br />insert into t values('1','1');<br />insert into t values('2','2');<br />insert into t values('3','3');<br />insert into t values('4','4');<br />现在执行如下操作：<br />在plsql develope中打开两个sql窗口，<br />在1窗口中运行sql<br />select * from t where a='1' for update;<br />在2窗口中运行sql1<br />1. select * from t where a='1'; 这一点问题也没有，因为行级锁不会影响纯粹的select语句<br />再运行sql2<br />2. select * from t where a='1' for update; 则这一句sql在执行时，永远处于等待状态，除非窗口1中sql被提交或回滚。<br />如何才能让sql2不等待或等待指定的时间呢？ 我们再运行sql3<br />3. select * from t where a='1' for update nowait; 则在执行此sql时，直接报资源忙的异常。<br />若执行 select * from t where a='1' for update wait 6; 则在等待6秒后，报 资源忙的异常。<br />如果我们执行sql4<br />4. select * from t where a='1' for update nowait skip Locked; 则执行sql时，即不等待，也不报资源忙异常。<br />现在我们看看执行如下操作将会发生什么呢？<br />在窗口1中执行：<br />select * from t where rownum&lt;=3 nowait skip Locked;<br />在窗口2中执行：<br />select * from t where rownum&lt;=6 nowait skip Locked;<br />select for update 也就如此了吧，insert、update、delete操作默认加行级锁，其原理和操作与select for update并无两样。<br />select for update of，这个of子句在牵连到多个表时，具有较大作用，如不使用of指定锁定的表的列，则所有表的相关行均被锁定，若在of中指定了需修改的列，则只有与这些列相关的表的行才会被锁定。</p><img src ="http://www.blogjava.net/kxbin/aggbug/388099.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-19 22:28 <a href="http://www.blogjava.net/kxbin/articles/388099.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle for update和for update nowait的区别（一）</title><link>http://www.blogjava.net/kxbin/articles/388098.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 19 Sep 2012 14:20:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388098.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388098.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388098.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388098.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388098.html</trackback:ping><description><![CDATA[<div><p>1<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">、</span>for update <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">和</span> for update nowait <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">的区别：</span></p>  <p>&nbsp;<span style="font-family: 宋体; ">首先一点，如果只是</span>select <span style="font-family: 宋体; ">的话，</span>Oracle<span style="font-family: 宋体; ">是不会加任何锁的，也就是</span>Oracle<span style="font-family: 宋体; ">对</span> select <span style="font-family: 宋体; ">读到的数据不会有任何限制，虽然这时候有可能另外一个进程正在修改表中的数据，并且修改的结果可能影响到你目前</span>select<span style="font-family: 宋体; ">语句的结果，但是因为没有锁，所以</span>select<span style="font-family: 宋体; ">结果为当前时刻表中记录的状态。</span></p>  <p>&nbsp;<span style="font-family: 宋体; ">如果加入了</span>for update<span style="font-family: 宋体; ">，</span> <span style="font-family: 宋体; ">则</span>Oracle<span style="font-family: 宋体; ">一旦发现（符合查询条件的）这批数据正在被修改，则不会发出该</span>select<span style="font-family: 宋体; ">语句查询，直到数据被修改结束（被</span>commit<span style="font-family: 宋体; ">），马上自动执行这个</span>select<span style="font-family: 宋体; ">语句。</span></p>  <p>&nbsp;<span style="font-family: 宋体; ">同样，如果该查询语句发出后，有人需要修改这批数据（中的一条或几条），它也必须等到查询结束后（</span>commit<span style="font-family: 宋体; ">）后，才能修改。</span></p>  <p>&nbsp;for update nowait<span style="font-family: 宋体; ">和</span> for update <span style="font-family: 宋体; ">都会对所查询到得结果集进行加锁，所不同的是，如果另外一个线程正在修改结果集中的数据，</span>for update nowait <span style="font-family: 宋体; ">不会进行资源等待，只要发现结果集中有些数据被加锁，立刻返回</span> <span style="font-family: 宋体; ">&#8220;</span>ORA-00054<span style="font-family: 宋体; ">错误，内容是资源正忙</span>, <span style="font-family: 宋体; ">但指定以</span> NOWAIT <span style="font-family: 宋体; ">方式获取资源&#8221;。</span></p>  <p>&nbsp;for update <span style="font-family: 宋体; ">和</span> for update nowait <span style="font-family: 宋体; ">加上的是一个行级锁，也就是只有符合</span>where<span style="font-family: 宋体; ">条件的数据被加锁。如果仅仅用</span>update<span style="font-family: 宋体; ">语句来更改数据时，可能会因为加不上锁而没有响应地、莫名其妙地等待，但如果在此之前，</span>for&nbsp; update NOWAIT<span style="font-family: 宋体; ">语句将要更改的数据试探性地加锁，就可以通过立即返回的错误提示而明白其中的道理，或许这就是</span>For Update<span style="font-family: 宋体; ">和</span>NOWAIT<span style="font-family: 宋体; ">的意义之所在。</span></p>  <p>&nbsp;<span style="font-family: 宋体; ">经过测试，以</span>for update <span style="font-family: 宋体; ">或</span> for update nowait<span style="font-family: 宋体; ">方式进行查询加锁，在</span>select<span style="font-family: 宋体; ">的结果集中，只要有任何一个记录在加锁，则整个结果集都在等待系统资源（如果是</span>nowait<span style="font-family: 宋体; ">，则抛出相应的异常）</span></p>  <p>&nbsp;</p>  <p style="margin-left:6.0pt;line-height:18.0pt">2<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">、</span>for update nowait <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">与</span> for update <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">的目的</span>:<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">锁定表的所有行，排斥其他针对这个表的写操作。确保只有当前事务对指定表进行写操作。</span><br /> for update nowait<span style="font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;">和</span> for update<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">的区别：</span></p>  <p style="margin-left:6.0pt;line-height:18.0pt"><span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">别的事务要对这个表进行写操作时，是等待一段时间还是马上就被数据库系统拒绝而返回</span>.<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">制定采用</span>nowait<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">方式来进行检索，所以当发现数据被别的</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">锁定中的时候，就会迅速返回</span>ORA-00054<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">错误，内容是资源正忙</span>, <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">但指定以</span> NOWAIT <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">方式获取资源。所以在程序中我们可以采用</span>nowait<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">方式迅速判断当前数据是否被锁定中，如果锁定中的话，就要采取相应的业务措施进行处理。</span><br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">如何理解上面的话</span>.<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">开启一会话</span> (<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">就是开一个</span>sqlwindow)<br /> &nbsp;&nbsp;select&nbsp;&nbsp;empno,ename from emp for update nowait where empno='7369';<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">得到下面结果集</span>:<br /> &nbsp; &nbsp; empno&nbsp;&nbsp;ename<br /> &nbsp; &nbsp; 7369&nbsp; &nbsp; smith<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">开启另一会话</span><br /> &nbsp;&nbsp;select empno,ename from emp for update nowait where empno="7369"<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">返回</span>RA-00054<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">错误，内容是资源正忙</span>, <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">但指定以</span> NOWAIT <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">方式获取资源</span><br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">上面会话都提交</span>commit;<br /> ~~~~~~~~~~~~~~~~~~~~~<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">开启一会话</span>,<br /> &nbsp;&nbsp;select&nbsp;&nbsp;empno,ename from emp for update where empno='7369';<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">得到下面结果集</span>:<br /> &nbsp; &nbsp; empno&nbsp;&nbsp;ename<br /> &nbsp; &nbsp; 7369&nbsp; &nbsp; smith<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">开启另一会话</span><br /> &nbsp;&nbsp;select empno,ename from emp for update&nbsp;&nbsp;where empno="7369"<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">阻塞，不返回错误。</span><br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">提交第一个会话，第二个回话自动执行</span><br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">提交第二个会话</span><br /> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /> &nbsp; &nbsp;for update: <span style=" font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">当第一个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">最后</span>commit<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">或者</span>rollback<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">之后，第二个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">中的检索结果就是自动跳出来，并且也把数据锁定住</span>.<br /> &nbsp;&nbsp;<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">开启一会话：</span><br /> &nbsp; &nbsp;&nbsp;&nbsp;select empno,ename from emp for update&nbsp;&nbsp;where empno="7369"<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">；</span><br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">得到下面结果集</span>:<br /> &nbsp; &nbsp; empno&nbsp;&nbsp;ename<br /> &nbsp; &nbsp; 7369&nbsp; &nbsp; smith<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">开启另一个会话，</span><br /> &nbsp; &nbsp;update emp set ename='ALLEN'&nbsp;&nbsp;where empno="7396";<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">阻塞。</span><br /> &nbsp;&nbsp;<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">提交第一个会话，</span>update <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">语句执行</span><br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">在开启一会话</span><br /> &nbsp; &nbsp; update emp set ename="SMITH" where empno='7396';<br /> <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">同样阻塞，虽然第一个会话因为提交而释放了锁，但是第二个会话中的</span>update <span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">又给这一行加锁了</span>;<br />for update nowait:<span style="font-family: 宋体;Times New Roman&quot;;Times New Roman&quot;">当你第一个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">放开锁定以后</span>,<span style=" font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">第二个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">才能正常运行。当你第二个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">语句运行后，数据又被你第二个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">语句锁定住了，这个时候只要你第二个</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">语句后还没有</span>commit<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">，别的</span>session<span style="font-family:宋体;Times New Roman&quot;;Times New Roman&quot;">照样不能对数据进行锁定更新等等。</span><br /></p></div><img src ="http://www.blogjava.net/kxbin/aggbug/388098.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-19 22:20 <a href="http://www.blogjava.net/kxbin/articles/388098.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle10g安装了11g的ODAC后，PL/SQL连接提示TNS：无法解析指定的连接标识符</title><link>http://www.blogjava.net/kxbin/articles/388014.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 10:30:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388014.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388014.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388014.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388014.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388014.html</trackback:ping><description><![CDATA[<p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; "><span style="font-size: 13px; ">　　安装完成以后，用PL/SQL登录测试原有的数据库，竟然提示&#8220;TNS：无法解析指定的连接标识符&#8221;错误。</span></p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　查了相关资料：</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　首先：</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　在D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\LISTENER.ORA文件头部加入这一行</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　DIRECT_HANDOFF_TTC_LISTENER = OFF</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　执行以下命令重启监听器:</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　-------------------------------------------------------------------</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　lsnrctl stop<br />　　lsnrctl start</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　其次：</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　打开PL/SQL 在工具&#8212;&#8212;首选项&#8212;&#8212;连接，右侧窗口</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　在Oracle主目录名中选择服务器版本安装路径：OraDb10g_home1</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　点击确定后，关闭PL/SQL窗口，重新打开后原有配置的数据库登陆成功。</p><p style="font-size: 13px; color: #4b4b4b; font-family: verdana, Arial, helvetica, sans-seriff; line-height: 19px; background-color: #ffffff; ">　　但是在EF实现中还是没有出现Oracle连接驱动，尚不清楚什么原因，后续再去解决。</p><img src ="http://www.blogjava.net/kxbin/aggbug/388014.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 18:30 <a href="http://www.blogjava.net/kxbin/articles/388014.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE常用命令</title><link>http://www.blogjava.net/kxbin/articles/388010.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 10:01:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388010.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388010.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388010.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388010.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388010.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一、ORACLE的启动和关闭&nbsp;1、在单机环境下&nbsp;要想启动或关闭ORACLE系统必须首先切换到ORACLE用户，如下&nbsp;su - oracle&nbsp;a、启动ORACLE系统&nbsp;oracle&gt;svrmgrl&nbsp;SVRMGR&gt;connect internal&nbsp;SVRMGR&gt;startup&nbsp;SVRMGR&gt;quit...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/388010.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/388010.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 18:01 <a href="http://www.blogjava.net/kxbin/articles/388010.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle同义词创建及其作用</title><link>http://www.blogjava.net/kxbin/articles/388003.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 09:46:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388003.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388003.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388003.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388003.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388003.html</trackback:ping><description><![CDATA[<p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">Oracle的同义词（synonyms）从字面上理解就是别名的意思，和试图的功能类似，就是一种映射关系。本文介绍如何创建同义词语句，删除同义词以及查看同义词语句。<br />　　oracle的同义词总结：<br />　　从字面上理解就是别名的意思，和试图的功能类似。就是一种映射关系。<br />　　1.创建同义词语句：</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">　　create public synonym table_name for user.table_name;</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">　　其中第一个user_table和第二个user_table可以不一样。<br />　　此外如果要创建一个远程的数据库上的某张表的同义词，需要先创建一个Database Link(数据库连接)来扩展访问，然后在使用如下语句创建数据库同义词：create synonym table_name for<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#116;&#97;&#98;&#108;&#101;&#95;&#110;&#97;&#109;&#101;&#64;&#68;&#66;&#95;&#76;&#105;&#110;&#107;" style="color: #333333; text-decoration: none; ">table_name@DB_Link</a>;<br />　　当然，你可能需要在user用户中给当前用户(user2)授权： grant select/delete/update on user2<br />　　2.删除同义词：</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">　　drop public synonym table_name;</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">　　3.查看所有同义词：</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">　　select * from dba_synonyms</p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">　　同义词拥有如下好处：节省大量的<a href="http://www.2cto.com/database/" target="_blank" style="color: #333333; text-decoration: none; ">数据库</a>空间，对不同用户的操作同一张表没有多少差别;扩展的数据库的使用范围，能够在不同的数据库用户之间实现无缝交互;同义词可以创建在不同一个数据库服务器上，通过网络实现连接。<br />&nbsp;<a href="http://www.2cto.com/database/Oracle/" target="_blank" style="color: #333333; text-decoration: none; ">Oracle</a>数据库中提供了同义词管理的功能。Oracle同义词是数据库方案对象的一个别名，经常用于简化对象访问和提高对象访问的安全性。<br />AD：<br />&nbsp;<span style="text-indent: 2em; ">在Oracle中对用户的管理是使用权限的方式来管理的，也就是说，如果我们想使用数据库，我们就必须得有权限，但是如果是别人将权限授予了我们，我们也是能对数据库进行操作的，但是我们必须要已授权的表的名称前键入该表所有者的名称，所以这就是比较麻烦的，遇到这种情况，我们该怎么办呢？创建个Oracle同义词吧！这样我们就可以直接使用同义词来使用表了。</span></p><p style="border-width: 0px; padding: 0px; margin: 0px 0px 8px; list-style: none; text-indent: 2em; color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">1.同义词的概念<br />Oracle数据库中提供了同义词管理的功能。同义词是数据库方案对象的一个别名，经常用于简化对象访问和提高对象访问的安全性。在使用同义词时，Oracle数据库将它翻译成对应方案对象的名字。与视图类似，同义词并不占用实际存储空间，只有在数据字典中保存了同义词的定义。在Oracle数据库中的大部分数据库对象，如表、视图、同义词、序列、存储过程、包等等，数据库管理员都可以根据实际情况为他们定义同义词。<br />2.Oracle同义词的分类<br />Oracle同义词有两种类型，分别是公用Oracle同义词与私有Oracle同义词。<br />1)公用Oracle同义词:由一个特殊的用户组Public所拥有。顾名思义，数据库中所有的用户都可以使用公用同义词。公用同义词往往用来标示一些比较普通的数据库对象，这些对象往往大家都需要引用。<br />2)私有Oracle同义词:它是跟公用同义词所对应，他是由创建他的用户所有。当然，这个同义词的创建者，可以通过授权控制其他用户是否有权使用属于自己的私有同义词。<br />3.Oracle同义词创建及删除<br />创建公有Oracle同义词的语法：Create [public] synonym 同义词名称 for [username.]objectName；<br />Drop [public] synonym 同义词名称<br />4.Oracle同义词的作用<br />1) 多用户协同开发中，可以屏蔽对象的名字及其持有者。如果没有同义词，当操作其他用户的表时，必须通过user名.object名的形式，采用了Oracle同义词之后就可以隐蔽掉user名，当然这里要注意的是：public同义词只是为数据库对象定义了一个公共的别名，其他用户能否通过这个别名访问这个数据库对象，还要看是否已经为这个用户授权。<br />2) 为用户简化sql语句。上面的一条其实就是一种简化sql的体现，同时如果自己建的表的名字很长，可以为这个表创建一个Oracle同义词来简化sql开发。<br />3)为分布式数据库的远程对象提供位置透明性。<br />5.Oracle同义词在数据库链中的作用<br />数据库链是一个命名的对象，说明一个数据库到另一个数据库的路径，通过其可以实现不同数据库之间的通信。<br />Create database link 数据库链名 connect&nbsp; to&nbsp; user名 identified by 口令&nbsp; using &#8216;Oracle连接串&#8217;; 访问对象要通过 object名@数据库链名。同义词在数据库链中的作用就是提供位置透明性。</p><img src ="http://www.blogjava.net/kxbin/aggbug/388003.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 17:46 <a href="http://www.blogjava.net/kxbin/articles/388003.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle创建database link总结</title><link>http://www.blogjava.net/kxbin/articles/388002.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 09:36:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/388002.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/388002.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/388002.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/388002.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/388002.html</trackback:ping><description><![CDATA[<p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">物理上存放于网络的多个ORACLE数据库，逻辑上可以看成一个单一的大型数据 库，用户可以通过网络对异地数据库中的数据进行存取，而服务器之间的协同处理对于工作站用户及应用程序而言是完全透明的，开发人员无需关心网络的链接细 节、数据在网络节点中的具体分布情况和服务器间的协调工作过程。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">数据库之间的链接建立在DATABASE LINK上。要创建一个DATABASE LINK，必须首先在建立链接的数据库上设置链接字符串，即配置一个远程数据库的本地网络服务名。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">链接字符串的配置参见《客户端连接服务器》一节。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">数据库全局名称可以用以下命令查出：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>SELECT * FROM GLOBAL_NAME;</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">修改可以用以下语句来修改参数值：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>ALTER SYSTEM SET GLOBAL_NAME=TRUE/FALSE;</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">&lt;1&gt;、当数据库参数global_name=false时，就不要求数据库链接名称跟远端数据库名称一样。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">oracle数据库之间进行连接通讯。<br />创建数据库链接的语法如下：&nbsp;<br /><strong>CREATE [PUBLIC] DATABASE LINK link</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>CONNECT TO username IDENTIFIED BY password</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>USING &#8216;connectstring&#8217;</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">其中：<br />--demona为用net8 easy config创建的连接字符串<br />目的方数据库的init.ora文件中的global_names设为false<br />重新启动数据库设置才能生效<br />或者用sys用户执行</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">注意：创建数据库链接的帐号必须有CREATE DATABASE LINK或CREATE PUBLIC DATABASE LINK的系统权限，用来登录到远程数据库的帐号必须有CREATE SESSION权限。这两种权限都包含在CONNECT角色中（CREATE PUBLIC DATABASE LINK权限在DBA中）。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">一个公用数据库链接对于数据库中的所有用户都是可用的，而一个私有链接仅对创建它的用户可用。由一个用户给另外一个用户授权私有数据库链接是不可能的，一个数据库链接要么是公用的，要么是私有的。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">创建数据库链接时，还可以使用缺省登录方式，即不指定远程数据库的用户名和密码：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>create public database link zrhs_link</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>using &#8216;zrhs&#8217;;</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">在不指定用户名和口令的情况下，ORACLE使用当前的用户名和口令登录到远程数据库。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">USING后面指定的是链接字符串，也就是远程数据库的网络服务名，这个服务名保存在TNSNAMES.ORA文件中，在该文件中定义了协议、主机名、端口和数据库名。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">删除数据库链接的语句是：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; "><strong>DROP [PUBLIC] DATABASE LINK zrhs_link</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">数据库链接的引用</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">一般情况下引用数据库链接，可以直接将其放到调用的表名或视图名称后面，中间使用一个 @ 作为分割符：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">SELECT * FROM&nbsp;<a rel="nofollow" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#119;&#111;&#114;&#107;&#101;&#114;&#64;&#122;&#114;&#104;&#115;&#95;&#108;&#105;&#110;&#107;" style="text-decoration: none; color: #64a038; "><span style="color: #800080; ">worker@zrhs_link</span>&nbsp;</a>;</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">对于经常使用的数据库链接，可以建立一个本地的同义词，方便使用：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">CREATE SYNONYM worker_syn FOR&nbsp;<a rel="nofollow" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#119;&#111;&#114;&#107;&#101;&#114;&#64;&#122;&#114;&#104;&#115;&#95;&#108;&#105;&#110;&#107;" style="text-decoration: none; color: #64a038; "><span style="color: #800080; ">worker@zrhs_link</span>&nbsp;</a>;</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">还可以建立一个本地的远程视图，方便使用：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">CREATE VIEW worker AS SELECT * FROM&nbsp;<a rel="nofollow" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#119;&#111;&#114;&#107;&#101;&#114;&#64;&#122;&#114;&#104;&#115;&#95;&#108;&#105;&#110;&#107;" style="text-decoration: none; color: #64a038; "><span style="color: #800080; ">worker@zrhs_link</span>&nbsp;</a>where&#8230; ;</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">现在本视图可与本地数据库中的任何其它视图一样对待，也可以授权给其它用户，访问此视图，但该用户必须有访问数据库链接的权限。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">对于另外一种情况，所要访问的表不在数据库链接中指定的远程帐户下，但该帐户有访问该表的权限，那么我们在表名前要加上该表的用户名：</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">SELECT * FROM&nbsp;<a rel="nofollow" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#99;&#97;&#109;&#101;&#108;&#46;&#119;&#111;&#114;&#107;&#101;&#114;&#64;&#122;&#114;&#104;&#115;&#95;&#108;&#105;&#110;&#107;" style="text-decoration: none; color: #64a038; ">camel.worker@zrhs_link</a>&nbsp;;</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">&lt;2&gt;、当数据库参数global_name=true时，那就要求数据库链接名称跟远端数据库名称一样<br />数据库全局名称可以用以下命令查出</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">SELECT * FROM GLOBAL_NAME;</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">atabase link(dblink)--数据库链路<br />创建dblink的语法：<br /><strong>sql&gt;create database link 数据库链路名<br />connect to 用户名 identified by 口令<br />using '主机字符串名';</strong>&nbsp;<br />如：<br /><strong>sql&gt;create database link ora9i.us.oracle.com ### 这里的us.oracle.com为oracle默认域名 ###<br />connect to scott identified by tiger<br />using 'sun';</strong></p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">1)dblink名必须与远程数据库的全局数据库名（global_name）相同；<br />2)用户名，口令为远程数据库用户名，口令;<br />3)主机字符串为本机tnsnames.ora中定义的串;<br />4)两个同名的数据库间不得建立dblink;<br />然后，你就可以通过dblink访问远程数据库了。<br />如：<br />sql&gt;select * from 表名@ora9i.us.oracle.com;<br />还可以建立快照(snapshot)通过dblink实现远程数据自动传输。</p><p style="line-height: 25px; margin: 0px 0px 10px; padding: 0px; color: #444444; font-family: Arial, Helvetica, simsun, u5b8bu4f53; background-color: #ffffff; ">查看所有的数据库链接，进入系统管理员SQL&gt;操作符下，运行命令：&nbsp;<br /><strong><br />SQL&gt;select owner,object_name from dba_objects where object_type='DATABASE LINK';</strong></p><img src ="http://www.blogjava.net/kxbin/aggbug/388002.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 17:36 <a href="http://www.blogjava.net/kxbin/articles/388002.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE SQL：经典查询练手第五篇</title><link>http://www.blogjava.net/kxbin/articles/387986.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 07:05:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387986.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387986.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387986.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387986.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387986.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本文使用ORACLE自带的人力资源（HR）实例数据，本文所用表结构如下：表名：REGIONS序号列名数据类型长度小数位标识主键允许空默认值说明1REGION_IDNUMBER&nbsp;&nbsp;&nbsp;是否&nbsp;&nbsp;2REGION_NAMEVARCHAR225&nbsp;&nbsp;&nbsp;是&nbsp;&nbsp;&nbsp;表名：COUNTRIES序号列名数据类型长度...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387986.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387986.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 15:05 <a href="http://www.blogjava.net/kxbin/articles/387986.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE SQL：经典查询练手第四篇</title><link>http://www.blogjava.net/kxbin/articles/387984.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 07:04:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387984.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387984.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387984.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387984.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387984.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本文使用ORACLE自带的人力资源（HR）实例数据，本文所用表结构如下：表名：REGIONS序号列名数据类型长度小数位标识主键允许空默认值说明1REGION_IDNUMBER&nbsp;&nbsp;&nbsp;是否&nbsp;&nbsp;2REGION_NAMEVARCHAR225&nbsp;&nbsp;&nbsp;是&nbsp;&nbsp;&nbsp;表名：COUNTRIES序号列名数据类型长度...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387984.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387984.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 15:04 <a href="http://www.blogjava.net/kxbin/articles/387984.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE SQL：经典查询练手第三篇</title><link>http://www.blogjava.net/kxbin/articles/387983.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 07:03:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387983.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387983.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387983.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387983.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387983.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本文使用ORACLE自带的人力资源（HR）实例数据，本文所用表结构如下：HR.EMPLOYEES员工表结构如下：&nbsp;HR.DEPARTMENTS表结构如下：&nbsp;HR.REGIONS表结构如下：&nbsp;SQL&gt;&nbsp;DESC&nbsp;HR.REGIONS;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387983.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387983.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 15:03 <a href="http://www.blogjava.net/kxbin/articles/387983.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE SQL：经典查询练手第二篇</title><link>http://www.blogjava.net/kxbin/articles/387981.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 07:02:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387981.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387981.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387981.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387981.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387981.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本文使用的实例表结构与表的数据如下：scott.emp员工表结构如下：&nbsp;SQL&gt;&nbsp;DESC&nbsp;SCOTT.EMP;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nullable&nbsp;Default&nbsp;Comment...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387981.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387981.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 15:02 <a href="http://www.blogjava.net/kxbin/articles/387981.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE SQL：经典查询练手第一篇</title><link>http://www.blogjava.net/kxbin/articles/387980.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Tue, 18 Sep 2012 07:01:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387980.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387980.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387980.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387980.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387980.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本文使用的实例表结构与表的数据如下：scott.emp员工表结构如下：Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nullable&nbsp;Default&nbsp;Comments&nbsp;--------&nbsp;------------&nbsp;...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387980.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387980.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-18 15:01 <a href="http://www.blogjava.net/kxbin/articles/387980.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle常见问题(401-500)</title><link>http://www.blogjava.net/kxbin/articles/387661.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 13 Sep 2012 09:28:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387661.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387661.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387661.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387661.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387661.html</trackback:ping><description><![CDATA[<p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; font-family: 微软雅黑, 宋体, Arial; background-color: #ffffff; "><span style="font-size: 12pt; line-height: 24px; font-family: Verdana; ">401. V$PQ_TQSTAT&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含并行执行操作上的统计量</span><span style="font-size: 12pt; line-height: 24px; font-family: Verdana; ">.</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">帮助在一个查询中测定不平衡的问题。</span></p><span style="background-color: #ffffff; font-size: 12pt; line-height: 24px; font-family: Verdana; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />402. V$PROCESS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含关于当前活动进程的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />403. V$PROXY_ARCHIVEDLOG&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含归档日志备份文件的描述信息，这些备份文件带有一个称为</span><span style="font-size: 12pt; line-height: 24px; ">PROXY</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">副本的新特征。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />404. V$PROXY_DATAFILE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含数据文件和控制文件备份的描述信息，这些备份文件带有一个称为</span><span style="font-size: 12pt; line-height: 24px; ">PROXY</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">副本的新特征。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />405. V$PWFILE_USERS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出被授予</span><span style="font-size: 12pt; line-height: 24px; ">SYSDBA</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">和</span><span style="font-size: 12pt; line-height: 24px; ">SYSOPER</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">特权的用户。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />406. V$PX_PROCESS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含正在运行并行操作的会话的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />407. V$PX_PROCESS_SYSSTAT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含正在运行并行操作的会话的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />408. V$PX_SESSION&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含正在运行并行操作的会话的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />409. V$PX_SESSTAT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含正在运行并行操作的会话的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />410. V$QUEUE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含多线程消息队列的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />411. V$QUEUEING_MTH&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示所有可用的查询资源分配方法。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />412. V$RECOVER_FILE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示需要介质恢复的文件状态。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />413. V$RECOVERY_FILE_STATUS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含对每个恢复命令的每一数据文件的一行信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />414. V$RECOVERY_LOG&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出需要完成介质恢复的归档日志的信息</span><span style="font-size: 12pt; line-height: 24px; ">.</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">这个信息来自</span><span style="font-size: 12pt; line-height: 24px; ">V$LOG_HISTORY</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />415. V$RECOVERY_PROCESS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">能够用来跟踪数据库恢复操作，以便他们不会被终止执行。</span><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">也用来估算进程中完成这个操作所需的时间。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />416. V$RECOVERY_STATUS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含当前恢复进程的统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />417. V$REQDIST&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出</span><span style="font-size: 12pt; line-height: 24px; ">MTS</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">调度程序请求次数的直方图的统计量。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">418. V$RESERVED_WORDS&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">给出</span><span style="font-size: 12pt; line-height: 24px; ">PL/SQL</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">编译器所使用的关键字的列表。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />419. V$RESOURCE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含资源名和地址信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />420. V$RESOURCE_LIMIT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示系统资源的全局资源使用的信息。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />421. V$ROLLNAME&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出所有联机回滚段的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />422. V$ROLLSTAT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含回滚段的统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />423. V$ROWCACHE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示活动数据字典的统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />424. V$ROWCACHE_PARENT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示数据字典中所有双亲对象的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />425. V$ROWCACHE_SUBORDINATE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示数据字典中从属对象的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />426. V$RSRC_CONSUMER_GROUP&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示与当前活动资源消费者用户组相关联的数据。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />427. V$RSRC_CONSUMER_GROUP_CPU_MTH&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">为资源消费者用户组显示所有可用的资源的分配方法。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />428. V$RSRC_PLAN&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示当前所有活动资源方案的名称。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />429. V$RSRC_PLAN_CPU_MTH&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示所有用于资源方案的可用</span><span style="font-size: 12pt; line-height: 24px; ">CPU</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">资源分配方法。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />430. V$SESS_IO&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">为每个用户会话列出</span><span style="font-size: 12pt; line-height: 24px; ">I/O</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">统计。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />431. V$SESSION&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出当前每一个会话的会话信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />432. V$SESSION_CONNECT_INFO&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示当前会话的网络连接的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />433. V$SESSION_CURSOR_CACHE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示当前会话的游标用法的信息。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />434. V$SESSION_EVENT&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出一个会话在等待一个事件的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />435. V$SESSION_LONGOPS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示一个长时间运行操作的状态。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />436. V$SESSION_OBJECT_CACHE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示本地服务器上当前用户对话的对象高速缓存的统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />437. V$SESSION_WAIT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出正在等待的活动会话的资源或事件。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />438. V$SESSTAT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出用户会话统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />439. V$SGA&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含系统全局区的总统计量。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />440. V$SGASTAT&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含系统全局区的详细信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />441. V$SHARED_POOL_RESERVED&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出能帮助你调节共享池中保留池和空间的统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />442. V$SHARED_SERVER&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含共享服务器进程的信息。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />443. V$SHARED_SERVER_MONITOR&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含调试共享服务器进程的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />444. V$SORT_SEGMENT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含一个给定实例中每一个排序段的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />445. V$SPPARAMETER&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出</span><span style="font-size: 12pt; line-height: 24px; ">SPFILE</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">的内容。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />446. V$SQL&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出</span><span style="font-size: 12pt; line-height: 24px; ">SQL</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">共享区的统计量。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; "><br />447. V$SQL_BIND_DATA&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">如果数据在服务器中可用，它将对查询这个视图的会话所拥有的每个游标中的每一个不同的连接变量，显示客</span></p><p style=" font-size: 13px; "><span style="font-size: 12pt; font-family: 宋体; ">户端发送的实际连接数据。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />448. V$SQL_BIND_METADATA&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">对查询这个视图的会话所拥有的每个游标中的每一个不同的连接变量，显示客户端提供的连接元数据。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />449. V$SQL_CURSOR&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示与查询这个视图的会话相关的每一个游标的</span><span style="font-size: 12pt; ">DEBUG</span><span style="font-size: 12pt; font-family: 宋体; ">信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />450. V$SQL_PLAN&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含装载到库缓存中每个子游标的执行计划信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />451. V$SQL_SHARED_CURSOR&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">为什么一个特定的子游标没有与存在的子查询的共享的解释。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />452. V$SQL_SHARED_MEMEORY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">关于共享内存快照的游标的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />453. V$SQL_REDIRECTION&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">标识复位向的</span><span style="font-size: 12pt; ">SQL</span><span style="font-size: 12pt; font-family: 宋体; ">语句。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />454. V$SQL_WORKAREA&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示被</span><span style="font-size: 12pt; ">SQL</span><span style="font-size: 12pt; font-family: 宋体; ">游标使用的工作区信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />455. V$SQL_WORKAREA_ACTIVE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含当前由系统分配的工作区的昫间信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />456. V$SQLAREA&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">共享</span><span style="font-size: 12pt; ">SQL</span><span style="font-size: 12pt; font-family: 宋体; ">的统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />457. V$SQLTEXT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含</span><span style="font-size: 12pt; ">SGA</span><span style="font-size: 12pt; font-family: 宋体; ">中属于共享</span><span style="font-size: 12pt; ">SQL</span><span style="font-size: 12pt; font-family: 宋体; ">游标的</span><span style="font-size: 12pt; ">SQL</span><span style="font-size: 12pt; font-family: 宋体; ">语句文本。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />458. V$SQLTEXT_WITH_NEWLINES&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">不能用空格代替新行制表符外，和</span><span style="font-size: 12pt; ">V$SQLTEXT</span><span style="font-size: 12pt; font-family: 宋体; ">功能一样。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />459. V$STATNAME&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示</span><span style="font-size: 12pt; ">V$SESSTAT</span><span style="font-size: 12pt; font-family: 宋体; ">和</span><span style="font-size: 12pt; ">V$SYSTAT</span><span style="font-size: 12pt; font-family: 宋体; ">表中的统计量的译码统计名字。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />460. V$SUBCACHE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示当前装载于库高速缓存中的从属高速缓存的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />461. V$SYSSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出系统统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />462. V$SYSTEM_CURSOR_CACHE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">系统范围的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />463. V$SYSTEM_EVENT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含等待一个事件的全部信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />464. V$SYSTEM_PARAMETER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含系统参数信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />465. V$SYSTEM_PARAMETER2&nbsp;<br />ORACLE<span style="font-size: 12pt; font-family: 宋体; ">实例中当前影响的参数和参数的值。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />466. V$TABLESPACE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">控制文件中表空间的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />467. V$TEMP_CACHE_TRANSFER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示每个数据文件中探查块的数量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />468. V$TEMP_EXTENT_MAP&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示所有临时表空间的每一个单元的状态信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />469. V$TEMP_EXTENT_POOL&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示被一个给定实例使用的临时空间缓存的状态。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />470. V$TEMP_PING&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示每一个数据文件探查的块数。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />471. V$TEMP_SPACE_HEADER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示每一个临时表空间中每一个文件的聚集信息，涉及每个空间首部中当前使用多少空间和有多少自由空间。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />472. V$TEMPFILE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示临时文件的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />473. V$TEMPORARY_LOBS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示临时的</span><span style="font-size: 12pt; ">LOB</span><span style="font-size: 12pt; font-family: 宋体; ">。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />474. V$TEMPSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含文件读</span><span style="font-size: 12pt; ">/</span><span style="font-size: 12pt; font-family: 宋体; ">写的统计信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />475. V$THREAD&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含控制文件中的线程信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />476. V$TIMER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出以</span><span style="font-size: 12pt; ">1%</span><span style="font-size: 12pt; font-family: 宋体; ">秒计的流逝时间。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />477. V$TIMEZONE_NAMES&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出合法的时区名称。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />478. V$TRANSACTION&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出系统中的活动事务。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />479. V$TRANSACTION_ENQUEUE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示事务状态对象所拥有的锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />480. V$TYPE_SIZE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出不同数据库组件的大小，以便用来估算数据块的容量大小。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />481. V$UNDOSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示一个历史统计数据来显示系统工作的如何。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />482. V$VERSION&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出</span><span style="font-size: 12pt; ">ORACLE</span><span style="font-size: 12pt; font-family: 宋体; ">服务器中核心库组件的版本号。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />483. V$VPD_POLICY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出与当前在库缓存中的游标相关的所有安全策略。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />484. V$WAITSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出块竞争统计量</span>&nbsp;<span style="font-size: 12pt; "><br />9I</span><span style="font-size: 12pt; font-family: 宋体; ">管理的数据字典</span><span style="font-size: 12pt; ">DBA</span><span style="font-size: 12pt; font-family: 宋体; ">视图</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />485. DBA_2PC_NEIGHBORS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含未决事务的引入或流出的连接信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />486. DBA_ALL_TABLES&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示数据库中所有表的描述。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />487. DBA_APPLICATION_ROLES&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">所有的具有函数定义的验证策略的角色。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />488. DBA_ASSOCIATIONS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示用户定义的统计信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />489. DBA_AUDIT_EXISTS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出</span><span style="font-size: 12pt; ">AUDIT NOT EXISTS</span><span style="font-size: 12pt; font-family: 宋体; ">和</span><span style="font-size: 12pt; ">AUDIT EXISTS</span><span style="font-size: 12pt; font-family: 宋体; ">产生的审计跟踪。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />490. DBA_AUDIT_OBJECT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">系统中所有对象的审计跟踪记录。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />491. DBA_AUDIT_SESSION&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出关于</span><span style="font-size: 12pt; ">CONNECT</span><span style="font-size: 12pt; font-family: 宋体; ">和</span><span style="font-size: 12pt; ">DISCONNECT</span><span style="font-size: 12pt; font-family: 宋体; ">的所有审计跟踪信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />492. DBA_AUDIT_STATEMENT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出关于</span><span style="font-size: 12pt; ">GRANT</span><span style="font-size: 12pt; font-family: 宋体; ">，</span><span style="font-size: 12pt; ">REVOKE</span><span style="font-size: 12pt; font-family: 宋体; ">，</span><span style="font-size: 12pt; ">AUDIT</span><span style="font-size: 12pt; font-family: 宋体; ">，</span><span style="font-size: 12pt; ">NOAUDIT</span><span style="font-size: 12pt; font-family: 宋体; ">，</span><span style="font-size: 12pt; ">ALTER SYSTEM</span><span style="font-size: 12pt; font-family: 宋体; ">语句的审计跟踪信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />493. DBA_AUDIT_TRAIL&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出所有的审计跟踪条目。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />494. DBA_BLOCKERS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出正有人等待一个会话持有的锁的所有会话，但并非它们自己在等待一个锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />495. DBA_BASE_TABLE_MVIEWS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">描述数据库中所有的物化视图。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />496. DBA_CATALOG&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出所有数据库标，视图，同义词和序列。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />497. DBA_CLU_COLUMNS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出表列到聚集列的映射。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />498. DBA_CLUSTER_HASH_EXPRESSIONS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出所有聚集的散列</span><span style="font-size: 12pt; ">HASH</span><span style="font-size: 12pt; font-family: 宋体; ">函数。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />499. DBA_CLUSTERS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含数据库中所有聚集的描述。</span></p><p style=" font-size: 13px; "><span style="font-size: 12pt; "><br />500. DBA_COL_COMMENTS&nbsp;<br /></span><span style="font-size: 12pt; font-family: 宋体; ">所有表和视图的列的注解。</span>&nbsp;</p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><img src ="http://www.blogjava.net/kxbin/aggbug/387661.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-13 17:28 <a href="http://www.blogjava.net/kxbin/articles/387661.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle常见问题(301-400)</title><link>http://www.blogjava.net/kxbin/articles/387660.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 13 Sep 2012 09:27:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387660.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387660.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387660.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387660.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387660.html</trackback:ping><description><![CDATA[<p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; font-family: 微软雅黑, 宋体, Arial; background-color: #ffffff; "><span style="font-size: 12pt; line-height: 24px; font-family: Verdana; ">301. V$BUFFER_POOL&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示实例缓冲池的信息。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; font-family: 微软雅黑, 宋体, Arial; background-color: #ffffff; "><span style="font-size: 12pt; line-height: 24px; font-family: Verdana; ">&nbsp;<br />302. V$BUFFER_POOL_STATISTICS&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示实例缓冲池的信息。</span></p><span style="background-color: #ffffff; font-size: 12pt; line-height: 24px; font-family: Verdana; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />303. V$CACHE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含当前实例的</span><span style="font-size: 12pt; line-height: 24px; ">SGA</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">中的每一个块的头部信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />304. V$CACHE_LOCK&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含当前实例的</span><span style="font-size: 12pt; line-height: 24px; ">SGA</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">中的每一个块的头部信息</span><span style="font-size: 12pt; line-height: 24px; ">.&nbsp;</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">和</span><span style="font-size: 12pt; line-height: 24px; ">V$CACHE</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">非常相似，</span><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">除特使平台锁管理器标识符号不同外。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />305. V$CACHE_TRANSFER&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">除了只显示那些被探查了至少一次的块的信息外，和</span><span style="font-size: 12pt; line-height: 24px; ">V$CACHE</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">功能相同。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />306. V$CIRCUIT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含关于虚电路的信息，是用户通过调度程序和服务器到数据库的所有连接。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />307. V$CLASS_PING&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示每一个块类中被探查块的数目。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />308. V$COMPATIBILITY&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示数据库实例使用的特征，可以阻止数据库回到早期的版本中去。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />309. V$COMPATSEG&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示数据库实例使用的永久性特征，可以阻止数据库回到早期的版本中去。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />310. V$CONTEXT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出当前对话的设置属性。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />311. V$CONTROLFILE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出控制文件的名称。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />312. V$CONTROLFILE_RECORD_SECTION&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示控制文件记录部分的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />313. V$COPY_CORRUPTION&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示控制文件中数据文件损坏的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />314. V$CR_BLOCK_SERVER&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示用在缓存中块服务器后台进程上的统计信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />315. V$DATABASE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含控制文件中数据库的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />316. V$DATAFILE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含控制文件中数据库文件的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />317. V$DATAFILE_COPY&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含控制文件中数据库文件副本的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />318. V$DATAFILE_HEADER&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示数据文件头部的数据文件信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />319. V$DB_CACHE_ADVICE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">根据缓存的大小估计出物理读的数量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />320. V$DB_OBJECT_CACHE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">缓存在库缓存中的数据库对象。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />321. V$DB_PIPES&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示实例中的共享池当前描绘的管道。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />322. V$DBFILE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出组成数据库的所有数据文件。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />323. V$DBLINK&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">查询会话所打开的所有数据库连接。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />324. V$DELETED_OBJECT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示控制文件中被删除归档日志。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />325. V$DISPATCHER&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">提供调度进程的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />326. V$DISPATCHER_RATE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">为调度进程提供优质提供速率统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />327. V$DLM_ALL_LOCKS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">列出当前所有锁的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />328. V$DLM_CONVERT_LOCAL&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">本地锁转换操作所消耗的时间。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />329. V$DLM_CONVERT_REMOTE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">远程锁转换操作所消耗的时间。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />330. V$DLM_LATCH&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">它是过时的，参见</span><span style="font-size: 12pt; line-height: 24px; ">V$LATCH</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />331. V$DLM_LOCKS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">这些是锁管理器已知的被阻塞或阻塞其它对象的锁信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />332. V$DLM_MISC&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示多种</span><span style="font-size: 12pt; line-height: 24px; ">DLM</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">统计量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />333. V$DLM_RESS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示当前锁管理器已知的全部资源的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />334. V$ENABLEDPRIVE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示被授予的特权。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />335. V$ENQUEUE_LOCK&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示排队对象所拥有的全部锁。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />336. V$EVENT_NAME&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含等待事件的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />337. V$EXECUTION&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示并行执行中的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />338. V$FALSE_PING&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">可能得到探查失败的缓冲区。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />339. V$FAST_START_SERVERS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">执行并行操作事务恢复的所有从属操作的信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />340. V$FAST_START_TRANSACTIONS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">恢复中的事务进展信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />341. V$FILE_CACHE_TRANSFER&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示每个数据文件中探查的块的数量。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />342. V$FILE_PING&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示每个数据文件被探查的块数目。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />343. V$FILESTAT&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">包含文件关于读</span><span style="font-size: 12pt; line-height: 24px; ">/</span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">写统计量信息。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />344. V$FIXED_TABLE&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示数据库中所有动态性能表和视图及导出表。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />345. V$FIXED_VIEW_DEFINITION&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">显示所有固定视图的定义。</span></p><span style="font-size: 12pt; "><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><br />346. V$GC_ELEMENTS_WITH_COLLISIONS&nbsp;<br /><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">可以找到保护多缓存的锁。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />347. V$GES_BLOCKING_ENQUEUE&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">这些是锁管理器已知的被阻塞或阻塞其它对象的锁信息。</span></p><p align="left" style="margin: 0cm 0cm 7.5pt; font-size: 13px; line-height: 19px; "><span style="font-size: 12pt; line-height: 24px; ">&nbsp;<br />348. V$GES_CONVERT_LOCAL&nbsp;<br /></span><span style="font-size: 12pt; line-height: 24px; font-family: 宋体; ">本地锁转换操作</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />349. V$GES_CONVERT_REMOTE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">远程锁转换操作所消耗的时间。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />350. V$GES_ENQUEUE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示当前锁管理员知道的所有的锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />351. V$GES_LATCH&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">参见</span><span style="font-size: 12pt; ">V$LATCH</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />352. V$GES_RESOURCE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示当前锁管理器已知的全部资源的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />353. V$GES_STATISTICS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示多种</span><span style="font-size: 12pt; ">DLM</span><span style="font-size: 12pt; font-family: 宋体; ">统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />354. V$GLOBAL_BLOCKED_LOCKS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示全局块锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />355. V$GLOBAL_TRANSACTION&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示当前激活的全局事务的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />356. V$HS_AGENT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">标识当前运行在一个给定的主机上的</span><span style="font-size: 12pt; ">HS</span><span style="font-size: 12pt; font-family: 宋体; ">代理的集合。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />357. V$HS_SESSION&nbsp;<br />ORACLE<span style="font-size: 12pt; font-family: 宋体; ">服务器打开的</span><span style="font-size: 12pt; ">HS</span><span style="font-size: 12pt; font-family: 宋体; ">会话集。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />358. V$INDEXED_FIXED_COLUMN&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示建立索引的动态性能表中的列</span><span style="font-size: 12pt; ">(X$</span><span style="font-size: 12pt; font-family: 宋体; ">表</span><span style="font-size: 12pt; ">)</span><span style="font-size: 12pt; font-family: 宋体; ">。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />359. V$INSTANCE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示当前实例的状态。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />360. V$INSTANCE_RECOVERY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">用来监视执行用户指定恢复读次数的限制机制。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />361. V$LATCH&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">为非双亲简易锁列出统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />362. V$LATCH_CHILDREN&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">关于子简易锁的统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />363. V$LATCH_MISSES&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">试图获得一个简易锁失败的统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />364. V$LATCH_PARENT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含关于双亲简易锁的统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />365. V$LATCHHOLDER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">当前简易锁持有者的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />366. V$LATCHNAME&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含关于显示在</span><span style="font-size: 12pt; ">V$LATCH</span><span style="font-size: 12pt; font-family: 宋体; ">中的简易锁的解码简易锁名字的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />367. V$LIBRARYCACHE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">关于高速缓存性能和活动的统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />368. V$LICENSE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">许可证限制的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />369. V$LOADCSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含在一个直接装载执行过程中所编译的</span><span style="font-size: 12pt; ">SQL*LOADER</span><span style="font-size: 12pt; font-family: 宋体; ">统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />370. V$LOCK&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">当前</span><span style="font-size: 12pt; ">ORACLE</span><span style="font-size: 12pt; font-family: 宋体; ">所持有的锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />371. V$LOCK_ACTIVITY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示当前实例的</span><span style="font-size: 12pt; ">DLM</span><span style="font-size: 12pt; font-family: 宋体; ">锁操作活动。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />372. V$LOCK_ELEMENT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">每一个被缓存使用的</span><span style="font-size: 12pt; ">PCM</span><span style="font-size: 12pt; font-family: 宋体; ">锁在</span><span style="font-size: 12pt; ">V$LOCK_ELEMENTS</span><span style="font-size: 12pt; font-family: 宋体; ">中都有一个条目。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />373. V$LOCKED_OBJECT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出每个事务所获得的全部锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />374. V$LOCK_WITH_COLLISIONS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">可以查询出保护多缓冲区的锁。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />375. V$LOG&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">控制文件中日志文件的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />376. V$LOG_HISTORY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">控制文件中日志文件的历史信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />377. V$LOGFILE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含重做日志文件的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />378. V$LOGHIST&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">控制文件中日志文件的日志历史信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />379. V$LOGMNR_CONTENTS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">日志历史信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />380. V$LOGMNR_DICTIONARY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">日志历史信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />381. V$LOGMNR_LOGS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">日志信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />382. V$LOGMNR_PARAMETERS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">日志信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />383. V$MTS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">包含调节多线程的服务器的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />384. V$MYSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">当前会话的统计量。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />385. V$NLS_PARAMETERS&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">当前</span><span style="font-size: 12pt; ">NLS</span><span style="font-size: 12pt; font-family: 宋体; ">参数信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />386. V$NLS_VALID_VALUES&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出所有</span><span style="font-size: 12pt; ">NLS</span><span style="font-size: 12pt; font-family: 宋体; ">参数的有效值。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />387. V$OBJECT_DEPENDENCY&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">能够通过当前装载在共享池中的包，过程或游标来决定依赖哪一个对象。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />388. V$OBJECT_USAGE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">来监视索引的使用。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />389. V$OBSOLETE_PARAMETER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出陈旧的参数。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />390. V$OFFINE_RANGE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示控制文件中数据文件的脱机信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />391. V$OPEN_CURSOR&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出每一个会话当前打开的和解析的游标。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />392. V$OPTION&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出</span><span style="font-size: 12pt; ">ORACLE</span><span style="font-size: 12pt; font-family: 宋体; ">服务安装的状况。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />393. V$PARALLEL_DEGREE_LIMIT_MTH&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">显示所有有效的并行度限制资源分配的方法。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />394. V$PARAMETER&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出关于初始化参数的信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />395. V$PARAMETER2&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出了当前影响会话的参数和参数值。</span></p><p style=" font-size: 13px; "><span style="font-size: 12pt; ">&nbsp;<br />396. V$PGASTAT&nbsp;<br /></span><span style="font-size: 12pt; font-family: 宋体; ">列出</span><span style="font-size: 12pt; ">ORACLE</span><span style="font-size: 12pt; font-family: 宋体; ">内存使用统计。</span></p><p style=" font-size: 13px; "><span style="font-size: 12pt; ">&nbsp;<br />397. V$PING&nbsp;<br /></span><span style="font-size: 12pt; font-family: 宋体; ">与</span><span style="font-size: 12pt; ">V$CACHE</span><span style="font-size: 12pt; font-family: 宋体; ">一样。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />398. V$PQ_SESSTAT&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">列出并行查询会话的统计信息。</span></p><span style="font-size: 12pt; "><p style=" font-size: 13px; "><br />399. V$PQ_SLAVE&nbsp;<br /><span style="font-size: 12pt; font-family: 宋体; ">一个实例上每个活动并行执行服务器的统计量。</span></p><p style=" font-size: 13px; "><span style="font-size: 12pt; "><br />400. V$PQ_SYSSTAT&nbsp;<br /></span><span style="font-size: 12pt; font-family: 宋体; ">列出并行查询的系统的统计量。</span></p></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><img src ="http://www.blogjava.net/kxbin/aggbug/387660.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-13 17:27 <a href="http://www.blogjava.net/kxbin/articles/387660.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle常见问题(201-300)</title><link>http://www.blogjava.net/kxbin/articles/387659.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 13 Sep 2012 09:26:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387659.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387659.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387659.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387659.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387659.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 201. /*+NOCACHE(TABLE)*/&nbsp;当进行全表扫描时，CACHE提示能够将表的检索块放置在缓冲区缓存中最近最少列表LRU的最近使用端&nbsp;例如：&nbsp;SELECT&nbsp;/*+FULL(BSEMPMS)&nbsp;NOCAHE(BSEMPMS)&nbsp;*/&nbsp;EMP_NAM&nbsp;FROM&nbsp;BSEMPMS;202. /*+APPEN...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387659.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387659.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-13 17:26 <a href="http://www.blogjava.net/kxbin/articles/387659.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle常见问题(101-200)</title><link>http://www.blogjava.net/kxbin/articles/387657.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 13 Sep 2012 09:24:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387657.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387657.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387657.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387657.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387657.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 101.&nbsp;如何搜索出前N条记录？SQL&gt; SELECT * FROM empLOYEE WHERE ROWNUM &lt; n ORDER BY empno;&nbsp;102.&nbsp;如何知道机器上的Oracle支持多少并发用户数?&nbsp;SQL&gt;conn internal&nbsp;；&nbsp;SQL&gt;show parameter processes&nb...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387657.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387657.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-13 17:24 <a href="http://www.blogjava.net/kxbin/articles/387657.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle常见问题(1-100)</title><link>http://www.blogjava.net/kxbin/articles/387656.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 13 Sep 2012 09:23:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387656.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387656.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387656.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387656.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387656.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1. Oracle安装完成后的初始口令?&nbsp;&nbsp;　internal/oracle&nbsp;　sys/change_on_install&nbsp;　system/manager&nbsp;　scott/tiger&nbsp;　sysman/oem_temp&nbsp;2. ORACLE9I AS WEB CACHE的初始默认用户和密码？&nbsp;administrator/ad...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387656.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387656.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-13 17:23 <a href="http://www.blogjava.net/kxbin/articles/387656.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详解之七：   程序包的创建与应用</title><link>http://www.blogjava.net/kxbin/articles/387581.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 09:34:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387581.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387581.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387581.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387581.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387581.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇主要内容如下：第七章&nbsp;&nbsp;程序包的创建和应用7.1&nbsp;&nbsp;程序包简介7.2&nbsp;&nbsp;程序包的定义7.3&nbsp;&nbsp;包的开发步骤7.4&nbsp;&nbsp;包定义的说明7.5&nbsp;&nbsp;子程序重载7.6&nbsp;&nbsp;加密实用程序7.7&nbsp;&nbsp;删除包7.8&nbsp;&nbsp;包的管理&nbsp;...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387581.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387581.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 17:34 <a href="http://www.blogjava.net/kxbin/articles/387581.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详解之六： 把过程与函数说透</title><link>http://www.blogjava.net/kxbin/articles/387580.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 09:33:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387580.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387580.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387580.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387580.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387580.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇主要内容如下：6.1&nbsp;引言6.2&nbsp;创建函数6.3&nbsp;存储过程6.3.1&nbsp;创建过程6.3.2&nbsp;调用存储过程6.3.3&nbsp;AUTHID6.3.4&nbsp;PRAGMA AUTONOMOUS_TRANSACTION6.3.5&nbsp;开发存储过程步骤6.3.6&nbsp;删除过程和函数6.3.7&nbsp;过程与函数的比较&nbsp;6.1...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387580.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387580.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 17:33 <a href="http://www.blogjava.net/kxbin/articles/387580.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详解之五： 异常错误处理</title><link>http://www.blogjava.net/kxbin/articles/387579.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 09:32:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387579.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387579.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387579.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387579.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387579.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇主要内容如下：5.1&nbsp;异常处理概念5.1.1&nbsp;预定义的异常处理5.1.2&nbsp;非预定义的异常处理5.1.3&nbsp;用户自定义的异常处理5.1.4&nbsp;&nbsp;用户定义的异常处理5.2&nbsp;异常错误传播5.2.1&nbsp;在执行部分引发异常错误5.2.2&nbsp;在声明部分引发异常错误5.3&nbsp;异常错误处理编程5.4&nbsp;&nbsp...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387579.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387579.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 17:32 <a href="http://www.blogjava.net/kxbin/articles/387579.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详细之四： 把游标说透</title><link>http://www.blogjava.net/kxbin/articles/387578.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 09:31:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387578.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387578.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387578.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387578.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387578.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇主要内容如下：4.1&nbsp;游标概念4.1.1&nbsp;处理显式游标4.1.2&nbsp;处理隐式游标4.1.3&nbsp;关于&nbsp;NO_DATA_FOUND&nbsp;和&nbsp;%NOTFOUND的区别4.1.4&nbsp;&nbsp;使用游标更新和删除数据4.2&nbsp;游标变量4.2.1&nbsp;&nbsp;声明游标变量4.2.2&nbsp;&nbsp;游标变量操作...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387578.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387578.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 17:31 <a href="http://www.blogjava.net/kxbin/articles/387578.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详解之三：PL/SQL流程控制语句</title><link>http://www.blogjava.net/kxbin/articles/387577.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 09:30:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387577.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387577.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387577.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387577.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387577.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇主要内容如下：3.1&nbsp;&nbsp;条件语句3.2&nbsp;&nbsp;CASE&nbsp;表达式3.3&nbsp;&nbsp;循环3.4&nbsp;&nbsp;标号和GOTO3.5&nbsp;&nbsp;NULL&nbsp;语句&nbsp;介绍PL/SQL的流程控制语句,&nbsp;包括如下三类:l&nbsp;控制语句:&nbsp;IF&nbsp;语句l&nbsp;循环语句:&nb...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387577.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387577.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 17:30 <a href="http://www.blogjava.net/kxbin/articles/387577.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详解之二： PL/SQL块结构和组成元素</title><link>http://www.blogjava.net/kxbin/articles/387571.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 09:00:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387571.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387571.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387571.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387571.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387571.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇主要内容如下：2.1&nbsp;&nbsp;&nbsp;PL/SQL块2.2&nbsp;&nbsp;&nbsp;PL/SQL结构2.3&nbsp;&nbsp;&nbsp;标识符2.4&nbsp;&nbsp;&nbsp;PL/SQL&nbsp;变量类型2.4.1&nbsp;&nbsp;变量类型2.4.2&nbsp;&nbsp;复合类型2.4.2.1&nbsp;记录类型2.4.2.2&nbsp;数...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387571.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387571.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 17:00 <a href="http://www.blogjava.net/kxbin/articles/387571.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程详解之一：PL/SQL 程序设计简介</title><link>http://www.blogjava.net/kxbin/articles/387570.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 08:59:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387570.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387570.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387570.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387570.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387570.html</trackback:ping><description><![CDATA[<p style="margin: 7.5pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: 宋体; background-color: #ffff00; font-size: 11pt; font-weight: bold; ">本篇主要内容如下：</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc10218" style="color: #464646; text-decoration: none; "><span style="text-transform: uppercase; font-family: Arial; font-size: 10.5pt; ">第</span><span style="text-transform: uppercase; font-family: 宋体; font-size: 10.5pt; ">一</span><span style="text-transform: uppercase; font-family: Arial; font-size: 10.5pt; ">章&nbsp;&nbsp;&nbsp;PL/SQL&nbsp;程序设计简介</span></a></p><p style="margin: 0pt 0px 0pt 10.5pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc18787" style="color: #464646; text-decoration: none; "><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">1.</span><span style="font-variant: small-caps; font-family: 宋体; font-size: 10pt; ">1</span><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">&nbsp;&nbsp;&nbsp;SQL与PL/SQL</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc11821" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.</span><span style="font-family: 宋体; font-size: 10pt; ">1</span><span style="font-family: 'Times New Roman'; font-size: 10pt; ">.1&nbsp;&nbsp;什么是PL/SQL?</span></a></p><p style="margin: 0pt 0px 0pt 10.5pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc5025" style="color: #464646; text-decoration: none; "><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">1.</span><span style="font-variant: small-caps; font-family: 宋体; font-size: 10pt; ">2</span><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">&nbsp;&nbsp;PL/SQL的</span><span style="font-variant: small-caps; font-family: 宋体; font-size: 10pt; ">优点或特征</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc6530" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.2.1&nbsp;&nbsp;有利于客户/服务器环境应用的运行</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc20499" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.2.2&nbsp;&nbsp;适合于客户环境</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc21230" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.2.</span><span style="font-family: 宋体; font-size: 10pt; ">3</span><span style="font-family: 'Times New Roman'; font-size: 10pt; ">&nbsp;&nbsp;</span><span style="font-family: 宋体; font-size: 10pt; ">过程化</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc6437" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.2.</span><span style="font-family: 宋体; font-size: 10pt; ">4</span><span style="font-family: 'Times New Roman'; font-size: 10pt; ">&nbsp;&nbsp;</span><span style="font-family: 宋体; font-size: 10pt; ">模块化</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc21211" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.2.</span><span style="font-family: 宋体; font-size: 10pt; ">5</span>&nbsp;<span style="font-family: 宋体; font-size: 10pt; ">&nbsp;运行错误的可处理性</span></a></p><p style="margin: 0pt 0px 0pt 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc22163" style="color: #464646; text-decoration: none; "><span style="font-family: 'Times New Roman'; font-size: 10pt; ">1.2.</span><span style="font-family: 宋体; font-size: 10pt; ">6</span>&nbsp;<span style="font-family: 宋体; font-size: 10pt; ">&nbsp;提供大量内置程序包</span></a></p><p style="margin: 0pt 0px 0pt 10.5pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc30478" style="color: #464646; text-decoration: none; "><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">1.</span><span style="font-variant: small-caps; font-family: 宋体; font-size: 10pt; ">3</span><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">&nbsp;&nbsp;PL/SQL&nbsp;可用的SQL语句</span></a></p><p style="margin: 0pt 0px 0pt 10.5pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><a href="http://www.cnblogs.com/huyong/archive/2011/05/16/2047329.html#_Toc6182" style="color: #464646; text-decoration: none; "><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">1.</span><span style="font-variant: small-caps; font-family: 宋体; font-size: 10pt; ">4</span><span style="font-variant: small-caps; font-family: 'Times New Roman'; font-size: 10pt; ">&nbsp;&nbsp;运行PL/SQL程序</span></a></p><p style="margin: 0pt 0px 0pt 10.5pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><hr style="font-family: 微软雅黑, 宋体, Arial; font-size: 15px; line-height: normal; background-color: #ffffff; " /><p style="margin: 7px 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; ">&nbsp;</p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><p style="margin: 0pt 0px; text-indent: 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: 宋体; font-size: 10.5pt; ">SQL语言只是访问、操作数据库的语言，并不是一种具有流程控制的程序设计语言，而只有程序设计语言才能用于应用软件的开发。</span><span style="font-family: Arial; font-size: 10.5pt; ">PL&nbsp;/SQL是一种高级数据库程序设计语言，该语言专门用于在各种环境下对ORACLE数据库进行访问。由于该语言集成于数据库服务器中，所以PL/SQL代码可以对数据进行快速高效的处理。除此之外，可以在ORACLE数据库的某些客户端工具中，使用PL/SQL语言也是该语言的一个特点。本章的主要内容是讨论引入PL/SQL语言的必要性和该语言的主要特点，以及了解PL/SQL语言的重要性和数据库版本问题。还要介绍一些贯穿全书的更详细的高级概念，并在本章的最后就我们在本书案例中使用的数据库表的若干约定做一说明。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h2><a name="_Toc518865172" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 12pt; "><a name="_Toc521305443" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418090" style="color: rgb(70, 70, 70); "></a><a name="_Toc524428001" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949039" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407121" style="color: rgb(70, 70, 70); "></a><a name="_Toc477183988" style="color: rgb(70, 70, 70); "></a><a name="_Toc24706" style="color: rgb(70, 70, 70); "></a><a name="_Toc18787" style="color: #464646; ">1.</a></span><span style="font-family: 宋体; font-size: 12pt; ">1</span><span style="font-family: Arial; font-size: 12pt; ">&nbsp;&nbsp;&nbsp;SQL与PL/SQL</span></h2><h3><a name="_Toc518865173" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc521305444" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418091" style="color: rgb(70, 70, 70); "></a><a name="_Toc524428002" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949040" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407122" style="color: rgb(70, 70, 70); "></a><a name="_Toc477183989" style="color: rgb(70, 70, 70); "></a><a name="_Toc24699" style="color: rgb(70, 70, 70); "></a><a name="_Toc11821" style="color: #464646; ">1.</a></span><span style="font-family: 宋体; font-size: 10.5pt; ">1</span><span style="font-family: Arial; font-size: 10.5pt; ">.1&nbsp;&nbsp;什么是PL/SQL?</span></h3><p style="margin: 0pt 0px; text-indent: 27pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL是&nbsp;Procedure&nbsp;Language&nbsp;&amp;&nbsp;Structured&nbsp;Query&nbsp;Language&nbsp;的缩写。ORACLE的SQL是支持ANSI(American&nbsp;national&nbsp;Standards&nbsp;Institute)和ISO92&nbsp;(International&nbsp;Standards&nbsp;Organization)标准的产品。PL/SQL是对SQL语言存储过程语言的扩展。从ORACLE6以后，ORACLE的RDBMS附带了PL/SQL。它现在已经成为一种过程处理语言，简称PL/SQL。目前的PL/SQL包括两部分，一部分是数据库引擎部分；另一部分是可嵌入到许多产品（如C语言，JAVA语言等）工具中的独立引擎。可以将这两部分称为：数据库PL/SQL和工具PL/SQL。两者的编程非常相似。都具有编程结构、语法和逻辑机制。工具PL/SQL另外还增加了用于支持工具（如ORACLE&nbsp;Forms）的句法，如：在窗体上设置按钮等。本章主要介绍数据库PL/SQL内容。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h2><a name="_Toc503776575" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 12pt; "><a name="_Toc518865174" style="color: rgb(70, 70, 70); "></a><a name="_Toc521305445" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418092" style="color: rgb(70, 70, 70); "></a><a name="_Toc524428003" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949041" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407123" style="color: rgb(70, 70, 70); "></a><a name="_Toc477183990" style="color: rgb(70, 70, 70); "></a><a name="_Toc15813" style="color: rgb(70, 70, 70); "></a><a name="_Toc5025" style="color: #464646; ">1.</a></span><span style="font-family: 宋体; font-size: 12pt; ">2</span><span style="font-family: Arial; font-size: 12pt; ">&nbsp;&nbsp;PL/SQL的</span><span style="font-family: 宋体; font-size: 12pt; ">优点或特征</span></h2><h3><a name="_Toc518865175" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc521305446" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418093" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949042" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407124" style="color: rgb(70, 70, 70); "></a><a name="_Toc8118" style="color: rgb(70, 70, 70); "></a><a name="_Toc6530" style="color: #464646; ">1.2.1&nbsp;&nbsp;有利于客户/服务器环境应用的运行</a></span></h3><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">对于客户/服务器环境来说，真正的瓶颈是网络上。无论网络多快，只要客户端与服务器进行大量的数据交换。应用运行的效率自然就回受到影响。如果使用PL/SQL进行编程，将这种具有大量数据处理的应用放在服务器端来执行。自然就省去了数据在网上的传输时间。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h3><a name="_Toc518865176" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc521305447" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418094" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949043" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407125" style="color: rgb(70, 70, 70); "></a><a name="_Toc6181" style="color: rgb(70, 70, 70); "></a><a name="_Toc20499" style="color: #464646; ">1.2.2&nbsp;&nbsp;适合于客户环境</a></span></h3><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL由于分为数据库PL/SQL部分和工具PL/SQL。对于客户端来说，PL/SQL可以嵌套到相应的工具中，客户端程序可以执行本地包含PL/SQL部分，也可以向服务发SQL命令或激活服务器端的PL/SQL程序运行。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h3><a name="_Toc28930" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc21230" style="color: #464646; ">1.2.</a></span><span style="font-family: 宋体; font-size: 10.5pt; ">3</span><span style="font-family: Arial; font-size: 10.5pt; ">&nbsp;&nbsp;</span><span style="font-family: 宋体; font-size: 10.5pt; ">过程化</span></h3><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL</span><span style="font-family: 宋体; font-size: 10.5pt; ">是</span><span style="font-family: 宋体; font-size: 10.5pt; ">Oracle在标准SQL上的过程性扩展，不仅允许在PL/SQL程序内嵌入SQL语句，而且允许使用各种类型的条件分支语句和循环语句，可以多个应用程序之间共享其解决方案</span><span style="font-family: Arial; font-size: 10.5pt; ">。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h3><a name="_Toc2337" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc6437" style="color: #464646; ">1.2.</a></span><span style="font-family: 宋体; font-size: 10.5pt; ">4</span><span style="font-family: Arial; font-size: 10.5pt; ">&nbsp;&nbsp;</span><span style="font-family: 宋体; font-size: 10.5pt; ">模块化</span></h3><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL</span><span style="font-family: 宋体; font-size: 10.5pt; ">程序结构是一种描述性很强、界限分明的块结构、嵌套块结构，被分成单独的过程、函数、触发器，且可以把它们组合为程序包，提高程序的模块化能力</span><span style="font-family: Arial; font-size: 10.5pt; ">。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h3><a name="_Toc23825" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc21211" style="color: #464646; ">1.2.</a></span><span style="font-family: 宋体; font-size: 10.5pt; ">5</span>&nbsp;&nbsp;<span style="font-family: 宋体; font-size: 10.5pt; ">运行错误的可处理性</span></h3><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: 宋体; font-size: 10.5pt; ">使用</span><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL</span><span style="font-family: 宋体; font-size: 10.5pt; ">提供的异常处理（</span><span style="font-family: 宋体; font-size: 10.5pt; ">EXCEPTION），开发人员可集中处理各种ORACLE错误和PL/SQL错误，或处理系统错误与自定义错误，以增强应用程序的健壮性。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><h3><a name="_Toc16138" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 10.5pt; "><a name="_Toc22163" style="color: #464646; ">1.2.</a></span><span style="font-family: 宋体; font-size: 10.5pt; ">6</span>&nbsp;&nbsp;<span style="font-family: 宋体; font-size: 10.5pt; ">提供大量内置程序包</span></h3><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: 宋体; font-size: 10.5pt; ">ORACLE提供了大量的内置程序包。通过这些程序包能够实现DBS的一些低层操作、高级功能，不论对DBA还是应用开发人员都具有重要作用。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><p style="margin: 0pt 0px; text-indent: 21pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: 宋体; font-size: 10.5pt; ">当然还有其它的一些优点如：更好的性能、可移植性和兼容性、可维护性、易用性与快速性等。</span></p><h2><a name="_Toc518865178" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 12pt; "><a name="_Toc521305449" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418096" style="color: rgb(70, 70, 70); "></a><a name="_Toc524428004" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949045" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407127" style="color: rgb(70, 70, 70); "></a><a name="_Toc477183991" style="color: rgb(70, 70, 70); "></a><a name="_Toc10163" style="color: rgb(70, 70, 70); "></a><a name="_Toc30478" style="color: #464646; ">1.</a></span><span style="font-family: 宋体; font-size: 12pt; ">3</span><span style="font-family: Arial; font-size: 12pt; ">&nbsp;&nbsp;PL/SQL&nbsp;可用的SQL语句</span></h2><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">&nbsp;&nbsp;&nbsp;&nbsp;PL/SQL是ORACLE系统的核心语言，现在ORACLE的许多部件都是由PL/SQL写成。在PL/SQL中可以使用的SQL语句有：</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">INSERT，UPDATE，DELETE，SELECT&nbsp;INTO，COMMIT，ROLLBACK，SAVEPOINT。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-style: italic; font-family: Arial; font-size: 10.5pt; font-weight: bold; ">提示：在&nbsp;PL/SQL中只能用&nbsp;SQL语句中的&nbsp;DML&nbsp;部分，不能用&nbsp;DDL&nbsp;部分，如果要在PL/SQL中使用DDL(如CREATE&nbsp;&nbsp;table&nbsp;&nbsp;等)的话，只能以动态的方式来使用。</span></p><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "></p><p style="margin: 0pt 0px 0pt 39pt; text-indent: -18pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Wingdings; font-size: 10.5pt; ">l&nbsp;</span><span style="font-family: Arial; font-size: 10.5pt; ">ORACLE&nbsp;的&nbsp;PL/SQL&nbsp;组件在对&nbsp;PL/SQL&nbsp;程序进行解释时，同时对在其所使用的表名、列名及数据类型进行检查。</span></p><p style="margin: 0pt 0px 0pt 39pt; text-indent: -18pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Wingdings; font-size: 10.5pt; ">l&nbsp;</span><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL&nbsp;可以在SQL*PLUS&nbsp;中使用。</span></p><p style="margin: 0pt 0px 0pt 39pt; text-indent: -18pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Wingdings; font-size: 10.5pt; ">l&nbsp;</span><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL&nbsp;可以在高级语言中使用。</span></p><p style="margin: 0pt 0px 0pt 39pt; text-indent: -18pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Wingdings; font-size: 10.5pt; ">l&nbsp;</span><span style="font-family: Arial; font-size: 10.5pt; ">PL/SQL可以在ORACLE的开发工具中使用</span><span style="font-family: 宋体; font-size: 10.5pt; ">(如：SQL&nbsp;Developer或Procedure&nbsp;Builder等)</span><span style="font-family: Arial; font-size: 10.5pt; ">。</span></p><p style="margin: 0pt 0px 0pt 39pt; text-indent: -18pt; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Wingdings; font-size: 10.5pt; ">l&nbsp;</span><span style="font-family: Arial; font-size: 10.5pt; ">其它开发工具也可以调用PL/SQL编写的过程和函数，如Power&nbsp;Builder&nbsp;等都可以调用服务器端的PL/SQL过程。</span></p><h2><a name="_Toc518865179" style="color: rgb(70, 70, 70); "></a><span style="font-family: Arial; font-size: 12pt; "><a name="_Toc521305450" style="color: rgb(70, 70, 70); "></a><a name="_Toc521418097" style="color: rgb(70, 70, 70); "></a><a name="_Toc524428005" style="color: rgb(70, 70, 70); "></a><a name="_Toc525949046" style="color: rgb(70, 70, 70); "></a><a name="_Toc528407128" style="color: rgb(70, 70, 70); "></a><a name="_Toc477183992" style="color: rgb(70, 70, 70); "></a><a name="_Toc2603" style="color: rgb(70, 70, 70); "></a><a name="_Toc6182" style="color: #464646; ">1.</a></span><span style="font-family: 宋体; font-size: 12pt; ">4</span><span style="font-family: Arial; font-size: 12pt; ">&nbsp;&nbsp;运行PL/SQL程序</span></h2><p style="margin: 0pt 0px; line-height: 24px; font-family: 微软雅黑, 宋体, Arial; font-size: 15px; background-color: #ffffff; "><span style="font-family: Arial; font-size: 10.5pt; ">&nbsp;&nbsp;&nbsp;&nbsp;PL/SQL程序的运行是通过ORACLE中的一个引擎来进行的。这个引擎可能在ORACLE的服务器端，也可能在&nbsp;ORACLE&nbsp;应用开发的客户端。引擎执行PL/SQL中的过程性语句，然后将SQL语句发送给数据库服务器来执行。再将结果返回给执行端。</span></p><img src ="http://www.blogjava.net/kxbin/aggbug/387570.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 16:59 <a href="http://www.blogjava.net/kxbin/articles/387570.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE PL/SQL编程之八：把触发器说透 </title><link>http://www.blogjava.net/kxbin/articles/387567.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 12 Sep 2012 08:50:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387567.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387567.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387567.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387567.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387567.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 8.1&nbsp;触发器类型8.1.1&nbsp;DML触发器8.1.2&nbsp;替代触发器8.1.3&nbsp;系统触发器8.2&nbsp;创建触发器8.2.1&nbsp;触发器触发次序8.2.2&nbsp;创建DML触发器8.2.3&nbsp;创建替代(INSTEAD OF)触发器8.2.3&nbsp;创建系统事件触发器8.2.4&nbsp;系统触发器事件属性8.2.5&nbsp;使用触发器...&nbsp;&nbsp;<a href='http://www.blogjava.net/kxbin/articles/387567.html'>阅读全文</a><img src ="http://www.blogjava.net/kxbin/aggbug/387567.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-12 16:50 <a href="http://www.blogjava.net/kxbin/articles/387567.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle记录类型</title><link>http://www.blogjava.net/kxbin/articles/387123.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 05 Sep 2012 13:52:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/387123.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/387123.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/387123.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/387123.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/387123.html</trackback:ping><description><![CDATA[<div>pl/sql表和记录一样，都是用户自定义的数据结构。record类似于c语言中结构（struct）而pl/sql表类似于c语言的数组或集合，只是这个数据的元素可以是用户自定义的类型。record可以存储一条记录，而pl/sql表可以存储多条record记录。<br />一，什么是记录（Record）？</div><div>&nbsp;由单行多列的标量构成的复合结构。可以看做是一种用户自定义数据类型。组成类似于多维数组。</div><div>将一个或多个标量封装成一个对象进行操作。是一种临时复合对象类型。</div><div>&nbsp;</div><div>&nbsp;记录可以直接赋值。RECORD1 :=RECORD2；</div><div>&nbsp;记录不可以整体比较.</div><div>&nbsp;记录不可以整体判断为空。</div><div>&nbsp;</div><div>二，%ROWTYPE和记录（Record）？</div><div>&nbsp;请区别%ROWTYPE和记录（Record）类型。%ROWTYPE可以说是Record的升级简化版。</div><div>&nbsp;区别在与前者结构为表结构，后者为自定义结构。二者在使用上没有很大区别。前者方便，后者灵活。在实际中根据情况来具体决定使用。</div><div>&nbsp;Record + PL/SQL表可以进行数据的多行多列存储。</div><div>&nbsp;</div><div>三，如何创建和使用记录？</div><div>&nbsp;</div><div>&nbsp; &#9312;创建记录类型</div><div>&nbsp; 语法：</div><div>&nbsp; TYPE &nbsp;记录名 &nbsp;IS RECORD&nbsp;</div><div>　　(&nbsp;</div><div>&nbsp; &nbsp;filed1 type1 [NOT NULL] [：=eXPr1],</div><div>　　 &nbsp; &nbsp; ....... ,</div><div>　　 &nbsp;filedN typen [NOT NULL] [：=exprn]&nbsp;</div><div>&nbsp; ）</div><div>&nbsp; 其中，filed1是标量的名字。</div><div>&nbsp;&nbsp;</div><div>&nbsp; &#9313;声明记录类型变量：</div><div>&nbsp; &nbsp;记录类型变量名 记录类型</div><div>&nbsp; &nbsp;</div><div>&nbsp; &#9314;填充记录。</div><div>&nbsp; &nbsp;</div><div>&nbsp; &#9315;访问记录成员</div><div>&nbsp; &nbsp;记录类型变量名.filed1</div><div>&nbsp; &nbsp;.........</div><div>&nbsp; &nbsp;记录类型变量名.filedN</div><div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp;</div><div>&nbsp; 注意：</div><div>&nbsp; 表字段类型修改后，还需要修改记录字段类型，有时候可能会忘记，从而出现错误。</div><div>&nbsp; 对于记录内每个字段（filed1.。。。），可以指定也可以使用%TYPE和%ROWTYPE动态指定记录字段类型。&nbsp;</div><div>&nbsp; 好处是表字段发生变化，记录字段自动改变。但是，由于每次执行前，遇到%TYPR或%ROWTYPE，</div><div>&nbsp; 数据库系统都会去查看对应表字段类型，会造成一定的数据库开销，如果系统中大量使用记录类型，则对性能会有一定影响。</div><div>&nbsp; 另外如果删除了某一字段，而自定义记录中使用了该字段，也会有可能忘记删除该字段。</div><div>&nbsp; &nbsp; &nbsp; &nbsp;对数据库负荷偏低的系统，性能问题一般可以不重点关注，但是对于高负荷数据库服务器，</div><div>&nbsp; &nbsp; &nbsp; &nbsp;各个环节都要考虑性能问题，每处节省一点出来，性能整体就有很大提高。</div><div>&nbsp;&nbsp;</div><div>&nbsp; 语法：</div><div>&nbsp; TYPE &nbsp;记录名 &nbsp;IS RECORD&nbsp;</div><div>　　(&nbsp;</div><div>&nbsp; &nbsp;filed1 table.Filed%Type [NOT NULL] [：=eXPr1] ,</div><div>&nbsp; &nbsp;filed2 table.Filed%Type [NOT NULL] [：=eXPr1] ,</div><div>　　 &nbsp; &nbsp; ....... ,</div><div>　　 &nbsp;filedn table.Filed%Type [NOT NULL] [：=exprn]&nbsp;</div><div>&nbsp; ）;</div><div>&nbsp;</div><div>&nbsp;例子：记录可以整体赋值</div><div>&nbsp;/*conn scott/tiger</div><div>&nbsp;Create Table &nbsp;empa &nbsp;As &nbsp;Select * From emp;</div><div>&nbsp;*/</div><div>&nbsp;Declare</div><div>&nbsp; &nbsp; &nbsp;Type EmpType is Record(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; EMPNO number(4),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ENAME &nbsp;varchar2(10),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; JOB varchar2(15),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; SAL number(7,2),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; DEPTNO number(2)</div><div>&nbsp; &nbsp; &nbsp;);</div><div>&nbsp; &nbsp;EmpRec1 &nbsp;EmpType;</div><div>&nbsp; &nbsp;EmpRec2 &nbsp;EmpType;</div><div>&nbsp;Begin</div><div>&nbsp; &nbsp;EmpRec1.Empno:=7369;</div><div>&nbsp; &nbsp;EmpRec1.Ename:='SMITH';</div><div>&nbsp; &nbsp;EmpRec1.Job:='CLERK';</div><div>&nbsp; &nbsp;EmpRec1.Sal:=800;</div><div>&nbsp; &nbsp;EmpRec1.Deptno:=10;</div><div>&nbsp; &nbsp;EmpRec2 := EmpRec1;</div><div>&nbsp; &nbsp;DBMS_output.put_line(EmpRec2.empno);</div><div>&nbsp;End;</div><div>&nbsp;例子：记录不可以整体比较，只可以比较记录字段</div><div>&nbsp;Declare</div><div>&nbsp; &nbsp; &nbsp;Type EmpType is Record(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; EMPNO number(4),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ENAME &nbsp;varchar2(10),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; JOB varchar2(15),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; SAL number(7,2),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; DEPTNO number(2)</div><div>&nbsp; &nbsp; &nbsp;);</div><div>&nbsp; &nbsp;EmpRec1 &nbsp;EmpType;</div><div>&nbsp; &nbsp;EmpRec2 &nbsp;EmpType;</div><div>&nbsp;Begin</div><div>&nbsp; &nbsp;EmpRec1.Empno:=7369;</div><div>&nbsp; &nbsp;EmpRec1.Ename:='SMITH';</div><div>&nbsp; &nbsp;EmpRec1.Job:='CLERK';</div><div>&nbsp; &nbsp;EmpRec1.Sal:=800;</div><div>&nbsp; &nbsp;EmpRec1.Deptno:=10;</div><div>&nbsp; &nbsp;if EmpRec1.sal &lt; EmpRec2.sal then</div><div>&nbsp; &nbsp; &nbsp;DBMS_output.put_line('Xiao Xiao Xiao');</div><div>&nbsp; &nbsp;end if;</div><div>&nbsp;End;</div><div>&nbsp;</div><div>&nbsp;例子：记录不可以整体判断为空，只可以判断记录字段。</div><div>&nbsp;Declare</div><div>&nbsp; &nbsp; &nbsp;Type EmpType is Record(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; EMPNO number(4),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ENAME &nbsp;varchar2(10),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; JOB varchar2(15),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; SAL number(7,2),</div><div>&nbsp; &nbsp; &nbsp; &nbsp; DEPTNO number(2)</div><div>&nbsp; &nbsp; &nbsp;);</div><div>&nbsp; &nbsp;EmpRec &nbsp;EmpType;</div><div>&nbsp;Begin</div><div>&nbsp; &nbsp;if EmpRec.ename is null then</div><div>&nbsp; &nbsp; &nbsp;DBMS_output.put_line('Kong Kong Kong'); &nbsp;</div><div>&nbsp; &nbsp;end if;</div><div>&nbsp;End;</div><div>&nbsp;</div><div>&nbsp;例子：使用%TYPE和%ROWTYPE动态指定记录字段。</div><div>&nbsp;/*conn scott/tiger</div><div>&nbsp;Create Table &nbsp;empa &nbsp;As &nbsp;Select * From emp;</div><div>&nbsp;*/</div><div>&nbsp;DECLARE</div><div>&nbsp; Type MyRecType Is &nbsp;Record</div><div>&nbsp; (</div><div>&nbsp; &nbsp;RENO &nbsp;EMPA.EMPNO%Type,</div><div>&nbsp; &nbsp;RENAME &nbsp; EMPA.ENAME%Type,</div><div>&nbsp; &nbsp;RJOB &nbsp; EMPA.JOB%Type</div><div>&nbsp; );</div><div>&nbsp; EmpRec &nbsp;MyRecType;</div><div>&nbsp;Begin</div><div>&nbsp; Select &nbsp; EMPNO, ENAME, JOB &nbsp;InTo &nbsp;EmpRec &nbsp;From empa Where empa.EMPNO = '7369';</div><div>&nbsp; If &nbsp;EmpRec.RJOB &nbsp;= 'CLERK' &nbsp;Then</div><div>&nbsp; &nbsp;DBMS_OUTPUT.PUT_LINE('Name: '||EmpRec.RENAME);</div><div>&nbsp; End If;</div><div>&nbsp;End;</div><div>&nbsp;</div><div>&nbsp;例子：数据集中的记录和记录类型中的数据关系。</div><div>&nbsp;DECLARE</div><div>&nbsp; Type MyRecType Is &nbsp;Record</div><div>&nbsp; (</div><div>&nbsp; &nbsp;RENO &nbsp;EMPA.EMPNO%Type,</div><div>&nbsp; &nbsp;RENAME &nbsp; EMPA.ENAME%Type,</div><div>&nbsp; &nbsp;RJOB &nbsp; EMPA.JOB%Type</div><div>&nbsp; );</div><div>&nbsp; EmpRec &nbsp;MyRecType;</div><div>&nbsp; vJob &nbsp;EMPA.JOB%Type;</div><div>&nbsp;Begin</div><div>&nbsp; Select &nbsp; EMPNO, ENAME, JOB &nbsp;InTo &nbsp;EmpRec &nbsp;From empa Where empa.EMPNO = '7369';</div><div>&nbsp; DBMS_OUTPUT.PUT_LINE('MyRecType.RJOB: '||EmpRec.RJOB);</div><div>&nbsp; EmpRec.RJOB &nbsp;:= '修改值后' &nbsp;;</div><div>&nbsp; DBMS_OUTPUT.PUT_LINE('MyRecType.RJOB: '||EmpRec.RJOB);</div><div>&nbsp; Select JOB &nbsp;InTo vJob &nbsp;from empa &nbsp;Where empa.EMPNO = EmpRec.RENO;</div><div>&nbsp; DBMS_OUTPUT.PUT_LINE('EMPA.JOB: '||vJob);</div><div>&nbsp;End;</div><div>&nbsp;/</div><div>&nbsp;</div><div>&nbsp;</div><div>四，使用记录向表中插入数据？</div><div>&nbsp;根据表结构合理安排记录字段。比如主外键。</div><div>&nbsp;如果用记录(RECORD)插入数据，那么只能使用记录成员；</div><div>&nbsp;如果用%ROWTYPE插入数据,可以直接使用%ROWTYPE。</div><div>&nbsp;</div><div>&nbsp;例子：使用记录成员向表中插入数据</div><div>&nbsp;DECLARE</div><div>&nbsp; Type MyRecType Is &nbsp;Record</div><div>&nbsp; (</div><div>&nbsp; &nbsp;RENO &nbsp;EMPA.EMPNO%Type,</div><div>&nbsp; &nbsp;RENAME &nbsp; VARCHAR2(10),</div><div>&nbsp; &nbsp;RJOB &nbsp; EMPA.JOB%Type</div><div>&nbsp; );</div><div>&nbsp; EmpRec MyRecType;&nbsp;</div><div>&nbsp;Begin</div><div>&nbsp; Select &nbsp; EMPNO, ENAME, JOB &nbsp;InTo &nbsp;EmpRec &nbsp;From empa Where empa.EMPNO = '7369';</div><div>&nbsp; DBMS_OUTPUT.PUT_LINE(EmpRec.RENO||' &nbsp;'||EmpRec.RENAME||' &nbsp;'||EmpRec.RJOB);</div><div>&nbsp;&nbsp;</div><div>&nbsp; EmpRec.RENO &nbsp;:= 1001;</div><div>&nbsp; EmpRec.RENAME := '杰克';</div><div>&nbsp; EmpRec.RJOB &nbsp;:= '办事员';</div><div>&nbsp; Insert InTo &nbsp;empa(EMPNO,ENAME,JOB) &nbsp;Values(EmpRec.RENO, EmpRec.RENAME,EmpRec.RJOB);</div><div>&nbsp;</div><div>&nbsp; Select &nbsp;EMPNO, ENAME, JOB &nbsp;InTo &nbsp;EmpRec &nbsp;From empa Where empa.EMPNO = '1001';</div><div>&nbsp; DBMS_OUTPUT.PUT_LINE(EmpRec.RENO||' &nbsp;'||EmpRec.RENAME||' &nbsp;'||EmpRec.RJOB);</div><div>&nbsp;End;</div><div>&nbsp;</div><div>五，使用记录更新数据？</div><div>&nbsp;如果用记录(RECORD)更新数据，那么只能使用记录成员；</div><div>&nbsp;如果用%ROWTYPE更新数据,可以直接使用%ROWTYPE。</div><div>&nbsp;</div><div>&nbsp;例子：使用%ROWTYPE向表中插入数据</div><div>&nbsp;DECLARE</div><div>&nbsp; vEmp empa%RowType;</div><div>&nbsp;Begin</div><div>&nbsp; Select &nbsp;* &nbsp;InTo &nbsp;vEmp &nbsp;From empa Where empa.EMPNO = '7369';</div><div>&nbsp; UpDate empa Set ROW = vEmp Where EMPNO = 1001;</div><div>&nbsp;End;</div><div>六，使用记录删除数据？</div>&nbsp;删除记录时，只能在delete语句的where子句中使用记录成员。&nbsp;<img src ="http://www.blogjava.net/kxbin/aggbug/387123.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-09-05 21:52 <a href="http://www.blogjava.net/kxbin/articles/387123.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>