分类目录归档:Informix

Informix

pdo_informix

1. Installing Informix Client SDK for Linux x86_64

1.1 Download Informix Client SDK 3.70 for Linux x86_64 from IBM website, https://www-01.ibm.com/marketing/iwm/tnd/search.jsp?rs=ifxdl

1.2 Extract the file, `cd /opt/informix; tar -xvf clientsdk.3.70.FC8DE.LINUX.tar`

1.3 Start installation, `./installclientsdk`, install all

2. Installing PDO Informix

2.1 Download PDO Informix 1.3.1, `wget https://pecl.php.net/get/PDO_INFORMIX-1.3.1.tgz`

2.2 Extract the file, `tar -xvf PDO_INFORMIX-1.3.1.tgz`

2.3 `cd PDO_INFORMIX-1.3.1` and compiling

2.3.1 `phpize`

2.3.2 `./configure –with-pdo-informix=/opt/informix`, if getting error `configure: error: Cannot find php_pdo_driver.h`, do `ln -s /usr/include/php5 /usr/include/php` and try again.

2.3.3 `make`

2.3.4 `make install`

3. Include pdo_informix.so in php.ini

Other reference: http://stackoverflow.com/questions/19909075/php-and-informix-on-debian-how-to-install-configure-the-pdo

Sample Code:

<?php

$db = new PDO("informix:host=hostname_or_ipaddr; service=port;database=dbname; server=instancename; protocol=onsoctcp;EnableScrollableCursors=1;", "username", "password");

print "Connection Established!\n\n";

$stmt = $db->query("select * from tablename");
$res = $stmt->fetch( PDO::FETCH_BOTH );
$rows = $res[0];
echo "Table contents: $rows.\n";

?>

Perform point-in-time table-level restore in Informix Dynamic Server

This article describes how to perform point-in-time table-level restores that extract tables or portions of tables from archives and logical logs. Table-level restore is a new feature for IBM® Informix® Dynamic Server Version 10.0. This feature is useful where portions of a database, a table, a portion of a table, or a set of tables need to be recovered and also useful in situations where tables need to be moved across server versions or platforms.

Introduction

Informix Dynamic Server V10.0 (IDS) provides you with the ability to easily extract data in tables of databases from a 0-level backup to a specified point in time. The extracted data can be loaded in internal, external tables or ASCII files. This feature lets you:

  • Extract a table or a set of tables
  • Filter the retrieved data
  • Retrieve just a subset of columns
  • Repartition the data
  • Place data in the same version of the database, or in a different database version with a different machine architecture.

To use this feature, you use the archecker utility to extract and load data to specific tables.

Overview of the archecker utility

The archecker utility requires the following:

  • The archecker configuration file
  • The schema command file
  • The archecker command, in order to execute

继续阅读

使用 Informix Dynamic Server 的复制技术

在服务器、域和集群中使用复制技术

IBM® Informix® Dynamic Server(IDS)一直以来都是一种具备强大复制技术的数据库。企业复制(Enterprise Replication,ER)和高可用性数据复制(High-Availability Data Replication,HDR)多年来为客户提供了可靠的服务。在较新的 IDS 版本 11.1 以及目前的 11.5 中,又添加了一些新的技术:远程独立(Remote Standalone)备用服务器和共享磁盘(Shared-Disk)备用服务器。本文将通过使用这些技术来简要了解各种技术的特征和细节。
继续阅读

通过 oncheck 理解 Informix 索引结构

通过 oncheck 理解 Informix 索引结构

在 Informix 数据库中,索引对数据库的性能有着重大的影响。本文通过 oncheck 命令来展示实际的 Informix 索引结构,使读者对 Informix 索引的层次、根节点、分支节点、叶节点等有较深的理解,明白“单列索引和多列索引”、“唯一索引和非唯一索引”在内部结构上的区别。读者理解 Informix 索引结构后,可以更好的设计 Informix 索引,较大的提升 Informix 数据库和 Informix 应用程序的性能。

引言

在 Informix 中,可以通过索引来快速定位“需要使用的数据行”。那么一般的 Informix 索引是通过什么结构来实现“快速定位数据行”的目的呢?本文将通过 oncheck 命令来展示实际的 Informix 索引结构,为您揭晓这个问题的答案。 继续阅读

onunload and onload

The onunload functionality of the application is a database or table written to tape, the program in binary form to the disk page as a unit to remove the data, the data unloaded in this way the efficiency of higher than dbexport.
Read to use onload applications created by onunload tape. The machine receiving data and create a tape machine must have the same page size.
Only users with database DBA privileges to remove the database. Only the owner of the table or the table where the database user with DBA privileges can remove the table.
Remove the table, only the data and index pages associated with the table is removed. Defined for the table access permissions and synonyms related to the table or view is not unloaded onto the tape.
Remove the operation during onunload exclusive way to block new database or table.

onunload 应用程序的功能是将数据库或表写到磁带上,该程序以二进制形式,以磁盘页为单位卸下数据,这种方式卸下的数据其效率高于dbexport。
读由onunload创建的磁带使用onload应用程序。接收数据的机器和创建磁带的机器必须具有相同的页面大小。
只有具有数据库DBA特权的用户才能卸下该数据库。只有表的属主或具有该表所在数据库的拥有DBA特权的用户才可以卸下该表。
卸下表时,只有与该表有关的数据页和索引页被卸下。为该表定义的存取权限和与表有关的同义词或视图未被卸到磁带上。
在卸下操作期间,onunload以排他方式封锁新数据库或表。

继续阅读

Moving (Resetting) the sysadmin database to a new dbspace in IBM Informix Dynamic Server (IDS)

Question
How do you move the sysadmin database to a new dbspace?

Answer

The sysadmin database is created in the root dbspace during database server initialization. This database is required for the Scheduler API and Remote Administration feature.

Use the SQL Administration API command RESET SYSADMIN to move the sysadmin database to a different dbspace. This command drops the sysadmin database from the root dbspace and recreates it in the specified dbspace. 继续阅读

在 Linux 上设置多处驻留

Linux 上设置多处驻留

您可在同一台计算机上设置多个独立的数据库服务器环境。

完成以下任务可设置多处驻留:

继续阅读

rootdbs空间不足引起的备份失败

症状1:

Informix Dynamic Server 2000 Version 9.21.UC2 for LINUX

2011-02-15 09:49:55 17296 17294 /home/informix/bin/onbar_d -b -l
2011-02-15 09:49:55 17296 17294 Begin backup logical log 147643.
2011-02-15 09:49:55 17296 17294 Successfully connected to Storage Manager.
2011-02-15 09:49:55 17296 17294 SQL -271 Could not insert new row into the table.
2011-02-15 09:49:55 17296 17294 ISAM -131 ISAM error: no free disk space
逻辑备份出现问题
2011-02-17 09:14:37 11293 11291 /home/informix/bin/onbar_d -b -l
2011-02-17 09:14:38 11293 11291 Begin backup logical log 149938.
2011-02-17 09:14:38 11293 11291 Successfully connected to Storage Manager.
2011-02-17 09:14:38 11293 11291 The logical logs are full. ON-Bar may encounter errors writing to the sysutils database.
2011-02-17 09:14:38 11293 11291 SQL -691 Missing key in referenced table for referential constraint (informix.r102_11).
2011-02-17 09:14:38 11293 11291 ISAM -111 ISAM error: no record found.
2011-02-17 09:14:38 11293 11291 SQL -691 Missing key in referenced table for referential constraint (informix.r103_16).
2011-02-17 09:14:38 11293 11291 ISAM -111 ISAM error: no record found.
2011-02-17 09:14:38 11293 11291 The logical logs are full. ON-Bar may encounter errors writing to the sysutils database.
2011-02-17 09:14:38 11293 11291 SQL -691 Missing key in referenced table for referential constraint (informix.r102_11).
2011-02-17 09:14:38 11293 11291 ISAM -111 ISAM error: no record found.
2011-02-17 09:14:38 11293 11291 /home/informix/bin/onbar_d complete, returning 148 (0x94)

经onstat -d 查询,rootdbs空间不足,而rootdbs中有被人创建了其它库表索引(估计语句中没有指定dbspace导致),清理这些索引以增加剩余空间恢复正常备份或者为rootdbs添加chunk亦可 继续阅读

如何让informix数据库再次进入到恢复模式,来完成之前失败的数据备份恢复操作?

如何让informix数据库再次进入到恢复模式,来完成之前失败的数据备份恢复操作?
本文主要介绍,在对数据库的备份进行恢复操作失败的情况下,如何再次进入恢复模式,继续之前的恢复数据库操作,而不必重头再次做起。
通常情况下,数据库如果正在做备份的恢复工程中,如果把数据库停下来,则我们需要重头执行整个数据库恢复操作,这样会比较浪费客户的时间,有没有更好的方法呢?
如果数据库的物理恢复完成的情况下,我们中断了数据库的逻辑日志恢复阶段,则我们可以有以下机会跳过再次进行物理恢复数据的过程,而直接进入到未完成的逻辑日志恢复阶段。
步骤:
1. 首先检查online.log, bar_act.log确认数据库的物理恢复已经完成,如果数据物理恢复阶段没有完成的情况下,需要重头执行恢复命令。
2. onmode -ky把数据库停下来。
3. onbar -r , 或者 onbar -r -l 来继续恢复逻辑日志,并把数据库转换到静止模式。
用户可以使用以上步骤,而不必关心ONCONFIG中的RESTARTABLE_RESTORE参数配置。
RESTARTABLE_RESTORE该参数只使用于onbar -RESTART命令的执行,缺省值为ON.
更多信息可以参考 IBM Informix Backup & Restore Guide等资料。