分类目录归档:Informix

Informix

How to allocate a large memory space for Informix shared memory segments

Troubleshooting

Problem

How to allocate a large memory space for Informix shared memory segments on Red Hat Linux 3 (RHEL3).

Resolving The Problem


PROBLEM


You are using IBM® Informix® Dynamic server (IDS) on on Red Hat Linux 3. When you try to allocate more that 1.8 GB (Gigabytes) of shared memory, the following error message appears in the message log file.

13:52:26 shmat: [ENOMEM][12]: out of available data space, check system memory parameters (e.g. MAXMEM).

SCOPE

The following products and operating systems are affected:

Product NameProduct Version(s)Hardware VendorOperating System
IBM® Informix® Dynamic Server™10.00.UC3 AllRed Hat Linux 3


CAUSE


The limitation of 1.8 GB is due to the placement of the IDS Shared Memory base address which by default is 0x44000000.

Important: This is only one possible cause of the problem. If this document does not provide you with a solution to your problem, you should search for other documents that refer to this topic.


SOLUTION

The layout of shared memory can be seen by running the following command (pid is the process id of the main CPU VP).

$ cat /proc/”pid”/maps

<deleted>
089f8000-08b7c000 rw-p 009b0000 08:02 655537     /usr3/products/10.0/bin/oninit
08b7c000-08bfe000 rw-p 00000000 00:00 0
0a01b000-0a03c000 rw-p 00000000 00:00 0
<Shared memory starts here>
44000000-45419000 rw-s 00000000 00:04 8519685    /SYSV52c44801 (deleted)
45419000-49419000 rw-s 00000000 00:04 8552455    /SYSV52c44802 (deleted)
49419000-494a0000 rw-s 00000000 00:04 8585224    /SYSV52c44803 (deleted)
<Shared memory ends here>
b75ea000-b75ed000 rw-p 00001000 00:00 0
bffbc000-c0000000 rwxp fffc0000 00:00 0

With the default SHMBASE, you can allocate a total shared memory allocation (RESIDENT + MESSAGE + VIRTUAL) of approximately 1.845GB

0xb75ea000 – 0x44000000 = 0x735EA000
= 1935581184
= 1,845 GB (approximately)

This can be seen from output of the onstat command:

$ onstat -g seg

IBM Informix Dynamic Server Version 10.00.UC3     — On-Line — Up 00:00:16 — 1821120 Kbytes

Segment Summary:
id       key        addr     size       ovhd     class blkused  blkfree
8617989  1388595201 44000000 21073920   215476   R     5141     4
8650759  1388595202 45419000 1843200000 56904    V     3490     446510  
8683528  1388595203 b31e9000 552960     672      M     135      0
Total:   –          –        1864826880 –        –     8766     446514

   (* segment locked in memory)

However, if the Shared Memory Base address is lowered down from 0x44000000 to 0x0b000000, you can allocate a total memory allocation of almost 2.8GB.

Set:

in your onconfig configuration file and increase shared memory parameters to utilise more memory.

$ onstat -g seg

IBM Informix Dynamic Server Version 10.00.UC3     — On-Line — Up 00:00:21 — 2721120 Kbytes

Segment Summary:
id       key        addr     size       ovhd     class blkused  blkfree
8880133  1388595201 b000000  21073920   215476   R     5141     4
8912903  1388595202 c419000  2764800000 85024    V     3486     671514
8978441  1388595204 b10d1000 552960     672      M     135      0
Total:   –          –        2786426880 –        –     8762     671518

   (* segment locked in memory)

$ cat /proc/731/maps
<deleted?>
089f8000-08b7c000 rw-p 009b0000 08:02 655537     /usr3/products/10.0/bin/oninit
08b7c000-08bfe000 rw-p 00000000 00:00 0
08f32000-08f53000 rw-p 00000000 00:00 0
0b000000-0c419000 rw-s 00000000 00:04 10813445   /SYSV52c44801 (deleted)
0c419000-5ea75000 rw-s 00000000 00:04 10846215   /SYSV52c44802 (deleted)
5ea75000-b10d1000 rw-s 00000000 00:04 10878984   /SYSV52c44803 (deleted)
b10d1000-b1158000 rw-s 00000000 00:04 10911753   /SYSV52c44804 (deleted)
b75ea000-b75ed000 rw-p 00000000 00:00 0
bffbe000-c0000000 rwxp fffc0000 00:00 0

Note: The operating system has split the virtual memory segment into 2 equal sizes. This is because the virtual segment is greater than 2 GB and the operating system segment size has been limited to 2 GB:

$ ipcs -ma

—— Shared Memory Segments ——–
key        shmid      owner      perms      bytes      nattch     status
0x52c44801 10813445   root      660        21073920   14
0x52c44802 10846215   root      660        1382400000 14
0x52c44803 10878984   root      660        1382400000 14
0x52c44804 10911753   root      666        552960     14

来源:https://www.ibm.com/support/pages/how-allocate-large-memory-space-informix-shared-memory-segments-red-hat-linux-3-rhel3

实际问题场景:

IBM Informix Dynamic Server Version 11.70.UC7(CentOS 6.4 32Bit)在进行0级恢复时出现过,具体参数变更如下解决:
SHMBASE 0x44000000 -> 0xB000000L

参考资料:

https://groups.google.com/forum/#!topic/comp.databases.informix/X1cOjaoBnmk

使用Informix审计功能



关于本教程

在本教程中,您将了解到如何通过预防对数据或其他数据库对象进行未授权查看和更改来保障数据安全。此处提供的材料主要包括考试第 8 部分的相关内容,标题为 Security,本教程涉及的主题包括:

  • 连接安全
  • 网络加密
  • 审计
  • 自主访问控制

目标

通过对本教程的学习,您将能够:

  • 了解身份验证、授权和加密的概念及使用方法
  • 允许 non-OS 用户访问数据库
  • 利用 onaudit 在数据库服务器上设置并配置安全审计
  • 利用可信连接和可信上下文连接来增强安全性
  • 使用角色特权来保护数据安全
  • 设置角色分离来加强对数据库服务器用户的访问控制

先决条件

Informix 11.70 安装在本系列教程的第 1 部分进行了介绍。如果还没安装,可下载并安装 IBM Informix 11.70 的副本。Informix 服务器能够帮助您了解 IBM Informix V11.70 系统管理认证考试当中涉及的许多概念。

系统要求

学习本教程时,不需要 IBM Informix 的副本。但是,如果下载了 Informix Innovator-C Edition(参见 参考资料)的免费试用版,并与本教程配套使用,您将收获更大。 继续阅读

Informix数据库的安全审计

Informix动态服务器提供两个级别的访问特权,来保证数据库的安全性。数据库特权控制对数据库的访问和在数据库上创建表和索索引的权力。表的特权指定用户在特定的表上所能进行的操作。

Informix动态服务器支持表级的修改,插入和删除的安全性,同时增强了列级的更新和查询的安全性。分离特权语句用于向用户授予适当的访问基级别的特权,或回收特权。由于Informx安全性是在用户级别上的,因此,不需要进行分离的数据库登录。

存储过程通过建立他们自己的,有别于数据库的许可权限而提供了附加的安全机制。存储过程的所有者向用户授予执行该存储过程的权限,允许用户执行该存储过程中所有的SQL操作,但对其他的数据库访问加以限制。通过使用存储过程来限制用户执行某些用户执行某些数据库的操作,数据库管理员可以提高系统的安全性 继续阅读

Setting up IDS auditing, onaudit

Technote (FAQ)

Question

What are the minimum requirements needed to start IDS auditing?
What are the minimum requirements needed to start onaudit?

Answer

BACKGROUND

IBM® Informix® Dynamic Server™ (IDS) auditing enables the recording of selected user activities on the database server.

This article briefly discusses the set up procedure and provides a demonstration for database server-managed auditing using Informix Dynamic Server for Unix without Role Separation.

继续阅读

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. 继续阅读