orcle优化
来源:互联网 发布:部分背包问题 贪心算法 编辑:程序博客网 时间:2024/04/28 09:46
sql语句优化
1.select子句中避免使用"*"
2.尽量多用commit语句
3.用exists代替in
4.尽量使用共享池已有的sql语句(如通过视图查看select sql_test from v$sqlarea);
优化器
rule(基于规则),cost(基于成本),choose(选择性)。参数:
all_rows,first_rows_n,first_rows,choose,rule
select parameter optimizer_mode;
alter session set optimizer_moder=first_rows_100;
i/o操作作优化
调整sga
1.字典的高速缓存
select sum(gets),sum(getmisses),1-(sum(getmisses)/sum(gets)) 'dictionary hit ratio' from
v$rowcache;
2.数据高数缓存
select name,value from v$sysstat where name in('consistent gets','db block gets','physical
reads');
使用索引
1.创建单列索引 create index employ_name on.scott.emp(empname);
2.重建索引 alter index employee_noname rebulid online;
使用数据簇
create cluster position (id number(1))
size 100
hash is id
hashkeys 10000;
create table depost2(
postno char(3) not null,
postname varchar(30) unique null,
ifvoid number(1) defualt 0 check (ifviod between 0 and 1)
)
cluster position(ifvoid)
防止访问冲突
加锁 lock table 表名|视图 in 锁类型 mode [nowait]
lock table scott.emp in exclusive mode ;
合理设计事务
set transaction read only;
分散文件
create tablespace tabdata
datafile 'e:/oracldata/tabdata01.dbf'
online;
create tablespace inddata
datafile 'e:/oracldata/inddata.dbf'
online;
create table department(
departno char(3) not null,
departname varchar2(30) not null,
telephone varchar2(2) not null
)
create tablespace depart_pk
on departno
tablespace inddata;
- orcle优化
- orcle
- ORCLE
- orcle 点点滴滴
- orcle监听
- orcle 分页
- orcle数据库
- orcle 序列
- orcle命令
- Orcle instr
- orcle排序
- Orcle 锁
- FQA for ORCLE
- Orcle急急如律令 = =!
- [转]Orcle转SQL
- orcle方案创建
- orcle 5500 em打不开
- ORCLE RAC 安装PDF
- uml 静态视图泛化
- 使用 IBM Rational Software Architect 通过编程方式生成 UML 模型
- 跟我一起学Windows Workflow Foundation(3)
- 查看端口的方法
- 哪些人不适合去做科研(转)
- orcle优化
- 如何查看端口 +如何关闭开放的端口
- 关于Qt
- 跟我一起学Windows Workflow Foundation(4)
- 中国100句绝美爱情诗
- 利用视窗系统内置功能轻松查看端口使用情况(图)
- 跟我一起学Windows Workflow Foundation(5)
- 9.22 继续加油!学习~
- 深思