Upload
others
View
72
Download
0
Embed Size (px)
Citation preview
<Insert Picture Here>
Oracle Database 11g 新特性
售前咨询顾问 李强 Oracle Sales Consultant
Oracle Database 11g 发布
• Oracle Database 11gR2 于2009年9月发布
• 美国纽约时间2007.7.11,Oracle 宣布推出
Oracle Database 11g
• 相对于3年前发布的10g,11g 新增了400多项功能
• 开发工作量达到了3.6万 人/月
• 相当于1000名员工连续研发3年
Oracle是最快、性价比最高的数据库
30年技术持续更新
Exadata Storage
Real Application Testing
Advanced Compression
Database Valut Automatic Storage Management
Transparent Data Encryption
Self Managing Database
XML Database
Oracle Data Guard
Real Application Clusters
Flashback Query
Virtual Private Database
Built in Java VM
Partitioning Support
Built in Messaging
Object Relational Support
Multimedia Support
Data Warehousing Optimizations
Parallel Operations
Distributed SQL & Transaction Support
Cluster and MPP Support
Multi-version Read Consistency
Client/Server Support
Platform Portability
Commercial SQL Implementation
Oracle 2 Oracle 9i
Oracle 5
Oracle 6
Oracle 7
Oracle 8
Oracle 8i
Oracle 10g
Oracle 11g
1977
Oracle 11g价值取向
• 最易于管理
• 最高的服务质量
• 最高的性能和扩展能力, 容错保护,
最大范围安全能力, 最好的信息管理
• 最低化改变风险
Agenda
• Oracle Database 11g 新特性
• 信息管理
• 高可用性
• 集群和存储技术
• 数据库性能
• 讨论和问答
<Insert Picture Here>
Oracle 11g 信息管理
自动化和自我管理
自动调优
建议顾问
工具
Sto
rag
e
Backu
p
Me
mo
ry
Ap
ps
/SQ
L
Sc
he
ma
RA
C
Reco
very
Rep
licati
on
Testi
ng
R2
自适应
综合
低消耗
11g自动内存管理
• 一个动态参数 – MEMORY_TARGET
• 根据负载自动调整
• 适用于:
• Linux
• Windows
• Solaris
• HPUX
• AIX
O/S Memory
O/S Memory
PGA
SGA
PGA
SGA
Oracle Database 11g 内存参数
DB_KEEP_CACHE_SIZE
DB_RECYCLE_CACHE_SIZE
DB_nK_CACHE_SIZE
LOG_BUFFER_SIZE
RESULT_CACHE_SIZE
SHARED_POOL_SIZE
DB_CACHE_SIZE
LARGE_POOL_SIZE
JAVA_POOL_SIZE
STREAMS_POOL_SIZE
SGA_TARGET
SGA_MAX_SIZE
MEMORY_MAX_TARGET
MEMORY_TARGET
Others
PGA_AGGREGATE_TARGET
Oracle Partitioning 10年技术革新
Core functionality
Oracle8 Range partitions, global range index
Oracle8i Hash and composite range-hash partitioning
Oracle9i List partitioning
Oracle9i R2 Composite range-list partitioning
Oracle 10g Global hash indexes
Oracle 10g R2 1M partitions per table
Partitioning by reference
Virtual column partitioning
Automatic interval partitioning
New composite partitioning:
range-range, list-range,
list-list, list-hash
分区增强功能
• 引用分区
• 间隔分区
• 系统分区
• 组合分区增强功能
• 基于虚拟列的分区
引用分区 REF
ORDERS 表
2006 年 1 月
... ...
2006 年 2 月
ORDERITEMS 表
2006 年 1 月
... ...
2006 年 2 月
• RANGE(order_date)
• 主键 order_id
• RANGE(order_date)
• 外键 order_id
• RANGE(order_date)
• 外键 order_id
按引用分区 通过 PK-FK 关系继承分区键
间隔分区 interval partition
Table SALES
Jan 2006
... ...
Feb 2006 Mar 2006 Jan 2007 Oct 2009 Nov 2009
...
INSERT INTO sales (order_date
DATE, ...)
VALUES ('04-MAR-2006',...);
New segment is automatically allocated
CREATE TABLE sales (order_date DATE, ...)
PARTITON BY RANGE (order_date)
INTERVAL(NUMTOYMINTERVAL(1,'month')
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006');
系统分区-案例
CREATE TABLE systab (c1 integer, c2 integer)
PARTITION BY SYSTEM
(
PARTITION p1 TABLESPACE tbs_1,
PARTITION p2 TABLESPACE tbs_2,
PARTITION p3 TABLESPACE tbs_3,
PARTITION p4 TABLESPACE tbs_4
);
Inserting into the system partitioned table:
INSERT INTO systab PARTITION (p1) VALUES (4,5); /*Partition p1
*/
INSERT INTO systab PARTITION (1) VALUES (4,5); /* First
partition */
INSERT INTO systab PARTITION (:pno) VALUES (4,5); /* pno bound
to 1/p1 */
组合分区--功能增强
• Range Top Level
• Range- Range
• List Top Level
• List-List
• List-Hash
• List-Range
• Interval Top Level
• Interval-Range
• Interval-List
• Interval-Hash
• RANGE, LIST, INTERVAL
SP1
SP2
SP3
SP4
…
…
…
…
• LIST, RANGE, HASH
SP1 SP1 SP1 SP1
SP2 SP2 SP2 SP2
SP3 SP3 SP3 SP3
SP4 SP4 SP4 SP4
完全组合分区
• 二维分区模式
• Oracle 数据库 11g 中的扩展
• 例如列表-范围:
• 按国家/地区分区,然后再按星期分区
• 按业务范围分区,然后再按星期分区
范围 列表 散列
范围 11g 9i 8i
列表 11g 11g 11g
虚拟列分区
12500 Adams
12507 12 Blake
12666 12
12875 12 Smith
King
CREATE TABLE accounts
(acc_no number(10) not null,
acc_name varchar2(50) not null, ...
acc_branch number(2) generated always as
(to_number(substr(to_char(acc_no),1,2)))
partition by list (acc_branch) ...
12
• Base table with all attributes ...
• ... is extended with the virtual (derived) column
• ... and the virtual column is used as partitioning key
32320 Jones
32407 32 Clark
32758 32
32980 32 Phillips
Hurd
32
...
• 确定集群性能问题
• 定位问题:
• 全局资源,e.g. IO, global locks
• 高负载SQL语句, 热块等
• Global cache interconnect traffic
• 网络延时
• 实例响应时间不均衡
ADDM for RAC
Database ADDM
AWR
Instance ADDM
Self-diagnostic Engine
Inst1 Instn
…
Data Recovery Advisor 减少宕机时间
• 自动诊断数据故障,提供修复选项,由用户决定执行
• 自动根据症状判断是何种故障
• E.g. ―open failed‖ 是因为datafiles f045.dbf 和 f003.dbf 无法访问
• 故障信息记录在automatic diagnostic repository (ADR)
• 自动运行健康检查,在用户发现之前就报告问题
• 自动决定恢复策略
• 归类故障类型
• 显示可行的恢复选项
• 显示每种选项可能的数据丢失
• 用户可以选择自动执行何种恢复
Data Recovery Advisor OEM界面
… …
Client Client
… Client
Capture DB Workload
Real Application Testing – Database Replay
• 在测试环境中重新创建实际生产数据库负载
• 可以按照生产系统的时间环境在测试系统中重现工作负载
• 在投入生产系统之前分析和解决问题
Middle Tier
Storage
Oracle DB
Replay DB Workload
Production Test
Test migration to RAC
Capture Replay Analysis &
Reporting Process
…
Real Application Testing – SQL Performance Analyzer (SPA)
Storage
Production (10.2)
Test (11.1)
Capture
SQL
Transport
SQL
Execute SQL
Pre-change
Execute SQL
Post-change
Compare
Perf
Storage
Mid-Tier
Clients
STS
<Insert Picture Here>
Oracle 11g 高可用性
Active Data Guard
Physical Standby
Database
Primary
Database
Real-time
Queries
持续传输和应用Redo
实时查询/报表
• physical standby在redo apply同时,支持只读查询
• primary / standby 均支持RAC
• 查询结果在transaction级别一致
• 对广大physical standby用户立即可以带来好处
• DR + 实时查询—业界独一无二的技术 – 无闲置资源
• 支持所有的数据类型
• 支持多达30个Active Standby数据库(11gR2)
Updates
Primary
Database
Queries
Physical Standby
Database
Snapshot Standby 利用Standby Database 做测试
Snapshot Standby
Database
Updates Queries
Physical Standby
Database
• 保证零数据丢失, 但不提供实时查询/快速切换
• 测试阶段physical standby可以读写打开,测试后继续同步
Standby
Redo
Logs
RFS LNS
Online Redo Logs
Oracle Net Primary
Database
LGWR
Data Guard进程架构(11g) 异步传输(ASYNC)
SGA
Redo Buffer
MRP - physical
LSP - logical
Active
Standby
Database
Queries, Reports
Testing & Backups
MRP LSP
User Transactions
Data Guard 性能改善
• 更快的 Failover
• Fast-Start Failover,秒级
• 更快的 Redo传输
• 最大性能模式下优化的async传输
• redo 压缩传输: log_archive_dest_n新增 compression 参数
• 更快的 Redo Apply
• 并行media recovery
• 更快的 SQL Apply
• 内部优化
• 更快的physical standby 增量备份
• 支持block change tracking
Oracle 数据库 11gR2 Data Guard 增强
• Active Data Guard — 服务质量
• 可在 0 到“n”秒内配置备用查询 SLA
• 在备用数据库上设置最大允许数据延迟
• 如果超过最大值,则数据库向应用程序返回错误
• 应用程序可以将查询重定向到主数据库
• 自动块修复
• 使用备用数据库中的完好版本检测和修复受损块
• Data Guard — 网络利用率
• 针对带宽有限的 WAN 传输redo压缩内容
• 不仅仅用于在传播中断之后resolving redo gaps.
Flashback – 修复人为错误操作
Flashback Database
Flashback Data Archive
and Transaction
Flashback Tables
Flashback Query
Select * from orders AS OF ‗Midnight31-Dec-2004‘
Total Recall
就像在数据库中加入 ―时间维度‖
Flashback Data Archive 如何工作?
• 历史数据的主要来源是undo data
• 历史数据存放在archive内自动生成的历史表
• 事务和它的 undo records 被标记 • undo records 不会被回收直至历史数据被归档
• 新的后台进程(fbda) 异步捕获历史数据 • 缺省捕获间隔是 5 minutes
• 捕获间隔可以基于系统情况自我调整
• 进程尽可能从buffer cache中读取 undo
data,以达到更好的性能
• INSERTs 不产生历史记录
<Insert Picture Here>
Oracle 11gR2 集群和存储管理
RAC 是主流 — Gartner Group
0
3,000
6,000
9,000
12,000
15,000
FY02 FY03 FY04 FY05 FY06 FY07 FY08 FY09
(Q2)
客户
数
• Oracle Grid Infrastructure (OGI) 包括:
• Oracle Clusterware
• Oracle Automatic Storage Management (ASM)
• Oracle ASM Cluster File System (ACFS)
• OGI 提供的架构软件 (如存储管理、集群软件), 通常由系统管理员来管理
Oracle Grid Infrastructure
Oracle Clusterware 11gR2
Node 1 Node 2 Node 3 Node 4
Consolidated Pool of Storage with Automatic Storage Management (ASM)
Oracle Clusterware
Oracle ASM / ACFS
Oracle RAC Protected App A
Protected App B
• Oracle Clusterware 是 Oracle Grid Infrastructure (OGI) 的一个主要部分
• Oracle Clusterware 可以用来保护RAC数据库和其他应用
• 它提供了Oracle ACFS (可选) 的基础– 所有数据可以由 ASM来管理
你不再需要任何其他第三方的集群软件
RAC One Node概述
• 新的单实例RAC配置
• 把多个实例整合到一个服务器上(操作系统整合)
• 为运行在物理服务器上数据库提供服务器虚拟化的价值
• 数据库实例在cluster节点之间的在线迁移
• 为单实例数据库滚动安装补丁
• 固有的cluster failover功能提供高可用性保护
• 在线升级到RAC
• 跨接所有Oracle数据库的标准化部署
RAC-One Node部署
DB1 DB2
Server A
Common Shared Storage
Single Cluster
DB3 DB4 DB5
Server B Server C
Cluster Failover - 失败切换
Common Shared Storage
Single Cluster
DB
Server A Server B
Cluster Failover - 失败切换
Common Shared Storage
Single Cluster
DB
Server A Server B
Cluster Failover - 失败切换
Common Shared Storage
Single Cluster
DB
Server A Server B
OMotion – 有计划的在线迁移
DB1 DB2
Common Shared Storage
Single Cluster
DB4 DB5 DB3
Client Connections
Server A Server B Server C
OMotion – 有计划的在线迁移
DB1 DB2
Common Shared Storage
Single Cluster
DB2 DB4 DB5 DB3
Client Connections
Server A Server B Server C
OMotion – 有计划的在线迁移
DB1 DB2
Common Shared Storage
Single Cluster
DB2 DB4 DB5 DB3
Client Connections
Server A Server B Server C
OMotion – 有计划的在线迁移
DB1 DB2
Common Shared Storage
Single Cluster
DB2 DB4 DB5 DB3
Client Connections
Server A Server B Server C
OMotion – 有计划的在线迁移
DB1
Common Shared Storage
Single Cluster
DB2 DB4 DB5 DB3
Client Connections
Server A Server B Server C
Oracle 数据库 11gR2 ASM 支持所有文件类型
• ASM 现在支持所有类型的文件
• 数据库文件
• 共享集群件文件(OCR/VotingDisk)
• 文件系统文件
• ASM 集群文件系统 (ACFS)
• 第三方文件系统
数据库数据文件
OCR 和 表决文件
二进制文件
文件 系统
AS
M C
luste
r F
ile S
yste
m
Siebel
Web
PSFT
DW ODS
SOA IMDB OC4J
APACHE
EBS
RAC One
Oracle 数据库 11gR2 ASM 集群文件系统 (ACFS)
Siebel
Web
PSFT
DW ODS
SOA IMDB OC4J
APACHE
EBS
数据库数据文件
OCR 和 表决文件
二进制文件
文件 系统
AS
M C
luste
r F
ile S
yste
m
RAC One
• 通常目的的可扩展文件系统
• 单节点和集群
•支持多OS平台 (初始版本在Linux and Windows发布)
• 数据存储在 ASM 中
• 继承所有 ASM 可管理性优势 • 优化的磁盘布局
• 联机添加/删除/重新平衡磁盘
• 集成的镜像
• 只读快照
Oracle 数据库 11gR2 其他 ASM 增强
• 改善的管理
• ASM 安装和配置助手
(ASMCA)
• 功能完备的 ASMCMD
• ASM 文件访问控制
• ASM 磁盘组重命名
• 数据文件到磁盘映射
• 可调优的性能
• 智能数据放置
不经常 访问的 数据
经常 访问的 数据
集群运行状况管理器 集群和系统级别的根本原因分析
• 检测分析OS/集群资源相关的性能问题和故障
• 跟踪节点/进程/设备级的资源消耗
• 根本原因分析
• 预测故障
• 防止故障
• 提供警报
• 未来:主动地自动修复问题
<Insert Picture Here>
Oracle数据库性能
Advanced Compression
• Oracle Database 11g 提供综合压缩能力 • 结构化/关系型数据压缩
• 非结构化数据压缩
• 备份数据压缩
• 网络传输压缩
• 支持大批量数据装载和 DML (INSERT,UPDATE,DELETE) • 典型压缩比 2x to 3x
• 减少资源需求和成本 • 存储
• 网络带宽
• 内存使用
Redo logs Backups Standby
OLTP 表压缩
• Oracle Database 11g 将压缩扩展到 OLTP
• 支持 DML 操作
(INSERT, UPDATE, DELETE)
• 新算法大大降低写操作的性能损耗
• 批量压缩,对大多数OLTP交易无影响
• 不影响读操作
• 甚至性能可能改善: 节约IO,提高内存效率
OLTP表压缩
Overhead
Free Space
Uncompressed
Compressed
Inserts are uncompressed
Block usage reaches PCTFREE – triggers Compression
Inserts are again uncompressed
Block usage reaches PCTFREE – triggers Compression
• 自适应、持续的压缩
• 块使用到PCTFREE 时自动触发压缩
• 有效消除delete产生的碎片,充分利用空间
使用OLTP表压缩
• database compatibility 至少 11.1
• 扩展 ‘COMPRESS’ 语法 • COMPRESS [FOR {ALL | DIRECT_LOAD} OPERATIONS]
• DIRECT_LOAD (DEFAULT)
• 指10g及以下版本的Bulk load操作
• ALL
• OLTP + Direct loads
• 新建表时制定压缩
• 现有表只针对direct load打开压缩
• 只压缩新数据,不影响原有数据
ALTER TABLE t2 COMPRESS
CREATE TABLE t1 COMPRESS FOR ALL OPERATIONS
服务器端查询结果高速缓存 Result Cache
• 把复杂查询的结果缓存到cache中
• 复杂查询对服务器压力非常大
• 把复杂查询的结果缓存到cache中,类似查询不需要重复查询操作
• 大大提高常用复杂查询的效率,并降低对服务器的压力
join
join
T1 GBY
join
T2 T3
GBY
join
T4 join
T5 T6
join
join
T1 GBY
join
T2 T3
GBY
join
T4 join
T5 T6
Q1: build query cache join
join
T1 GBY
join
T2 T3
GBY Q2: Use it transparently
cache
查询结果高速缓存的使用 Result Cache
• 设置RESULT_CACHE_MODEL参数 • MANUAL:使用result_cache的hint
• FORCE:强制使用
更多Oracle Database 11g亮点
• Performance and Scalability
• Query Result Cache
• TimesTen Cache Enhancements
• RAC Scalability Enhancements
• High Availability
• Data Recovery Advisor
• Readable Physical Standby
• VLDB/ILM
• Interval and Referential Partitioning
• Enhanced Compression
• Manageability and Diagnosability
• Support Workbench
• SQL Performance Analyzer
• SQL Test Case Builder
• Security
• Tablespace and LOB Encryption
• Secure Configuration
• Business Intelligence
• BI Publisher Reporting
• Supermodels for Data Mining
• Unstructured Data Management
• Enhanced XML indexing
• Storage & Query of Semantic Content
• Developer Productivity
• APEX 3.0 including support for Flash Charting and PDF output
• Improved PHP Scalability
• .NET Improvements
• Simple compilation of PLSQL and Java Stored Procedures
11gR2升级路径
10.2.0.2
11.1.0.6
10.1.0.5
9.2.0.8
11.2