2016-0318
--查看session和process上限和峰值
SELECT RESOURCE_NAME,MAX_UTILIZATION,LIMIT_VALUE FROM V$RESOURCE_LIMIT;
--查看oracle缓存的命中率
select 1 - ((physical.value - direct.value - lobs.value) / logical.value)
     "Buffer Cache Hit Ratio"
  from v$sysstat physical,v$sysstat direct,v$sysstat lobs,v$sysstat logical
  where physical.name = 'physical reads'
  an 阅读全文>>
                
标签: Oracle 数据库优化 oracle优化 阅读:3017
2011-1118
下面是总结一下几种数据库要查询前n条记录的方法:

1. ORACLE
SELECT * FROM TABLE1 WHERE ROWNUM<=N
HQL: from table1 t order by t.createTime desc where rownum<=n

2. INFORMIX
SELECT FIRST N * FROM TABLE1

3. DB2
SELECT * ROW_NUMBER() OVER(ORDER BY COL1 DESC) AS ROWNUM WHERE ROWNUM<=N
或者
SELECT COLUMN FROM TABLE FETCH FIRST N ROWS O 阅读全文>>
标签: 数据库 前N条记录 阅读:6948