Informix and Indexing Support for Data Warehouses, Database and Programming Design

合集下载

1Informix介绍 ppt课件

1Informix介绍 ppt课件
应用”的开发 • 支持地理空间应用的网络特性服
务 • 对Optim Data Studio的支持 • 内建的文本检索 • 对MQ的支持 • 零售集成框架
2010
业务优化
• Informix数据仓库 • Cognos集成 • 虚拟化 • 对云计算的支持 • 在线存储优化 • XPS特性
• 外部表 • 对内存数据库SolidDB的 支持 • 通过CDC进行异构复制 • 延迟的复制 • 4GL扩展 • ConnectBy 语句 • Merge 语句 • 在线的修改表结构
Informix:持续的技术领先
Mach11
LBAC 智能的恢复 (TLPIT)
连接管理器
2008
2007
开放管理工具OAT
在线创建/删除索引
可配置的数据页大小
IBM收购了Informix 分布式高可用性 (ER+HDR) 2004 4GL/EGL
超大规模数据库 – 大数据块
服务器中的Java
可插拔的认证模块 (PAM)
应用集成 • 网格计算 • 扩展的数据仓库特性
• Star/snowflake join • ISAO 支持 • 支持ODS环境 • 改进的统计数据 • 改进的应用开发环境 • 存储过程的调试 • 更进一步的对嵌入式系统的支持 • 自动的存储规划 • 自动的分片 • 嵌入式开发工具箱 • 与IDS安装相关的API • 更简单的管理 • 安全 • 细粒度的审计 • 可信的上下文环境 • 4GL扩展
数据刀片
2000
第一个支持Linux
智能大对象 (Blobs/Clobs)
企业复制
1998 对象-关系特性
系统监控接口 (Onstat,..)
数据分片

Informix存储过程

Informix存储过程

Informix存储过程⼀、存储过程概述 存储过程是⼀个⽤户定义的函数,由存储过程语句(SPL) 和⼀组SQL语句组成,以可以执⾏代码形式存储在数据库中,和表、视图、索引等⼀样,是数据库的⼀种对象。

存储过程语⾔SPL(Stored Procedure Language),只能⽤在存储过程中,可以分成下⾯⼏类:1、变量定义和赋值:define,let2、流程控制:分⽀控制: if then elif else end if;循环控制: FOR,FOREACH,WHILE,EXIT, CONTINUE3、函数调⽤与返回CALL, SYSTEM ,RETURN4、错误处理和调试TRACE, ON EXCEPTION, RAISE EXCEPTION例⼦:drop procedure count_add;--删除存储过程create procedure count_add(user_name_var varchar(50) default'administrator') --user_name_var传递参数变量在此定义returning varchar(50); --返回⼀个字符型的值define error_count_var integer; ----定义输⼊的次数变量select error_count into error_count_var from users where user_name=user_name_var; ----error_count默认是0,从0开始记数let error_count_var=error_count_var 1; ----输⼊⼀次记数加1update users set error_count= error_count_var where user_name=user_name_var return user_name_var; --返回变量值,与returning对应。

Informix培训资料

Informix培训资料

Informix培训资料预览说明:预览图片所展示的格式为文档的源格式展示,下载源文件没有水印,内容可编辑和复制第一章Informix动态可伸缩体系结构(DSA:Dynamic Scalability Architecture)1、Informix OnLine系统组成Informix OnLine数据库系统由以下部分组成:1.1 共享内存部分共享内存部分包括:长驻内存部分、虚拟内存部分、消息区。

长驻内存部分主要是用于磁盘数据在内存的缓冲、系统数据等等(buffers,physical/logical buffers,LRUs,chunks,dbsapces,users,locks…)。

虚拟内存部分主要用于VP的管理信息和缓冲区。

(global pool,dictionary pools,procedure pools,sort pools,session pools,big buffer pools,MT pools)。

消息区主要用于应用(client)和数据库引擎(server)之间的信息交换。

1.2 硬盘数据空间部分1.3 数据库引擎—虚拟处理器VP(Virtual Processors)2、Informix OnLine多线索体系结构Online 7.0改变了OnLine5.0中一对一的客户/服务器模式:由原来的一个数据库请求启动一个sqlexec数据库引擎服务的Client/Server方式转变为对于所有数据库请求由多个数量固定(除非动态调整)的数据库引擎(即VP虚处理器)。

OnLine7.0把数据库引擎按照功能划分为多个VP,这些VP是长驻内存的oninit进程。

对于每一个数据库服务请求都将被切割成多个可并行的线索,由不同VP并行服务。

线索(thread)可以定义为一段顺序执行的程序。

虚处理器VP可以定义为完成一定数据库服务功能的数据库进程。

VP 包括以下类型:CPU ,PIO(负责写物理日志),LIO(负责写逻辑日志),AIO(负责磁盘I/O)等等。

informix 存储过程

informix 存储过程

2007/01/08
尚洋信德
存储过程
练习 写一个存储过程,入参为分支机构、月份 提取职级为“21”代理人的实际收支 提取职级为“21”代理人的实际收支 ,直接佣金 , 直接佣金占实际收支 的百分比。
2007/01/08
尚洋信德
2007/01/08 尚洋信德
存储过程
存储过程for循环 存储过程for循环 WHILE EXISTS (SELECT fname FROM customer WHERE customer_num > 400) DELETE FROM customer WHERE id_2 = 2; END WHILE; LET i = 1; WHILE i < 10 INSERT INTO tab_2 VALUES (i); LET i = i + 1; END WHILE;
2007/01/08
尚洋信德
存储过程
存储过程的创建方式 1、dbaccess database xxx.sql; 2、dbaccess 后,编写存储过程或选择存储过程 文件,运行。
2007/01/08
尚洋信德
存储过程
存储过程的建立 • drop procedure xxx; 存储过程创建之前要先删掉原来的存储过程。 一般,在存储过程的sql文件中,把此语句放在第一行。 一般,在存储过程的sql文件中,把此语句放在第一行。 如果数据库中没有xxx,会出现: 如果数据库中没有xxx,会出现: 674: Routine (xxx) can not be resolved. 111: ISAM error: no record found. Error in line 1 Near character position 17

altibase_mmdbms

altibase_mmdbms
l l
Utilities
Admin Tool - Performs overall Altibase operation management such as Altibase server on/off, configuration management. Monitoring Tool - Provides DB information (schema, stored procedures, and restrictions) and operation information (resources in use, connection status, lock status, and transaction information) for real-time search and management functionalities. iSQL - Support tool for interactive query processing. Users can create/save/ execute script files including SQL statements. Also, users can automatically store and execute the latest commands used, edit output format, store and load SQL statements existing in the iSQL buffer. iLoader - A data uploading or downloading utility for Altibase - A download file format is compatible with Oracle and SQL server Audit - Verifies and resoloves data consistency between a local server and remote DBs or between replication DBs.

Informix错误代码中文解释(转9)

Informix错误代码中文解释(转9)

-701 在XA环境中语句是无效的。

在一个X/Open分布的事务处理环境中执行下面任意语句就会产生该错误:* CLOSE DATABASE* CREATE DATABASE* DROP DATABASE* SET LOG在这种环境下,可以在一个 xa_open 的调用之后执行一个单一的DATABASE语句来指定当前的数据库。

但是,在该数据库被选择之后,不能执行其它的DATABASE语句。

该错误产生于试图再次执行DATABASE语句时。

-702 不能认排他模式打开数据库。

在一个X/Open 分布的事务处理环境中,不能认排他模式打开一个数据库。

-703 在表<表名>;中主键有一个带null键值的域。

不能在一个是主键一部分的字段中插入一个null值。

-704 主键已在表中存在。

一个表只能有一个主键。

-705 不能取消/修改过程<过程名>;。

它当前正在使用中。

试图取消一个正在执行的过程,或在当前正在执行的过程上执行一个UPDATE STATISTICS。

该错误发生在一个过程试图取消它本身或一个嵌套的过程试图取消调用它的过程时。

错误的例子:CREATE PROCEDURE testproc()...DROP PROCEDURE testproc; -- 错误END PROCEDURE更正:可以使用一个 ON EXCEPTION 语句捕获该错误,且不执行DROP PROCEDURE或 UPDATE STATISTICS语句-706 在过程<过程名>;中执行的权限被取消。

一个用户如果未拥有过程或不是DBA,则必须有执行权限去运行一个过程。

-707 在光盘聚类中的Blob字段必须是不同的。

同一字段在CREATE OPTICAL CLUSTER 语句中FOR子句的字段列表中被指定了一次以上。

改变语句使得字段不能出现一次以上。

-708 光盘聚类<聚类名>;已经存在。

试图用一个已存在的聚类名称产生一个新的光盘聚类。

在Informix+Dynamic+Server+中创建并使用函数索引

在Informix Dynamic Server 中创建并使用函数索引随着数据量以惊人速度不断增长,数据库管理系统将继续关注性能问题。

本文主要介绍一种名为函数索引(functional index)的性能调优技术。

根据数据库使用情况的统计信息创建并使用函数索引,可以显著提升SELECT 查询的性能。

通过本文了解如何在IBM ® Informix ® Dynamic Server 中创建和使用函数索引并最大限度提升查询性能。

简介在选择数据库管理系统(DBMS)时,性能是一个关键的考虑因素。

在执行SELECT、INSERT、UPDA TE 和DELETE 操作时,很多因素都会对性能产生影响。

这些因素包括:持久性数据存储的速度和大小数据存储结构数据访问方法随着数据集不断变大,查询性能愈发变得重要。

通常,使用索引可以改善查询性能。

索引将数据库中的行位置与一组有序数据子集和/或数据派生物关联在一起。

索引可以减少DBMS 在执行查询时检查的行(或元组)数量,从而获得性能增益。

有时,仅通过搜索索引即可完成查询,而不需要从表中取回任何元组(tuple)。

例如,如果您在列c1 中建有索引,并且发出查询select c1 from t1 where c1 < 10 ,那么索引中包含了可以满足查询的所有信息。

有趣的是,ANSI SQL 标准并没有说明如何创建、实现或维护索引。

因此,数据库供应商可以按照自己的方式自由地实现索引。

本文讨论了Informix Dynamic Server 的函数索引特性。

要理解本文涉及的概念,您需要熟悉基本的数据库术语和概念,例如模式、表、行、列、索引和可扩展性。

还需了解Informix Dynamic Server (IDS) 的基本配置以及如何启动和停止服务器、如何使用ONCONFIG 文件进行配置。

此外,还需熟悉基本的SQL 命令以及如何使用dbaccess 对服务器执行SQL 命令。

数据库设计外文翻译

英文摘要Data Transformation ServicesDTS facilitates the import, export, and transformation of heterogeneous data. It supports transformations between source and target data using an OLE DB-based architecture. This allows you to move and transform data between the following data sources:∙Native OLE DB providers such as SQL Server, Microsoft Excel, Microsoft Works, Microsoft Access, and Oracle.∙ODBC data sources such as Sybase and Informix using the OLE DB Provider for ODBC.∙ASCII fixed-field length text files and ASCII delimited text files.For example, consider a training company with four regional offices, each responsible for a predefined geographical region. The company is using a central SQL Server to store sales data. At the beginning of each quarter, each regional manager populates an Excel spreadsheet with sales targets for each salesperson. These spreadsheets are imported to the central database using the DTS Import Wizard. At the end of each quarter, the DTS Export Wizard is used to create a regional spreadsheet that contains target versus actual sales figures for each region.DTS also can move data from a variety of data sources into data marts or data warehouses. Currently, data warehouse products are high-end, complex add-ons. As companies move toward more data warehousing and decision processing systems, the low cost and ease of configuration of SQL Server 7.0 will make it an attractive choice. For many, the fact that much of the legacy data to be analyzed may be housed in an Oracle system will focus their attention on finding the most cost-effective way to get at that data. With DTS, moving and massaging the data from Oracle to SQL Server is less complex and can be completely automated.DTS introduces the concept of a package, which is a series of tasks that are performed as a part of a transformation. DTS has its own in-process component object model (COM) server engine that can be used independent of SQL Server and that supports scripting for each column using Visual Basic® and JScript® development software. Each transformation can include data quality checks and validation, aggregation, and duplicate elimination. You can also combine multiple columns into a single column, or build multiple rows from a single input.Using the DTS Wizard, you can:∙Specify any custom settings used by the OLD DB provider to connect to the data source or destination.∙Copy an entire table, or the results of an SQL query, such as those involving joins of multiple tables or distributed queries. DTS also can copy schema and data between relational databases. However, DTS does not copy indexes, stored procedures, or referential integrity constraints.∙Build a query using the DTS Query Builder Wizard. This allows users inexperienced with the SQL language to build queries interactively.∙Change the name, data type, size, precision, scale, and nullability of a column when copying from the source to the destination, where a valid data-type conversion applies.∙Specify transformation rules that govern how data is copied between columns of different data types, sizes, precisions, scales, and nullabilities.∙Execute an ActiveX script (Visual Basic or JScript) that can modify (transform) the data when copied from the source to the destination. Or you can perform any operation supported by Visual Basic or JScript development software.∙Save the DTS package to the SQL Server MSDB database, Microsoft Repository, or a COM-structured storage file.Schedule the DTS package for later execution.Once the package is executed, DTS checks to see if the destination table already exists, then gives you the option of dropping and recreating the destination table. If the DTS Wizard does not properly create the destination table, verify that the column mappings are correct, select a different data type mapping, or create the table manually and then copy the data.Each database defines its own data types and column and object naming conventions. DTS attempts to define the best possible data-type matches between a source and a destination. However, you can override DTS mappings and specify a different destination data-type, size, precision, and scale properties in the Transform dialog box.Each source and destination may have binary large object (BLOB) limitations. For example, if the destination is ODBC, then a destination table can contain only one BLOB column and it must have a unique index before data can be imported. For more information, see the OLE DB for ODBC driver documentation.Note DTS functionality may be limited by the capabilities of specificdatabase management system (DBMS) or OLE DB drivers.DTS uses the source object’s name as a default. However, you can also add double quote marks (“ “) or square brackets ([ ])around multiword table and column names if this is supported by your DBMS.Data Warehousing and OLAPDTS can function independent of SQL Server and can be used as a stand-alone tool to transfer data from Oracle to any other ODBC- or OLE DB-compliant database. Accordingly, DTS can extract data from operational databases for inclusion in a data warehouse or data mart for query and analysis.Figure 4. DTS and data warehousingIn the previous diagram, the transaction data resides on an IBM DB2 transaction server. A package is created using DTS to transfer and clean the data from the DB2 transaction server and to move it into the data warehouse or data mart. In this example, the relational database server is SQL Server 7.0, and the data warehouse uses OLAP Services to provide analytical capabilities. Client programs (such as Excel) access the OLAP Services server using the OLE DB for OLAP interface, which is exposed through a client-side component called Microsoft PivotTable® Service. Client programs using PivotTable Service can manipulate data in the OLAP server and even change individual cells.SQL Server OLAP Services is a flexible, scalable OLAP solution, providing high-performance access to information in the data warehouse. OLAP Services supports all implementations of OLAP equally well: multidimensional OLAP (MOLAP), relational OLAP (ROLAP), and a hybrid (HOLAP). OLAP Services addresses the most significant challenges in scalability through partial preaggregation, smart client/server caching, virtual cubes, and partitioning.DTS and OLAP Services offer an attractive and cost-effective solution. Data warehousing and OLAP solutions using DTS and OLAP Services are developed with point-and-click graphical tools that are tightly integrated and easy to use. Furthermore, because the PivotTable Service client is using OLE DB, the interface is more open to access by a variety of client applications.Issues for Oracle versions 7.3 and 8.0Oracle does not support more than one BLOB data type per table. This prevents copying SQL Server tables that contain multiple text and image data types with modification. You may want to map one or more BLOBs to the varchar data type and allow truncation, or split a source table into multiple tables. Oracle returns numeric data types such as precision = 38 and scale =0, even when there are digits to the right of the decimal point. If you copy this information, it will be truncated to integer values. If mapped to SQL Server, the precision is reduced to a maximum of 28 digits.The Oracle ODBC driver does not work with DTS and is not supported by Microsoft. Use the Microsoft Oracle ODBC driver that comes with SQL Server. When exporting BLOB data to Oracle using ODBC, the destination table must have an existing unique primary key.Heterogeneous Distributed QueriesDistributed queries access not only data currently stored in SQL Server (homogeneous data), but also access data traditionally stored in a data store other than SQL Server (heterogeneous data). Distributed queries behave as if all data were stored in SQL Server. SQL Server 7.0 will support distributed queries by taking advantage of the UDA architecture (OLE DB) to access heterogeneous data sources, as illustrated in the following diagram.Figure 5. Accessing heterogeneous data sources with UDA翻译DTS 使进口,出口和不同的数据的转变变得容易。

Informix 基本知识

Informix 基本知识Informix 基本知识 (1)1 OnLine 数据库服务器的内部组成 (3)1.1 存储部分 (3)1.1.1 数据库空间 (3)1.1.2 表空间 (4)1.1.3 镜像和日志 (4)1.2 虚拟进程部分 (4)1.3 共享内存部分 (5)1.3.1驻留区(Resident Portion) (5)1.3.2虚拟区(Virtual Portion) (5)1.3.3消息区(Message Portion) (6)1.3.4共享内存的设置 (6)2 事务和日志 (6)3 Informix基本操作 (8)3.1 启动数据库服务 (8)3.2 关闭数据库服务 (8)3.3 状态变换 (8)3.4 客户端连接 (8)3.5 探查数据库状态 (11)3.5.1 检查数据库的基本状态 (11)3.5.2 查阅onstat命令的帮助 (11)3.5.3 查看当前使用的配置文件及内容 (11)3.5.4 查看磁盘使用情况 (11)3.5.5 查看chunk的I/O分配情况 (12)3.5.6 查看逻辑日志信息 (12)3.5.7 查看正运行的session信息 (13)3.5.8 查看表的tblspace信息 (13)3.6 数据库管理操作 (14)3.6.1 初始化数据库空间 (14)3.6.2 增加/删除chunk, dbspace (14)4 有关文件 (14)4.1 数据库配置文件 (14)4.2 数据库服务器名称定义 (14)4.3 执行记录文件 (15)4.4 系统变量 (15)4.5 用户启动脚本 (15)5 日常操作 (16)5.1 获得schema (16)5.2 统计数据更新 (16)5.3 倒出/倒入一张数据表中的数据 (16)5.4 执行预定义的sql脚本 (16)5.5 关闭索引 (16)5.6 关闭/打开日志 (17)5.7 使用ontape工具进行数据备份 (17)5.8 使用dbexport命令进行数据备份 (18)5.9 使用dbimpport命令进行数据恢复 (18)5.10 使用onunload命令进行数据备份 (19)INFORMIX-OnLine是一种高效的具有联机事务处理能力的数据库管理系统。

informix入门基础学习教程


Informix 培训教材
Informix 基本概念
Informix基本概念
2、Shared memory(Virtual Portion): Virtual Portion包含50多种pool(任一个pool都有特殊用途,pool大小以8k 为单位),如: 用户会话数据、数据字典信息、存储过程、线程信息等; Virtual Portion部分的大小可以动态增加; Virtual Portion的初始大小由 Initial Segment表示,以后动态增加的部分称做Additional Segment。 Shared memory(Message Portion): 当client和server之间采用shm通讯方式时,使用Message Portion用来交 换通讯信息;
Poll
是新的session?
n Sqlexec
由sqlexec向client端发送信息
Informix 培训教材
Informix 基本概念
Informix基本概念
3、Virtual Process (VP): server和client连接过程: 1. poll线程负责接受来自client端的请求,如果server和client连接方式是通 过TCP/IP,则poll会侦听一定的端口;如果是通过shared memory方式, poll会从共享内存中的message portion获得信息; 2. 如果client请求是一个新的session,则poll会激活listen线程,listen会为 该客户端建立用户线程(Thread Control Block),同时建立该用户 session(Session Control Block),并分配唯一的session标识session-id; 3. 由相应VP来处理客户请求,在处理完成后,server向client端的通讯信 息由sqlexec线程完成;
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

-1-INFORMIX and IndexingSupport for Data Warehouses

BY PATRICK O'NEILThe surge of interest in data warehousing signals a new customeremphasis on query performance. The good news is that databaseparallelism supplies a crucial aspect of data warehouse performance,an area addressed in current releases from most vendors. Indeedutilities for large data warehouses couldn't do without parallelism: aterabyte of data can't even be read from disk using one disk arm at atime in less than a week. A crucial runtime feature, intra-queryparallelism (or simply query parallelism), gives a system the ability toexecute a single query on a large number of inexpensive CPUssimultaneously. This allows the query optimizer to use all hardwareresources effectively, eliminates the risk of losing all query executionwhen a single processor fails, and permits greatly improved responsetime for high-priority queries.

But parallelism is only half of the solution for data warehouseperformance. Without the best possible indexing techniques, a queryoptimizer can only employ inefficient access methods to executecomplex queries commonly seen in commercial applications. Parallelquery execution alone does not solve this problem, since parallelexecution with suboptimal index methods simply commits moreresources each second to the same inefficient approach. Thisapproach will mean that the customer can achieve needed throughputand response time requirements only at the expense of purchasingadditional hardware to run these inefficient algorithms.

Many consider Informix XPS to provide a state-of-the artimplementation of database parallelism. With the release of decisionsupport system (DSS) indexing, Informix provides a needed componentfor optimal data warehouse performance, or indeed for any database-2-

application where query performance is crucial. This article starts withan introduction to the basic concepts underlying DSS indexing, such asbitmap indexes and join indexes, and then goes into the detailedsyntax of the new Informix indexing features.

RID-LIST AND BITMAP INDEXESA bitmap index is similar to the traditional row identifier (RID)-list indexyou have probably been using for years. In simplest terms, either typeof index consist of a B-tree that allows the system to look up the valueof some column in a table and find all rows that have that columnvalue. But bitmap indexes have important performance advantages incertain regions of behavior.

We start by defining a RID-list. Each row in a table has an assigned RID,or Row IDentifier, which we can think of as a pointer to the row on disk.A RID normally consists of a disk page number and a slot on the diskpage, a specification of the page and position on the page where therecord can be found. A set of rows with a given property can berepresented by the list of RIDs designating where the rows arepositioned, and this is known as a RID-list representation. Mostdatabase system have four byte RIDs (although Oracle RIDs are at leastsix bytes in length), so a list of a million RIDs will normally take up fourmillion bytes of space. RID-lists have traditionally been used in indexesto specify the set of rows associated with each value of some indexedcolumn. If we assume that we are dealing with an index on adepartment store SALES table of 100 million rows, with a columnnamed department having 40 different values (specifying thedepartment where each sale is made), then each department value willhave an associated RID-list with an average of 2.5 million rows. Ofcourse some department values will have fewer associated rows and

some more, but no matter how many RIDs are associated with eachvalue, the total number of RIDs in the index will be 100 million, sinceeach row must have exactly one value (see Figure 1).-3-

B-tree Root Node for department index on the SALES table'children''s clothes' 'china' ... 'sports' ... 'women''s clothes'

'sports'716. . .50215039507110119'sports'. . . ...

Figure 1. Compressed RID-list Index on department, a column of the SALES tableGiven the huge number of RIDs associated with each value in thedepartment index, we don't normally try to bring the RID-list into

memory all at once. It is broken up into fragments of several hundredRIDs, which can be placed on successive B-tree leaf nodes. Also,instead of creating index entries of the form (department_value, RID),

we note that it is a good deal more space-efficient to specify thedepartment value only once at the head of each RID-list fragment. This

相关文档
最新文档