sybase 和 oracle 比较

1、体系结构的比较

  Oracle采用多线索多进程体系结构,直接在内核中支持分布式数据库操作、多线索处理、并行处理以及联机事务处理等 。Oracle企业级服务器从结构上说,同时支持集中式多用户环境、Client/Server、分布式处理和Internet计算结构;从技术上说,为应用程序及系统开发人员实现了透明的网络环境、混合网络结构以及分布式数据管理等

  Sybase采用单进程多线索体系结构,其核心是SQL Server(现在为与Microsoft SQL Server区别,改名为Adaptive Server Enterprise),在Client/ Server体系结构的基础上,架构了复制服务器(Replication Server)和多功能通用网关(Omni SQL Gateway,现在叫Enterprise CONNECT)等部件,从而形成了软件产品系列。

  2、多线索多进程与单进程多线索的比较

  Oracle和Sybase都采用多线索。采用多线索的模式,能用较少的线索管理大量的用户进程;并且,线索进程是动态可调整的,当用户数增加时, 线索进程也会阶段性地自动增加;当用户数减少时,线索进程也会自动减少。多线 索结构,大大降低了Oracle和Sybase对系统资源的占用,提高了系统资源的利用率。

  对于Oracle的体系结构,在集中式多用户环境下,每个用户单独占用一个服务器进程;在Client/Server 和Internet方式下可以采用多个用户共享进程,以多线索方式执行用户的请求。另外,针对特别级别的用户,可以单独占用一个 服务器进程,实现最优级别的用户请求。Oracle的服务器进程是用来同时处理 数据库请求的,它们从请求队列中拿出申请,进行语法分析、权限检查以及一系列的内部操作,并协调Oracle其他后台进程,以共同完成申请的处理,并把操 作结果返回到回答队列。Oracle多服务器进程结构,能实现数据库事务的并行 处理,提高并发事务处理的响应速度。并且多服务器结构具有非常灵活的扩充 性,当硬件平台处理能力提高时,服务器进程的个数也能随之增加,数据库性 能也随之提高。多服务器结构,避免了单服务器结构中很容易造成的服务器进 程瓶颈现象,也避免了因此而引起的单服务器进程死锁的现象。

  Sybase采用单进程多线索方式,用户请求都由一个进程来进 行总的调度和管理。在单服务器并采用单一的Client/Server模式下其对数据库的管理比较简单,内存资源占用较少,在并发用户数较少的情况下,其对系统资源的利用率比采用多进程方式要高;但同时,当并发用户数达到一定的数量时,会引起系统处理性能大大下降,和服务器进程瓶颈及死锁等现象;同时系统的可扩展余地非常狭窄。技术上不能提供对大型多处理器系统的支持,性能上有所限制。

虽然可以通过配置最大引擎个数,增加dataserver进程个数,但是最大不能超过cpu的个数。

处理的原理是

cpu是操作系统能够调动的资源,sybase本身不能让数据库在哪个cpu工作,
使用engine是几就会运行几个进程,
如果engine是1,sybase就只起1个进程,操作系统就不能将将其在两个cpu上运行
如果engine是2,sybase就起2个进程,

sybase 决定将任务分配哪个dataserver进程,操作系统可以让两个进程在两个cpu上运行。

如果该OS上主要就是跑sybase,起2个合适

不像oracle那样到用户级别来处理。

详细资料参考

http://manuals.sybase.com/onlinebooks/group-asarc/srv10024/sag/@Generic__BookTextView/43271;pt=2689

http://www.ibm.com/developerworks/cn/linux/l-affinity.html

  3、系统集成度

  Oracle服务器上的Oracle多线索多进程结构以及并行查询,分布式数据库、高级复制等功能都是 直接在Oracle核心中实现的,无需添加额外的服务器,不要求额外的系统配置 ,也不会带来额外的的系统管理负担,更不会产生由API带来编程的变化。

  Sybase由实现不同功能的不同服务器组成(ASE, Replication Server, Enterprise Connect, IQ等) ,众多的服务器要 求能协调一致地工作,同时又要满足高可靠性和高可用性的要求。这不仅对硬件设备提出了很高的要求,对系统管理来讲也提出了极高的要求。Sybase对用户是不透明的,许多操作需要编程人员来管理和操纵,而且后来引入的应用程 序接口(API) CT- Lib与以前版本(DB-Lib)不兼容,大大加重了编程人员的负担,延长了开发周期。

Oracle 9,10g

Sybase ASE 12,15

An Oracle instance consists of:
A) Six processes: PMON Process Monitor, SMON System Monitor, DBWn Database Writer, LGWR Log Writer, ARCn Archiver, and CKPT Checkpoint. Additional processes on a 10g RAC system may include RECO Distributed Transaction Recovery, CJQn Job Coordinator Process, LCKn Shared Resource Locking, LMDn Global Lock Manager, LMON Lock Manager, LMS* Global Cache Service, MMAN Memory Manager, MMNL Metrics Monitor, session hitory, metrics computation, MMON Metrics Monitor, statistics, snapshots, and PSPn a PL-SQL plug in.
B) Data files which contain the tables and other data objects, control files which contain configuration information, redo log files for transaction processing, and archive files for recovery purposes.
C) Configuration files which contains the instance attributes, and external security information
A Sybase server consists of:
A) two processes, data server and backup server ;
B) devices which house the databases; one database (master) contains system and configuration data ;
C) a configuration file which contains the server attributes.
Memory Model
The Oracle memory model consists of:
A) the SGA, which contains executable program code;
B) the shared pool, which is split between the library cache and data dictionary cache, optimized queries are stored here;
C) the redo log buffer, which is where transactions are stored before they are written to the redo logs;
D) the db buffer cache, which is where database operations are stored before they are written to the data files.
The Oracle dataserver runs as a multiple processes within the operating system; the number of users connected to the database is reflected in the number of processes managed by the OS. Each Oracle user connection requires 1 meg of server memory.
Memory Model
The Sybase memory model consists of:
A) the program area, which is where the dataserver executable is stored;
B) the data cache, stores recently fetched pages from the database device
C) the stored procedure cache, which contains optimized sql calls
The Sybase dataserver runs as a single process within the operating system; when multiple users are connected to the database, only one process is managed by the OS. Each Sybase database connection requires 40-60k of memory.
The "total memory" configuration parameter determines the amount of memory allocated to the server. This memory is taken immediately upon startup, and does not increase.
Transaction Processing
Transactions are written to the redo log buffer, where they advance to the redo logs, data file buffer, and data files. When a rollback occurs, block images are discarded from the redo log buffer; as the previous block data is held in the rollback segment blocks. Committed transactions are promoted to the archive logs. Archive logs are used to restore the data in the event of a hardware failure. A checkpoint operation flushes all updated (committed) memory blocks from the log buffer and database buffer pool.
Note that transaction logging is optional, on a table by table basis, and archive logging is also optional.
During an update transaction, record locking provides prevents data block collisions from occurring. Access to the "before" image of the record(s) is made available during this time, which reduces contention. This is a patented record locking mechanism.
Transaction Processing
Transactions are written to the data cache, where they advance to the transaction log, and database device. When a rollback occurs, pages are discarded from the data cache. The transaction logs are used to restore data in event of a hardware failure. A checkpoint operation flushes all updated (committed) memory pages to their respective tables.
Transaction logging is required for all databases; only image (blob) fields may be exempt.
During an update transaction, the data page(s) containing the row(s) are locked. This will cause contention if the transaction is not efficiently written. Record locking can be turned on in certain cases, but this requires sizing the table structure with respect to the page size. The locking mechanism can be bypassed by setting the isolation level, to allow data to be read from uncommitted transactions.
Backup Procedures
Previous to Oracle 8, the only way to back up the database was through a "cold" backup. This involved shutting down the Oracle instance, backing up the data files, and restarting upon completion.
Oracle 8,9, and 10g has the Recovery Manager package which facilitates backing up data files on-line.
Backup Procedures
A "dump database" operation can be performed when the database is on-line or offline. Subsequent "dump transaction" commands need to be issued during the day, to ensure acceptable recovery windows. A new ASE 12.5 feature allows database dump files to be "mined" for a single table. Thus an entire database loaded is not required when only a single table restore is needed.
Recovery Procedures
Recovery is achieved by restoring the data files, and verifying the control files are synchronized properly. When RMAN is used (it is now the standard in most production databases) recovery is accomplished via an automated set of processes.
Recovery Procedures
A "load database" command loads the designated database with the named dump file. Subsequent "load transaction" commands can then be issued to load multiple transaction dump files.
Security and Account Setup
Oracle is shipped with several built-in accounts: system, internal, and sys. Operating system authentication is required in order for a login to be created with similar privileges. After a login is created, access is then granted to the tables within schemas as needed.
Security and Account Setup
The initial login shipped with Sybase is "sa" (system administrator). This login has the role "sa_role" which is the super-user, in Sybase terms.
User logins are added at the server level, and then granted access to each database, as needed. Within each database, access to tables can be granted per application requirements. A user can also be aliased as "dbo", which automatically grants them all rights within a database.
Database Creation
Databases are initialized with the "create database" command. In most (99.9%) cases the database name is the same as the instance name, and there is only one database per instance. Within an Oracle instance, schemas are created which contain the tables for an application. Tables are referenced by schema_name.tablename. Each user is assigned a default schema upon creation; this schema name is the same as the user name. In order for tables to be referenced without the schema name, they must be owned by the user, or in the "system" schema. "Synonyms" can be created to bypass the prefix requirement. Typically, an "internal" or "system" level login will be used to access the database.
A typical Oracle instance will have 12 data files, 6 redo log members, 6 archive files, and 4 control files, all spread across various disk subsystems.
Database Creation
Databases are initialized with the "create database" command. It is not unusual for a Sybase server to contain many different databases. Tables are created within each database; users refer to tables by using ownername.tablename nomenclature. "Aliasing" users with the database eliminates the need for the prefix. Typically, a user will be aliased as "dbo" (database owner), which also gives the same result.
A typical Sybase database will consist of six segments spread across various devices (non-SAN environment).
Data Types
Supported data types include number, char, varchar2, date, long raw, clob, and blob. In Oracle 10, numeric data types were introduced.
Blob and clob (Oracle 8+ only) datatypes are implemented via pointers within the physical record structure ; the field contents are stored in dedicated blocks. As a result, each blob or clob field requires at least 2K of storage (depending on the database block size). Long raw datatypes are stored in-line, and are discouraged.
For string data, the varchar2 type can be used for lengths up to 2000; the clob type can be used for longer field data.
( ** blob = binary large object, clob = character large object)
Date fields are represented as a number of days, along with a decimals fraction (accurate to the minute). Additional accuracy can be obtained by purchasing a separate module.
Sequences provide a means of autoincrementing an ID column - selecting sequence_name.NEXTVAL automatically increments the sequence and returns the new value.
Data Types
Supported data types include integer, decimal, float, money, char, varchar, datetime, image, and text datatypes.
Text and image datatypes are implemented via pointers within the physical record structure ; the field contents are stored in dedicated pages. As a result, each text or image field requires at least 2K of storage (on most platforms).
For string data, the varchar type can be used for lengths up to 4000; the text type can be used for longer field data.
Datetime fields are stored as a number which is accurate to 1/300 of a second.
Within a "create table" statement, a column can be flagged as an "identity" column, which causes it to be incremented automatically when rows are inserted.
Storage Concepts
Tables are stored in tablespaces; a tablespace is made up of one or more data files. Although it is possible to use raw devices within Oracle, it is not recommended. Control files, rollback segments, and redo logs are all stored in separate files within the operating system. Note that Oracle 10g RAC features a special OFS (Oracle File System), which allows the database to get better i/o performance over conventional file systems.
Storage Concepts
Tables are stored in segments; a segment is an area within a device, with a name and a size, that is allocated for a database. The transaction log is stored in its own segment, usually on a separate device.
Partitioning
Oracle 9i,10g does support semantic partitioning, by list, range, hash, hash range, and composite.
Partitioning
Semantic "smart" partitioning is new in ASE 15. Tables can be partitioned by range, value, or round-robin. By default, all tables in ASE 15 are partitioned, round-robin.
Failover and High Availability
Oracle offers several types of high availability configurations: Transparent Application Failover (TAF), Oracle Streams (send transactions to remote server), Data Guard, and Standby Database.
Failover and High Availability
The ASE High Availability option allows server failover to occur within specified metrics. ASE 15 supports for server clusters, shared disk storage between servers, and multiple client failover in a cluster setting will be available in late 2007 / early 2008.
PL-SQL
PL-SQL is a robust programming language in which stored procedures can be written. The procedures are stored in a compiled format, which allows for faster execution of code. Cursors are supported for row by row processing. Arrays are supported (using the table datatype), as well as structures (the record type). Since PL-SQL procedures cannot return a result set, returning rows to a calling application requires implementing arrays as "out" variables. One powerful feature of PL-SQL is the ability to create custom functions which can be used within SQL statements. Regular Expressions are supported, in addition to User Defined Operators.
Transact-SQL
Transact-SQL is a robust programming language in which stored procedures can be written. The procedures are stored in a compiled format, which allows for faster execution of code. Cursors are supported for row by row processing. Temporary tables are supported, which allows customized, private work tables to be created for complex processes. Any number of result sets can be returned to calling applications via SELECT statements.
Triggers
Oracle supports select, insert, update, and delete triggers. Triggers can be set to fire 'before' or 'after' a transaction. NEW and OLD aliases are used to refer to the before and after images of the data. Triggers by default fire for all rows in the transaction; they can be set to fire for each row also. Oracle also supports DDL Event Triggers.
Triggers
Sybase ASE supports insert, update, and delete triggers. Triggers are fired after the transaction starts, and have the capability to roll back if required. Images of the 'before' and 'after' records are visible within the trigger. Triggers by default fire for all rows in the transaction.
  
Analytic Functions, OLAP
Oracle 10 does support analytic functions like median, n-tile, and lead/lag, over partitions.
Analytic Functions, OLAP
Sybase ASE does not support analytic functions (median, n-tile, lead/lag, over partitions) at the moment; Sybase IQ, the data warehouse product, does support most analytic functions.
Flat File Processing
Oracle includes the SQLLDR utility (SQL Loader) which can import via flat files. "Direct" mode imports are achieved by simply removing the indexes (and triggers) from the target table, and specifying direct=yes at the command line. There is no Oracle utility for exporting data to a flat file; sqlplus must be used to spool the data to a file.
Flat File Processing
Sybase ASE includes the BCP utility (Bulk-Copy) which can import or export data via flat files. "Fast" mode imports are achieved by simply removing the indexes (and triggers) from the target table.
Performance and scalability
Oracle has always been known for its speed and performance. Oracle 10 supports over 15,000 active user connections. The patented record locking scheme made it an attractive candidate for canned applications marketed by Peoplesoft and the like. The ability to turn transaction logging on and off at will allows Oracle squeak by competitors during benchmark analysis runs.
Performance and scalability
On a regular basis, Sybase Adaptive Server Enterprise on Sun captures the #1 TPC benchmark for SMP performance, check sybase.com for the latest results.
Scalability: Sybase 15 scales from handheld devices to enterprise level servers.
Price and Support
Price per seat is relatively high, compared to other vendors.
Support is achieved by opening "TAR" cases with the support team. Response is usually within 48 hours.
Price
Price per seat is average, compared to other vendors; Sybase ASE is the leader in lowest transaction cost, with the best performance, among the leading enterprise database vendors.
Support is achieved by opening cases with the support team. Response is usually within 24 hours.
Management and Development Tools (for Windows)
SQL-Plus is the interactive query tool used with Oracle; it is useful for entering queries and stored procedures. Complex reporting capabilities are available for those willing to learn SQL-Plus extensions.
Oracle Enterprise ships with Enterprise Manager, a full featured front end to the intricacies of Oracle. The main areas of the system (security, storage, schemas) are managed by totally separate applications, which is cumbersome at times.
The "best of breed" product in this category is DB-Artisan by Embarcadero Technologies. Many developers choose Toad, as it is cheaper and has a lot of nice features.
Management and Development Tools (for Windows)
ISQL is the interactive query tool used with Sybase ; it is useful for entering queries and stored procedures.

Sybase Central is shipped with Sybase ASE. It offers a good interface for performing basic database tasks. The "best of breed" product in this category is DB-Artisan by Embarcadero Technologies. Sybase recently released Workspace, an Eclipse based SQL development environment, which features a stored procedure debugger and graphical SQL creator. For development, Sybase Inc. offers Workspace, Powerbuilder, Powerdesigner, Power J and its "Studio" line products. Powerbuilder remains the most robust, straightforward, and practical choice for windows development, supporting many other RDBMs in addition to Sybase ASE.

Additional Features of Interest, in Oracle 10g



ORA_ROWSCN System Column
A timestamp-like data type on each record, used for update consistency.


FORALL Option
A method by which to perform updates via 'bulk' operations. Significant performance improvements can
be obtained via this mechanism.


PRAGMA SERIALLY_REUSABLE Option
A method by which packages can be managed in memory more efficiently.


Function Based Indexes
This allows results to be pre-calced into an index, eliminating the need for calculation at runtime.


DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS Command
A method by which to set status or completion rate of long running processes.


Package Initialization Section
Allows the setup routines for a package to occur just once per session.


Sorted Hash Clusters
Allows groups of records to be read from disk via a hash identifer.


WITH Clause Queries
Allows a query to be referenced as a virtual table multiple times within a SQL block.

Additional Notes, Regarding Sybase ASE



Replication Server
Sybase's enterprise data replication facility is the leader in the industry; more Oracle customers purchase the Sybase offering than do Oracle's own product.

Encryption ASE 15's new patent-pending encryption technology allows seamless encryption of columns with little or no change to most applications.

Computed Columns ASE 15 supports both materialized and virtual computed columns; this eliminates the need to perform CPU-intensive calculations at runtime. Functional indexes can be built on these columns.

3 oracle 和 sybase 进程 对比

参见这个pdf 介绍

http://www.sybaseteam.com/oracle-background-process-for-sybase-pros-t-526.html

转载http://dev.yesky.com/41/3013541.shtml

转自http://www.rocket99.com/sybase/syb_vs_ora.html

oracle2sybase

http://www.sybase.com/files/White_Papers/ASE-Oracle-Migration-Guide-112108-wp.pdf

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值