[bbk3019] 第60集 - Chapter 15-Application Tuning(00)

Objectives

After completing this lesson,you should be able to do the following:

  • Explain the role of the DBA in tuning applications.
  • Move tables using the ALTER TABLE command.
  • Redefine a table online
  • Create different types of indexes
  • Build and manage index-organized tables
  • Explain and plan OLTP,DSS,and hybrid systems

The Role of DBA

  • Application tuning is the most important part of tuning
  • DBAs are not alwarys directly involved in application tuning.
  • However,DBAs must be familiar with the impact that poorly written SQL statements can have upon database performance.

Moving Tables

Tables can be moved using the ALTER TABLE command.This allows:

  • Privileges and constraints to be kept.
  • The table structure to be changed.
  • Movement to another tablespace.
  • The command to be parallelized.
Syntax
SQL>ALTER TABLE hr.employees

MOVE

TABLESPACE users;

通过moving table 方式,要比create table tab_name as select * from tab_name;方式要安全、有效、可靠的多.

Redefining a Table Online

Online table redefining enables you to:

  • Modify the storage parameters of the table.
  • Move the table to a different tablespace in the same schema.
  • Add support for parallel queries
  • Add or drop partitioning support
  • Re-create the table to reduce fragmentation
  • Change the organization of a normal table(heap organized) to an index-organized table and vice versa.
  • Add or drop a column.

B-Tree Indexes

Rebuilding Indexes

To assist in the rebuilding of indexes use:

  • ONLINE:Keeps the index avaliable during the rebuilding operation
  • COMPUTE STATISTICS:Collects the statistics while rebuilding the index( 过时了)

Compressed Indexes

When creating the index:(very simply->add keyword COMPRESS when create index.)

CREATE INDEX emp_last_name_idx
ON hr.employees
(last_name,first_name)
COMPRESS;

When rebuilding the index:

ALTER INDEX emp_last_name_idx REBUILD COMPRESS;

Specify NOCOMPRESS(the default) to disable key compression.

 

 

 

 

转载于:https://www.cnblogs.com/arcer/archive/2013/05/03/3056306.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值