摘要: fromhttp://geekswithblogs.net/johnsPerfBlog/archive/2008/04/16/ntext-vs-nvarcharmax-in-sql-2005.aspxI recently profiled a sproc that makes heavy use of the TSQL SUBSTRING function (hundreds of thousands of times) to see how it performs on a SQL 2005 database compared to a SQL 2000 database. Much to 阅读全文
posted @ 2014-03-26 17:02 princessd8251 阅读(243) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.orafaq.com/wiki/JDBCJDBC driversOracle provides three categories of JDBC drivers:JDBC Thin Driver (no local SQL*Net installation requir... 阅读全文
posted @ 2014-03-26 15:34 princessd8251 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 一.JDBC 连接Oracle 说明JDBC 的应用连接Oracle 遇到问题,错误如下:ORA-12505,TNS:listener does not currently know of SID given in connect descriptor TheConnection descripto... 阅读全文
posted @ 2014-03-26 15:21 princessd8251 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 最近,一个系统升级后,发现系统运行非常慢。CPU消耗将近100%。用top查看系统,发现一个进程占用了几乎90%的CPU。用以下语句查出进程相应会话正在执行的操作:select b.spid, a.sid, a.username, s.sql_text from v$session a , v$pr... 阅读全文
posted @ 2014-03-26 01:47 princessd8251 阅读(707) 评论(0) 推荐(0) 编辑
摘要: 生产环境中发现一条语句很慢,拿回来一看,其实是一个简单的Group By语句:表CCMMT的数据量比较大,5M多条记录。1、SQL> select CDE, CID2fromCCMMT3GROUPBY CDE, CID4havingmax(ADT) select DISTINCT CDE, CID... 阅读全文
posted @ 2014-03-26 01:47 princessd8251 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 数据库版本: 10.2.0.3;案例背景:我们有一个Java程序会从一个配置文件中读取并执行以下一条SQL语句,由查询结果确认是否存在满足条件的数据记录,然后据此再执行后续代码。最初的语句为:SQL代码Selectcount(1)asrowcountfromB2B_BIZ_KEYBWHEREEXIS... 阅读全文
posted @ 2014-03-26 01:46 princessd8251 阅读(241) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.dbaref.com/home/dba-routine-tasks/tracingsessionsFor Query Performance issues the typical requirement is to record wait and bind variable information for queries. This is achieved using 10046 with level 12.The following examples outline how to set the event in various scenarios:Trace 阅读全文
posted @ 2014-03-26 01:37 princessd8251 阅读(206) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.dbaref.com/home/oracle-11g-new-features/costbasedtransformationsoracledatabase10gto11gchangeIn Oracle Database 11g three new enhancements have been made to the cost based transformations. The three enhancements are turned on by default and are controlled by the optimizer_features_enab 阅读全文
posted @ 2014-03-26 01:37 princessd8251 阅读(245) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.dbaref.com/database-tuning/generatingvarioustypesofawrreportsRunning a Basic ReportWith appropriate licenses for AWR, you may generate an AWR report by executing the following script and pick the two snapshots you want to use for the sample :$ORACLE_HOME/rdbms/admin/awrrpt.sqlDependin 阅读全文
posted @ 2014-03-26 01:37 princessd8251 阅读(142) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.dbaref.com/monitoring-blocking-sessionsMany times we see the alert from OEM "Database instance PRODDB1 Warning Session 501 blocking 86 other sessions Feb 6, 2012 11:34:01 AM EST etc............". We have been asked to look at it. Now lets analyse this problem.SQL> SELECT 阅读全文
posted @ 2014-03-26 01:37 princessd8251 阅读(287) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.dbaref.com/tracing-performance-issues-in-oracle/tracingaspecificsqlstatementYou want to trace a specific SQL statement to find where the database is spending its time during the execution of the statement.1. Setup the traceSQL> alter session set events 'sql_trace level 12'; 阅读全文
posted @ 2014-03-26 01:34 princessd8251 阅读(239) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.dbaref.com/monitoring-active-sqlThe real-time SQL monitoring feature of Oracle Database enables you to monitor the performance of SQL statements while they are executing. By default, SQL monitoring is automatically started when a SQL statement runs parallel, or when it has consumed at 阅读全文
posted @ 2014-03-26 01:23 princessd8251 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Shows current statements for active sessionsselect p.username pu , s.username su,s.status stat, s.sid ssid, s.serial# sser , substr(p.spid,1,8) spid,s... 阅读全文
posted @ 2014-03-26 01:21 princessd8251 阅读(247) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.morganslibrary.org/reference/hints.htmlGeneral InformationHint SectionsAccess Path Hints (Cluster)Miscellaneous HintsQuery Rewrite HintsAccess Path Hints (Table)Model ClauseQuery Transformation HintsCache HintsOnline Application UpgradeSemantic Effect HintsGeneral PurposeOptimization 阅读全文
posted @ 2014-03-26 00:46 princessd8251 阅读(434) 评论(0) 推荐(0) 编辑
摘要: fromhttp://www.morganslibrary.org/reference/joins.htmlGeneral InformationLibrary NoteThe Library is currently in the process of being upgraded from Oracle Database Version 11.2.0.3 to 12.1.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) 阅读全文
posted @ 2014-03-26 00:44 princessd8251 阅读(152) 评论(0) 推荐(0) 编辑
摘要: ITpub 上有个帖子 http://www.itpub.net/thread-1852068-1-1.html生产数据库版本10.2.0.4测试数据库版本10.2.0.1sql在生产库运行就使用了谓词推进,效率很高,只要3s,但是在测试库没有使用谓词推进,需要6分30s。大家帮忙看看如何优化或者强... 阅读全文
posted @ 2014-03-26 00:40 princessd8251 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 转自http://www.dbaxiaoyu.com/archives/1872Itpub上的一篇帖子http://www.itpub.net/thread-1851403-3-1.html ,其中是提到sql语句排序与不排序执行效率为何变化如此之大。版本oracle 9I :select *from a1 twhere t.j_uptime >=to_date('2014-02-01', 'yyyy-mm-dd')and t.j_uptime create table table01 as select * from dba_objects;SQL> 阅读全文
posted @ 2014-03-26 00:26 princessd8251 阅读(424) 评论(0) 推荐(0) 编辑