Ase 15 新特性介绍

64
ASE 15.x ASE 15.x 迁迁 迁迁 黄黄黄 [email protected]

description

相关视频讲解在:http://www.tudou.com/programs/view/IP4ruL1qp_E/

Transcript of Ase 15 新特性介绍

Page 1: Ase 15 新特性介绍

ASE 15.xASE 15.x

迁移 迁移

黄育云[email protected]

黄育云[email protected]

Page 2: Ase 15 新特性介绍

内容提要 内容提要

Sybase ASE 数据库简介

ASE 15 新功能

迁移至 ASE 15

Page 3: Ase 15 新特性介绍

Sybase ASESybase ASE 数据库简介数据库简介

Sybase 公司创建于 1984 年,早期专注于数据管理软件

Sybase 1987 年推出数据库产品 SQL Server 商用版本

Sybase 数据库产品 ASE 主要技术特点: 数据库业界首用 C/S 结构,从而利用客户端硬件资源 采用多线程结构,减少主机系统硬件资源开销,是 OS 级数据库 采用开放技术架构, Sybase 数据库软件在客户端和服务器端都提

供了开放 API 接口,便于第三方软件开发。 在数据库服务器中,首次采用存贮过程,提高了数据库 SQL 程序的

运行效率和运行安全性。

Page 4: Ase 15 新特性介绍

Sybase ASESybase ASE 的主要版本的主要版本

SQL Server 11.0 : 1995 年 12 月发布

ASE 11.5 : 1997 年 9 月发布

ASE 11.9.2 : 1998 年 10 月发布

ASE 12.0 : 1999 年 12 月发布

ASE 12.5 : 2001 年 6 月发布

ASE 15.0 : 2005 年 9 月发布

目前最新版本是 ASE 15.0.3

Page 5: Ase 15 新特性介绍

ASE 15 ASE 15 新功能 新功能

新功能 大容量存储 (VLSS) 支持 计算列 & 函数索引 用户定义函数

表分区

高性能:新一代查询优化器

集群 / 网格技术

Page 6: Ase 15 新特性介绍

VLSSVLSS 功能增强功能增强

新的数据容量扩充 数据库设备数:从以前的 256 个扩大到 2,147,483,647(2^31)

sp_configure “number of devices”, 1000

单个数据库设备容量:从以前版本的 32GB 扩大到 4TBdisk init name = “data_device”,physname = “/opt/devices/data_device.dat”,vdevno = 64, size = “2T”

单个数据库容量:从以前版本的 4TB 扩大到 32TB

单个 ASE 服务器的数据容量:从以前版本的 8TB 扩大到1EB ( 1EB=1024PB , 1PB=1024TB )

Page 7: Ase 15 新特性介绍

VLSSVLSS 功能增强功能增强

长标识符名 取消以前版本标识符名 30 个字符长度的限制: 扩大到 255 个字符 仍限为 30 个字符 : login name, server name, database

name, password,cursor name, application name, device name 等。

对象级恢复 可从数据库备份的 dump 文件中恢复制定对象

可离线作数据库一致性检查 (dbcc)

数据库系统表采用行级锁

UnsignedINT/BigINT bigint : 为 8 个 byte 字长 unsigned bigint, unsigned int, unsigned smallint

Page 8: Ase 15 新特性介绍

计算列和函数索引计算列和函数索引

一些定义 计算列 – 由一个表达式定义 , 可用本行的列名、 函数、算术运算符

等组成。 计算列的索引 – 索引的键值包含一个或多个计算列。 函数索引 – 索引的键值为一个表达式。 确定性 – 一个表达式在相同输入的条件下返回结果是否为确定的。

确定性 & 物化 计算列可以为确定性的,也可以为不确定性的。 计算列可以为物化的 ( 先计算好列值并存到表中 ) ,也可为非物化的 ( 虚拟列 ) 。 建索引的计算列必须是物化的列 , 但不需要确定性。 函数索引必须总是物化的,同时必须具有确定性。

Page 9: Ase 15 新特性介绍

计算列计算列语法 :

create table [database.[owner].] table_name

(column_name{datatype

| {compute | as} computed_column_expression

[materialized | not materialized] }

create table rental

(cust_id int, start_date as getdate()materialized, prod_id int)

create index ind_start_date on rental (start_date)

限制: 计算列表达式 只能使用同一行中的列名

可以使用 SQLJ 函数绕过这个限制 不能删除在计算列中已经使用的列。 不要修改计算列的值

Page 10: Ase 15 新特性介绍

基于函数的索引基于函数的索引

语法 :create [unique] [clustered|nonclustered] index index_name

on [[ database.] owner.] table_name

(column_expression [asc | desc] [, column_expression [asc | desc]]...

CREATE INDEX generalized_index on parts_table

(general_key(part_no,listPrice, part_no>>version)

它对用户自定义排序或 DSS 应用有用限制 列表达式 必须是可索引的数据类型

不能为 bit, text, image, java class 不能使用子查询、聚集函数、局部变量或者其它计算列 可使用 SQLJ 函数

Page 11: Ase 15 新特性介绍

SQL UDF---SQL UDF--- 用户定义函数用户定义函数SQL UDFs. 返回单个值 函数体中可包含多条 SQL 语句 能够用在 TSQL 中任何表达式可用的地方

创建 SQL UDFCREATE  FUNCTION [ owner. ] function_name     ( [ { @parameter_name [AS] parameter_datatype [ = default ] } [ ,...n ] ] )

RETURNS return_datatype

[ WITH RECOMPILE]

AS

[BEGIN]     function_body     RETURN scalar_expression

[END]

Page 12: Ase 15 新特性介绍

调用 SQL UDF

SQL UDF 能够 SQL 语句中 SQL 表达式可用的任何地方 在 select list 在 where 子句中 在 having 子句中...

调用语法:[db_name.]owner.sqludfname

([arg1, arg2, ...])

Page 13: Ase 15 新特性介绍

创建创建 SQL UDF SQL UDF 例子例子 create function emp_bonus(@salary int, @grade int, @dept_id int)

returns intas begin

declare @bonus intdeclare @cat int select  @cat = dept_cat from department where dept_id = @dept_id

if (@cat < 10)

       begin                set @bonus = @salary *15/100        end

       else                begin                set     @bonus = @salary * 10/100                end

return @bonusend

Page 14: Ase 15 新特性介绍

调用 调用 SQL UDF SQL UDF 例子例子

1> select dbo.bonusfunc(salary, grade, dept_id) 2> from employee3> where master.dbo.myUDF(grade) > 54> having master.dbo.myUDF(dept_id) > 0 ----------- 15000 5500 5500 5000 25000 17000

(6 rows affected)

Page 15: Ase 15 新特性介绍

ASE 15 ASE 15 新功能 新功能

新功能 大容量存储 (VLSS) 支持 计算列 & 函数索引 用户定义函数

表分区

高性能:新一代查询优化器

集群 / 网格技术

Page 16: Ase 15 新特性介绍

表分区表分区VLDB 环境中所面临的挑战:

大数据集消耗了系统进程 (Process) 的大部分资源

维护大表中数据所需的时间会随着表中的数据量增大而增加

对表的维护会使系统长时间不能提供其它数据服务

DSS 应用会影响OLTP 系统

Page 17: Ase 15 新特性介绍

单个大表与表分区单个大表与表分区

Large Table

Large Delete

Data load

DSSQuery

OLTP apps

Updatestatistics

Unpartitioned Table

Partition

Large Delete

PartitionUpdatestatistics

Partition

OLTP appsPartition

Data load

Partition

DS

SPartitioned Table

Page 18: Ase 15 新特性介绍

范围分区范围分区– – 例子例子

create table fictionsales

(store_id int not null, order_num int not null,

date datetime not null)

partition by range (date)

(p1 values <= (‘3/31/2004’) on seg1,

p2 values <= (‘6/30/2004’) on seg2,

p3 values <= (‘9/30/2004’) on seg3,

p4 values <= (‘12/31/2004’) on seg4)

适合范围分区的数据: 基于时间的数据 可排序的数据 (如工资、客户号等 )

Page 19: Ase 15 新特性介绍

列表分区列表分区–– 例子 例子

create table my_publishers

(pub_id char(4) not null, pub_name varchar(40) null,

city varchar(20) null, state char(2) null)

partition by list (state)

(west values (‘CA’, ‘OR’,’WA’) on seg1,

east values (‘NY’, ‘NJ’) on seg2)

Page 20: Ase 15 新特性介绍

hashhash 分区分区––例子例子

create table mysalesdetail

( store_id char(4) not null, ord_num varchar(20) not null,

title_id tid not null, qty smallint not null,

discount float not null)

partition by hash (ord_num)

(p1 on seg1, p2 on seg2, p3 on seg3)

适合 hash 分区的数据: 表中数据特别多 没有适合排序的列 需要将数据均匀地分在各个表分区中

Page 21: Ase 15 新特性介绍

分区表上的索引分区表上的索引 在分区表上可创建分区索引和非分区索引。可在单个分区上创建索引, ASE称为本地索引;针对整个分区表数据所创建的索引, ASE称为全局索引。

例:分区表的本地索引:create nonclustered index nonclust_idx on mysalesdetail(title_id) local index p1 on seg1, p2 on seg2, p3 on seg3 分区表的全局索引:create nonclustered index global_idx on fictionsales(order_num)

Page 22: Ase 15 新特性介绍

((非聚族非聚族 )) 全局索引 全局索引 Create unique index ci_nkey_ckey

on customer(c_nationkey, c_custkey)

on segment4

Segment 3Segment 2Segment 1Segm

ent

4

Page 23: Ase 15 新特性介绍

((非聚族非聚族 ) ) 本地索引 本地索引

Create unique index ci_nkey_ckey

on customer(c_nationkey, c_custkey)

on segment4 local index

Segment 1 Segment 2 Segment 3

Segm

ent

4

Page 24: Ase 15 新特性介绍

ShowplanShowplan 例子例子QUERY PLAN FOR STATEMENT 1 (at line 1).

2 operator(s) under root

The type of query is SELECT.

ROOT:EMIT Operator

|SCALAR AGGREGATE Operator | Evaluate Ungrouped COUNT AGGREGATE | | |SCAN Operator | | FROM TABLE | | telco_facts_ptn | | [ Eliminated Partitions : 2 3 4 5 6 7 8 ] | | Index : primary_key_idx | | Forward Scan. | | Positioning by key. | | Index contains all needed columns. Base table will not be read. | | Keys are: | | month_key ASC | | Using I/O Size 4 Kbytes for index leaf pages. | | With LRU Buffer Replacement Strategy for index leaf pages.

(1 row affected)

Page 25: Ase 15 新特性介绍

ASE 15 ASE 15 新功能 新功能

新功能 大容量存储 (VLSS) 支持 计算列 & 函数索引 用户定义函数

表分区

高性能:新一代查询优化器

集群 / 网格技术

Page 26: Ase 15 新特性介绍

新一代查询优化器新一代查询优化器 ((混合负载混合负载 ))

全面改进索引选择、并行、新算法、表连接

优化控制 ( 目标、标准、时间 )

查询计划度量表

延缓写日志 (Delayed commit)

Page 27: Ase 15 新特性介绍

ASE 15ASE 15 优化器全面改进优化器全面改进ASE 15 以前版本

非常适合有高性能要求的 OLTP 系统 对于事务查询有高质量的查询计划 有非常好的操作特性

能够满足部分混合负载环境下的需求 有非常好的操作特性 对表扫描、索引扫描和表连接操作可使用并行查询

ASE 15 版本大数据量 支持表分区 增强并行处理能力

混合负载环境 复杂查询的性能有了很大改进 处理复杂查询的效率也有提高 ( 编译、查询计划选择等 )

简化性能管理:自动 update statistics , DBA 干预更少

Page 28: Ase 15 新特性介绍

索引选择索引选择 (( 数据类型不匹配数据类型不匹配 ))

select * from A, B where A.a = B.b

假设 : A.a 是 float 数据类型 B.b 是 int 数据类型,并在该列上有索引 B 为大表

ASE 15.0 以前版本 : 不选择索引 B.b Undocumented trace flag 291

ASE 15.0:选择索引 B.b 提高性能 基于列 A.a 的值对表 B 进行索引扫描

Page 29: Ase 15 新特性介绍

索引选择索引选择 (OR(OR))

select * from lineitem where l_orderkey  between 10 and 20 OR l_suppkey between 40 and 50

假设 : 在 l_orderkey 列和 l_suppkey 列上分别都有索引

ASE 15.0 以前版本 : 全表扫描ASE 15.0: 使用两个索引

使用新的运算符 : hash-based union distinct 内部测试,性能提高 10%

Page 30: Ase 15 新特性介绍

索引选择索引选择 (AND(AND))

select R.a, R.b from Rwhere R.a > 1 and R.b < 10

假设 : 在 R.a 列和 R.b 列上分别都有索引

ASE 15.0 以前版本 : 只使用一个索引ASE 15.0: 使用两个索引 在内部 benchmark 性能测试中,性能提高数十倍 两个索引都用到了,并使用了 hash-intersected 如果一个查询中有 AND/OR 两个操作, Index intersection 可与

Index Union 联合使用 在星型 /雪花模型的查询中,如果 FACT 在表连接操作的列上都有索

引, Index intersection 也很有用。

Page 31: Ase 15 新特性介绍

优化器全面改进 优化器全面改进 -——-—— 表分区并行表分区并行

select * from customers, orders where c_custkey = o_custkey

PC1 (<=200)

PC1 (<=300)

PO1 (<=100) PO1 (<=200)

Thread 1Join

Thread 2Join

Thread 3Join

PC1 (<=100)

PO1 (<=300)

create table customer

(c_custkey int, c_name varchar(25), c_region varchar(4), c_acctbal double)

PARTITION BY RANGE (c_custkey) (PC1 values

<= (100), PC2 values

<= (200), PC3 values

<= (300))

create table orders

(o_orderkey int, o_custkey int, o_orderstatus char(1), o_price double, o_orderdate smalldatetime)

PARTITION BY RANGE (o_custkey)(PO1 values <= (100), PO2 values <= (200), PO3 values <= (300))

Page 32: Ase 15 新特性介绍

优化器全面改进 优化器全面改进 -——-—— 复杂查询并行复杂查询并行SQL 操作符可采用管道 (pipeline) 并行

select sum(o_price), c_region from orders, customers where o_orderdate > “01/31/2003” and c_custkey = o_custkey group by c_region

两个表 customers 和 orders 的连接操作和随后的分组操作都能够使用并行

orders

customers scan

scan

Hash Group

REPA

RTIT

ION

MER

GEHash join

Pipe 1 Pipe 2

Page 33: Ase 15 新特性介绍

优化器全面改进 优化器全面改进 -——-—— 新算法新算法Unions Hash Union Merge Union

Aggregation & Distinct Hash Aggregation Hash Distinct Distinct Sorting Group Sorted

Joins Merge Join Hash Join RID Join N-ary Join Star Query optimization

Set operations Index Union Index Intersection

Page 34: Ase 15 新特性介绍

表连接表连接 ((Join) Join) 算法算法

ASE 15.0 支持四种表连接操作算法 Nested-Loop Join (NLJ)

同 ASE 15.0 以前版本

Merge Join (MJ) 改进 ASE 12.0 版本 实现的 增加了内存中 hash sort操作, IO 开销减少

N-ary NLJ 是 NLJ 的一种变形, Sybase获得专利

Hash Join (HJ)Hash-based join 方法

Page 35: Ase 15 新特性介绍

N-ary Nested Loop JoinN-ary Nested Loop Join

它是什么 它是一个 3 个以上表连接 NLJ 算法的优化方法

只会比 NLJ 方法更好 – 不会差 避免不必要的计算

NLJ 会遍历表中所有数据行

Sybase 专利

Page 36: Ase 15 新特性介绍

星型星型 //雪花模型表连接雪花模型表连接

STAR, SNOWFLAKE schemas 有更好执行计划 大事实表,小纬表 在事实表和纬表间进行表连接操作 在连接列上有索引

STAR schema SNOWFLAKE

schema

Page 37: Ase 15 新特性介绍

星型星型 //雪花模型表连接雪花模型表连接select * from lineitem, orders, parts, supplierwhere lineitem.l_orderkey = orders.o_orderkeyAND lineitem.l_partkey = parts.p_partkey AND lineitem.l_suppkey = supplier.s_suppkey

假设 : 事实表 : lineitem 纬表 : orders, parts, suppliers

ASE 15.0 以前版本 : 表连接次序可能不正确 强制 join order

ASE 15.0: 纬表总在连接操作前面 识别 STAR/SNOWFLAKE 模型表连接 在表连接操作中,把事实表置于所有纬表后面 纬表按照基数从低到高排序 可使用 Index intersection

Page 38: Ase 15 新特性介绍

新一代查询优化器新一代查询优化器 ((混合负载混合负载 ))

全面改进索引选择、并行、新算法、表连接

优化控制 ( 目标、标准、时间 )

查询计划度量表

延缓写日志 (Delayed commit)

Page 39: Ase 15 新特性介绍

优化控制优化控制 ------ 目标目标

四个优化目标 : allrows_mix – 优化器使用所有可能的优化技术获得最佳查询计划,

这是缺省查询策略,特别适用于混合负载环境 allrows_dss – 优化器使用有限的几个优化标准来选取好的查询计划 allrows_oltp – 适用于单纯的 OLTP 环境 fastfirstrow –优化器尽快返回第一条结果

设置语法: 服务器级

sp_configure "optimization goal", 0, " allrows_oltp " 会话级

set plan optgoal allrows_oltp 查询级

select * from A order by A.a plan "(use optgoal allrows_dss )"

Page 40: Ase 15 新特性介绍

优化控制优化控制 ------ 时间时间

以前版本通过 “ set table count”命令 对少量表连接操作有效 对大量表的连接操作不太有利 (set table count >>4)

例如 “ set table count 12” 对于 12 个百万条记录的表需要 10 分钟优化 ( 但运行时间只需要 30 秒 )(11.9.3)

新的限制 sp_configure "optimization timeout limit", 10

JTCN !

Page 41: Ase 15 新特性介绍

新一代查询优化器新一代查询优化器 ((混合负载混合负载 ))

全面改进索引选择、并行、新算法、表连接

优化控制 ( 目标、标准、时间 )

查询计划度量表

延缓写日志 (Delayed commit)

Page 42: Ase 15 新特性介绍

查询计划度量表查询计划度量表容许跟踪查询计划的度量结果 度量标准 :

Cpu execution time, elapsed time Logical I/O (缓存中查到的数据 , cached by async prefetch) Physical I/O (regular I/O, async prefetch) Count – 查询执行次数跟踪 min, max 和 avg (小于 count)

以前采用 “ set statistics [io,time] on” 限制当前用户会话

语法 服务器级 - sp_configure "enable metrics capture", 1 会话级 - set metrics_capture on/off

访问方法 QP 度量表缺省放在“ running” 组中 可使用 sp_metrics “groupname” 移到其它组中 查询 sysquerymetrics 视图

Page 43: Ase 15 新特性介绍

Sysquerymetrics Sysquerymetrics 列名列名Field Definitionuid User IDgid Group IDid Unique IDhashkey The hashkey over the SQL query textsequence Sequence number for a row when multiple rows are

required for the SQL text exec_min Minimum execution timeexec_max Maximum execution timeexec_avg Average execution timeelap_min Minimum elapsed timeelap_max Maximum elapsed timeelap_avg Average elapsed timelio_min Minimum logical IOlio_max Maximum logical IOlio_avg Average logical IOpio_min Minumum physical IOpio_max Maximum physical IOpio_avg Average physical IOcnt Number of times the query has been executed.abort_cnt Number of times a query was aborted by Resource

Governor as a resource limit was exceeded.Qtext query text

Page 44: Ase 15 新特性介绍

新一代查询优化器新一代查询优化器 ((混合负载混合负载 ))

全面改进索引选择、并行、新算法、表连接

优化控制 ( 目标、标准、时间 )

查询计划度量表

延缓写日志 (Delayed commit)

Page 45: Ase 15 新特性介绍

ASE Logging (A Simple View)ASE Logging (A Simple View)

Log CacheXactn Log

Database Tables

Data Cache(s)

HK, etc.

User Log Cache

WaitEventID=54

WaitEventID=55

1111

2222

3333 4444

5555

6666

Page 46: Ase 15 新特性介绍

Delayed CommitDelayed Commit

Delayed Commit ASE 15.0 新的 DB选项 delayed_commit 事务不等待最后一个日志页写到磁盘

日志页写到 Log Cache 后就返回到应用然后采用异步方式将 log cache 中日志写到磁盘上

当使用 delayed_commit 时,日志在下列情况下写盘 当执行 checkpoint 或者不记日志命令 ( 如 bcp)执行后 ASE正常关机 ( 不要使用 shutdown with nowait) HouseKeeper 进行常规脏页处理

Syntax set delayed_commit [on | off | default]

sp_dboption dbname, delayed_commit, [true | false]

Page 47: Ase 15 新特性介绍

为什么使用 为什么使用 delayed_commit? delayed_commit?

8,000

428,000

050,000

100,000150,000200,000250,000300,000350,000400,000450,000

rows/min

Normal Commit

Delayed Commit

Single Thread Insert of 200 byte row

53x Faster!!!53x Faster!!!

Page 48: Ase 15 新特性介绍

ASE 15 ASE 15 新功能 新功能

新功能 大容量存储 (VLSS) 支持 计算列 & 函数索引 滚动游标

表分区

高性能:新一代查询优化器

集群 / 网格技术

Page 49: Ase 15 新特性介绍

集群类型和相关议题集群类型和相关议题

集群类型 不共享任何东西 (Sybase MPP, IBM DB2 EEE)

主要问题是大量数据移动操作和数据合并操作 共享磁盘 (Oracle RAC, Sybase ASE 15.x, ASIQ)

主要问题是缓存一致性和磁盘 IO瓶颈

缓存一致性 对于单个查询只有下面两个方法分担负载 :

联合 DB – 把查询片段分别发送到每个节点,然后合并查询结果。

查询优化器功能 (index heuristics, 多个节点 连接操作 ) 需要对聚集 (sum etc) 操作进行分组操作 分布式事务 (2PC)

缓存合并 – 需要从其它节点读原数据。 可能出现大的网络流量 (index, oam, data pgs) 锁的分布管理 /Global Cache List 的维护

Page 50: Ase 15 新特性介绍

缓存一致性的影响缓存一致性的影响

需要增加硬件 Oracle RAC: 专门使用一个 CPU 来处理节点间的连接操作 私有 / 专门的节点间网络连接 Global Cache List 需要额外的内存

读数据 – 数据不仅要放在本地缓存中 , 同时需要与其它节点上的 global cache list 协调,让其它节点知道 ( 可异步 )

写数据 – 在给数据上排它锁前需要转移属主;在写数据完成后需要告知其它节点,它们的数据已经是旧的了。

唯一的解决方案是 ‘严格’ 应用分割 Oracle RAC benchmarks 要求节点不能读该节点没有完成写操作的数据 没有数据块移动

对于这一点 , 扩展性 没有任何共享的集群 按照业务单元或地理位置划分最理想

Page 51: Ase 15 新特性介绍

Sybase Sybase 的方案的方案

同时考虑两个策略 联合 DB: 在不同节点上进行表分区 缓存融合 : 在发现数据变化时转移数据页

共享磁盘集群 不只局限于 OS 集群 能够使用“逻辑集群”进行分区 在 ASE 服务器间使用私有连接 负载均衡

连接重新定向到负载最小的服务器

Page 52: Ase 15 新特性介绍

共享磁盘集群共享磁盘集群

Shared Disk Storage

SAN

Cluster DB

Quorum

所有服务器共用同一数据库

各个应用分别运行在不同的节点上,但它们共享数据。

连接被定向到负载最小的服务器上

Private Interconnect

S1 S2 S3 S4

Page 53: Ase 15 新特性介绍

带有应用分区的逻辑集群带有应用分区的逻辑集群

SAN

S1 S2 S3 S4

客户端连接被透明地连接到一个逻辑集群上

知道应用分区的集群 可通过访问各自的数据来提高系统扩展性。

服务层协议实现容易

Private Interconnect

Quorum

Sales Application

Finance Application

Finance Cluster

Sales Cluster

S1 S2 S3 S4

Shared Disk Storage Cluster DB

Finance DB Sales DBShared

Finance Logical Cluster

Sales Logical Cluster

Page 54: Ase 15 新特性介绍

逻辑集群如何增加新节点逻辑集群如何增加新节点

SAN

增加更多低成本的 SMP 节点到逻辑集群中 - TCO

新的连接被定向到逻辑集群中负载最小的节点上。

Quorum

Sales Application

Finance Application

Sales Application

Private Interconnect

Shared Disk Storage Cluster DB

Finance DB Sales DBShared

Finance Logical Cluster

Sales Logical Cluster

Page 55: Ase 15 新特性介绍

逻辑集群的节点失败转移逻辑集群的节点失败转移

SAN

节点失败后,集群立即接管

失败节点的连接被重新定向到逻辑集群中的其它节点上

Private Interconnect

Quorum

Sales Application

Finance Application

Sales Application

Shared Disk Storage Cluster DB

Finance DB Sales DBShared

Sales Logical Cluster

Finance Logical Cluster

Page 56: Ase 15 新特性介绍

逻辑集群的失败转移逻辑集群的失败转移

SAN

逻辑集群中子集群失败后,逻辑集群立即接管。

当一个逻辑子群失败后 , 失败连接立即转移到其它子集群上。

只要有一个服务器在线,整个系统的数据库就在线。

Private Interconnect

Quorum

Sales Application

Finance Application

Sales Application

S3Sales Logical Cluster

Shared Disk Storage Cluster DB

Finance DB Sales DBShared

Finance Logical Cluster

Page 57: Ase 15 新特性介绍

逻辑集群的恢复逻辑集群的恢复

SAN

当一个逻辑集群恢复后 , 连接又会被重新定向到原来的子集群上。

Private Interconnect

Quorum

Sales Cluster

Sales Application

Finance Application

Sales Application

S3Sales Logical Cluster

Shared Disk Storage Cluster DB

Finance DB Sales DBShared

Finance Logical Cluster

Page 58: Ase 15 新特性介绍

对用户的好处对用户的好处在节点失败后也能够继续在线 多节点同时在线,节点数越多,在线率越高。 动态负载均衡 在所有的连接 ( 包括新连接和失败节点的连接 ) 间实现负载均衡。

增加和减少节点数 可采用增加 SMP盒方式来增加集群的处理能力。

扩展性 扩展性可使用应用分割的“逻辑集群” 来实现。

单一系统影像 所有服务器共享数据,对外就象一台机器一样,便于应用管理和开发。

集群架构与平台无关

Page 59: Ase 15 新特性介绍

内容提要 内容提要

Sybase ASE 数据库简介

ASE 15 新功能

迁移至 ASE 15

Page 60: Ase 15 新特性介绍

迁移至迁移至 ASE 15ASE 15 的方法的方法

所有 ASE 版本迁移至 ASE 15 的方法类似 能够直接迁移到 ASE 15.0.3 的 ASE 版本: ASE 12.5.x ASE 15.x 不能直接迁移到 ASE 15.0.3 的 ASE 版本: ASE 12.0 或更早版本 先迁移到 ASE 12.5.4 ,然后再迁移到 ASE 15.0.3

原地直接迁移 使用 upgrade 升级实用程序

传统的 Dump/Load 方法 ( 新服务器 )

Quiesce/Mount 方法 比传统的 dump/load 方法速度快很多

Page 61: Ase 15 新特性介绍

在迁移至在迁移至 ASE 15ASE 15 前的准备工作前的准备工作 ......

运行 preupgrade 工具修复出现的错误再运行 preupgrade ,确认没有错误

增加系统数据库空间 (4MB 左右 )在迁移前增加数据库空间 2K 页面 ASE Server 至少需要的空间

master 13MB, sybsystemprocs 124MB

Page 62: Ase 15 新特性介绍

迁移后性能维护迁移后性能维护Update Statistics 在迁移后运行

Page 63: Ase 15 新特性介绍

内容总结 内容总结

Sybase ASE 数据库简介

ASE 15 新功能 新功能

大容量存储 (VLSS) 支持 计算列 & 函数索引 用户定义函数

表分区 高性能:新一代查询优化器 集群 / 网格技术

迁移至 ASE 15

Page 64: Ase 15 新特性介绍

Q & AQ & A