728x90

안녕하세요. 2019년 2월 8일자 IBM 알림 메일 내용 중 My notifications의 인포믹스 결함 내용을 소개드립니다.

(IT27956: SYSSESSIONS OCCASIONALLY NOT RETURNING CURRENT SESSION)

CURRENT 세션에 대한 정보가 가끔씩 표시되지 않는 결함에 대한 내용입니다.

보통 내용이 상세하게 설명되지 않은 경우가 많은데, 결함 내용을 재현하기 위한 프로그램 코드도 공개되어 있네요.

코드는 인포믹스를 사용하는 고객에게서 제공되었다고 하네요.

우선 에러에 대한 설명입니다.


Error description

Customers are facing again the problem of missing sessions in
sysmaster:syssessions (as reported in defect idsdb00096417) in
IDS 12.10.FC12W1.
The defect idsdb00096417 should be fixed in IDS 12.10.FC11.
However I am able to reproduce the issue in 12.10.FC10,
12.10.FC11, 12.10.FC12 and 12.10.FC12W1 using the following
reproducing scenario (provided by the customer).

고객사에서 사용중인 인포믹스 버전은 12.10이고 Fix level 까지는 정확히 알 수가 없네요.

다만 내용에서 유추하건데 12.10.FC10 버전에서 위의 현상이 최초로 발견된 것으로 보이고,

12.10.FC12W1 버전에서도 동일하게 재현된다고 하니 2019년 2월 11일 현재까지는 결함이 수정된 버전은 없는 상태입니다.


아래는 재현 시나리오에서 사용한 ESQL/C 코드와 쉘스크립트 내용입니다.


============== test_ec.ec ==============

#include <stdio.h>


$int c, sid;


main()

{

$database stores_demo;

$select DBINFO('sessionid') INTO :sid FROM sysmaster:sysdual;

$select COUNT(*) INTO :c FROM sysmaster:syssessions s WHERE

s.sid = :sid;

if ( c == 0 )

printf("SID: %d Count: %d\n",sid,c);

sleep(1);

}

===================================


============== test_ec_connections.sh ======

#!/bin/bash


LOOP_MAX=$1


while true

do

LOOP=1

while [ $LOOP -le $LOOP_MAX ]

do

./test_ec.exe &

LOOP=`expr $LOOP + 1`

done

sleep 2

date

done


===================================


$ esql -o test_ec.exe test_ec.ec


먼저 test_ec.ec 코드 내용을 살펴보겠습니다.

1. 인포믹스의 stores_demo에 접속

2. 접속한 현재 자신의 세션번호 확인

3. sysmaster:syssessions 테이블에서 자신의 세션번호 갯수 확인

>> 자신의 세션번호 갯수가 0개이면 메시지 출력


너무나 당연하게도 3번에서는 접속이 유지된 상태에서 자신의 세션번호 개수를 확인하는 것이니 1개입니다.

그런데 0개가 나오는 경우가 있다는 건데요.

여기서 이어지는 쉘 스크립트에서는 컴파일된 test_ec 프로그램을 동시에 여러개 실행하는 모양새가 됩니다.


우선은 아래 환경에서 위와 동일한 프로그램으로 테스트를 해봤습니다.

시스템 환경은 아래와 같습니다.

O/S : AIX 6.1

DBMS : Informix 11.50.FC9W3 / 11.70.FC9 / 12.10.FC6WE / 12.10.FC8WE / 12.10.FC12W1WE


문제가 보고된 12.10.FC12 버전에서 실행한 결과입니다.

$ onstat -


IBM Informix Dynamic Server Version 12.10.FC12W1WE -- on-Line -- Up 00:26:56 -- 234320 Kbytes


$ ./test_ec_connetions.sh 10

Mon Feb 11 23:24:22 KORST 2019

...

Mon Feb 11 23:24:47 KORST 2019

Mon Feb 11 23:24:50 KORST 2019

SID: 6081 Count: 0

Mon Feb 11 23:24:52 KORST 2019

SID: 6091 Count: 0

Mon Feb 11 23:24:54 KORST 2019

SID: 6100 Count: 0

Mon Feb 11 23:24:56 KORST 2019

SID: 6111 Count: 0

Mon Feb 11 23:24:58 KORST 2019

SID: 6120 Count: 0

Mon Feb 11 23:25:00 KORST 2019

SID: 6131 Count: 0

Mon Feb 11 23:25:02 KORST 2019

SID: 6140 Count: 0

Mon Feb 11 23:25:04 KORST 2019

SID: 6151 Count: 0

Mon Feb 11 23:25:06 KORST 2019

SID: 6160 Count: 0

Mon Feb 11 23:25:09 KORST 2019

SID: 6171 Count: 0

Mon Feb 11 23:25:11 KORST 2019

Mon Feb 11 23:25:13 KORST 2019

Mon Feb 11 23:25:15 KORST 2019

Mon Feb 11 23:25:17 KORST 2019

Mon Feb 11 23:25:19 KORST 2019

Mon Feb 11 23:25:21 KORST 2019


지속적으로 발생하지 않고 간혹 발생하는데요. 특정 세션 번호만 누락되는 것인지 해서 

아래 조건 절을 생략하고 확인해 봤습니다.


$select DBINFO('sessionid') INTO :sid FROM sysmaster:sysdual;

$select COUNT(*) INTO :c FROM sysmaster:syssessions s WHERE

s.sid = :sid;

if ( c == 0 )     <<  제거한 내용

printf("SID: %d Count: %d\n",sid,c);


$ ./test_ec_connetions.sh 10

SID: 6278 Count: 1

SID: 6279 Count: 1

SID: 6280 Count: 1

SID: 6281 Count: 1

SID: 6282 Count: 1

SID: 6283 Count: 1

SID: 6285 Count: 1

SID: 6284 Count: 1

SID: 6286 Count: 1

SID: 6287 Count: 1

Mon Feb 11 23:32:34 KORST 2019

SID: 6288 Count: 1

SID: 6289 Count: 1

SID: 6291 Count: 0     << 간혹 개수가 확인되지 않는 세션이 존재합니다.

SID: 6290 Count: 1

SID: 6292 Count: 1

SID: 6293 Count: 1

SID: 6294 Count: 1

SID: 6295 Count: 1

SID: 6296 Count: 1

SID: 6297 Count: 1

Mon Feb 11 23:32:36 KORST 2019

SID: 6298 Count: 1

SID: 6299 Count: 1

SID: 6300 Count: 0

SID: 6301 Count: 1

SID: 6302 Count: 1

SID: 6303 Count: 1

SID: 6304 Count: 1

SID: 6305 Count: 1

SID: 6306 Count: 1

SID: 6307 Count: 1

Mon Feb 11 23:32:38 KORST 2019

SID: 6308 Count: 1

SID: 6310 Count: 1

SID: 6309 Count: 1

SID: 6311 Count: 1

SID: 6312 Count: 1

SID: 6313 Count: 1

SID: 6314 Count: 1

SID: 6315 Count: 1

SID: 6316 Count: 1


다른 버전인 11.50과 11.70에서는 재현이 되지 않았습니다.

아직 해당 APAR인 IT27956이 OPEN 상태이므로 곧 해결된 버전이 나오지 않을까 기대해봅니다.


https://www-01.ibm.com/support/entdocview.wss?uid=swg1IT27956

728x90
728x90

안녕하세요. 2019년 2월자 IIUG insider에 따르면 인포믹스 14 버전이 2019년 상반기에 출시될 예정이라고 합니다.

작년에 IIUG World 컨퍼런스에서도 소개가 된 내용인데 버전 숫자까지 공개된 것은 처음이네요..

라고 생각했지만 웹에서 검색해보니 이미 작년부터 14.10 버전이야기가 나오고 있었네요.

서양에서는 13이라는 숫자를 확실히 싫어하는 걸까요?


곧 IBM에서 EAP(Early Access Program)도 시작하지 않을까 생각했는데,

이미 CURSOR 등의 회사나 고객사에서 베타테스트를 진행하고 있었던 모양입니다.

https://www.cursor-distribution.de/en/community/community-informix


아래 링크에서 인포믹스 14.10 버전의 새로운 기능을 확인하실 수 있습니다.

http://www.iiug.org/en/2019/02/04/iiug-insider-issue-222-january-2019/



Enhances log replay performance of remote secondary servers and OLTP transactions

      • Up to 5x improvement in replication enables client applications to sustain near zero latency between primary and secondary servers allowing faster recovery time objective in disaster scenarios.
      • Up to 10% faster than 12.10 for standard OLTP transactions

Provides higher security for encryption keys and integrated backup encryption

      • By supporting remote storage of encryption at rest keys in Amazon Key Manager, an additional layer of security is applied to Informix server encrypted data. Three ciphers AES128, AES192 and AES256 are supported.
      • By supporting remote key management server to generate encryption keys and reducing DBA effort to encrypt Informix data backups, data security in backup media is enhanced without the risk of losing keys. The encryption key is itself encrypted (called Envelop Encryption).
      • Transport Layer Security (TLS) to 1.2 for a higher level of network transport security.

Enhances usability, streamlines administration, and increases uptime

      • By supporting additional in-place alter operations on tables and data types, database downtime is avoided

Provides a new centralized and graphical administration tool called InformixHQ

      • InformixHQ is a modern web console for visualizing, monitoring, and managing your Informix server instances. It is purpose built for ease-of-use, scale-out, and optimizing DevOps needs.
      • It provides critical performance management capabilities, monitoring how key performance metrics are changing overtime and tracking how efficiently Informix is running your workload even when you’ve stepped away from your screen. Its monitoring system feeds directly into a customizable alerting system so you can be immediately alerted via email, Twilio, or PagerDuty whenever an issue occurs on one of your Informix database server instances.
      • It is designed to be scalable to efficiently manage and monitor as many Informix database server instances as you run.
      • It enables collaboration between the DBAs, the app developers, the ops engineers, and management and accessed from any desktop, laptop, or mobile device.
      • InformixHQ is the path forward for graphical monitoring, alerting, and administration of your Informix database servers.

Enhances Unicode support to current V11.0

      • Ability to support storage and processing for text characters that are new over the last 10 years. The new scripts and characters in Version 11.0 add support for lesser-used languages and unique written requirements worldwide.

Enhances time series granularity and spatial projection

      • Supporting Sub-second timestamps allow for very high speed event generation
      • Support for more geodetic and projections systems enables you to track packages in a shipping depot using your own coordinate system

Increased hardware limits at the Workgroup Edition level

      • New limits 24 cores / 32GB RAM enable higher performance and scalability for your critical applications providing even higher return on your Informix investment.

Includes storage optimization at the Enterprise Edition level

      • All Informix Enterprise edition deployments now benefit from the well proven data compression technology already built in Informix.
      • Data compression reduces primary, secondary, backups and log storage while simultaneously enhancing performance by reducing I/O operations.
      • Customers have reported average 4x reductions in database size while experiencing faster I/O operations and faster backups.

Common table expression

      • By implementing the SQL standard CTE, application developers improve readability and maintenance of complex queries, able to re-use CTE result-set multiple times in one query, Pipeline aggregations and write powerful recursive queries.
      • Complex queries can be divided into simple, ad hoc, logical building blocks. These simple blocks can then be used to build more complex, interim CTEs until the final result set is generated.

Setting up Informix instance/or database level replication using Enterprise Replication

      • Single command that automates setting up of Enterprise Replication and data migration between two Informix server instances located either on-prem or in the cloud. This command automates tasks such as defining Enterprise Replication domain between the two servers, adding key columns for the tables, creating required storage spaces for the databases, copying database schema from source server to target serve, creating replicate definitions and finally synchronizing data between source and target server instances, all in a transactional, flexibly phased manner, with no downtime.


** 출처

http://www.iiug.org/en/2019/02/04/iiug-insider-issue-222-january-2019/

http://www.hamburg-data.de/en/news/136-soon-informix-14-10

https://www.cursor-distribution.de/en/community/community-informix

728x90
728x90

인포믹스 11버전부터 데이터베이스 관리를 위한 sysadmin 데이터베이스가 있습니다.


sysadmin 데이터베이스에는 인포믹스 상태 정보를 보관하기 때문에,

계속해서 데이터가 유입된다면 데이터를 주기적으로 삭제하거나, 처음부터 여유있는 데이터 파일에 배치하는 것이 좋습니다.


그래서 sysadmin 데이터베이스를 스크립트를 사용하거나,

sysadmin 데이터베이스의 admin/task 프로시저를 사용해서 재생성할 수 있습니다.


1. 수동으로 sysadmin 데이터베이스 다시 만들기

IBM의 Technote에 따르면 $INFORMIXDIR/etc/sysadmin에 sysadmin 데이터베이스를 재생성하기 위한 스크립트가 있습니다.

아래의 명령을 순서대로 실행합니다.


cd $INFORMIXDIR/etc/sysadmin;

dbaccess - db_uninstall.sql;

dbaccess - db_create.sql;

dbaccess sysadmin db_install.sql;

dbaccess sysadmin sch_tasks.sql;

dbaccess sysadmin sch_aus.sql;

dbaccess sysadmin sch_sqlcap.sql;

dbaccess sysadmin start.sql;


여기서 db_create.sql 파일 내용을 살펴보면 데이터베이스를 생성하는 구문이 있습니다.


CREATE DATABASE sysadmin WITH LOG;


파일 내용을 수정해서 이 구문으로 dbspace를 지정할 수도 있을 것입니다.


2. sysadmin 데이터베이스의 프로시저를 사용해 sysadmin 데이터베이스 이동하기

sysadmin 데이터베이스에 admin/task 프로시저를 사용해서 sysadmin 데이터베이스를 재생성할 수 있습니다.


execute function task("reset sysadmin", "admindbs"); 


dbspace 명을 지정하지 않으면 rootdbs에 만들어집니다. 재생성이 완료되면 스케줄러가 자동으로 재시작됩니다.



** 참고

https://www-01.ibm.com/support/docview.wss?uid=swg21266296

https://www-01.ibm.com/support/docview.wss?uid=swg21420189

728x90
728x90

안녕하세요. 인포믹스 12.1 이전 버전에는 RANK/DENSE_RANK 함수 기능이 제공되지 않습니다.

따라서 별도 프로그램을 사용해야 합니다.


인터넷을 검색해보니 변수 처리하거나 상호연관 서브쿼리 (Correlated sub-query)를 이용하는 방법이 일반적인 것 같습니다.

참고해서 인포믹스 SQL과 FUNCTION으로 구현해 보았습니다.


## 샘플 데이터 입력

DROP TABLE scores;

CREATE TABLE scores

     (

         id serial not null,

         score int not null

     );


INSERT INTO scores (score) VALUES     (50);

INSERT INTO scores (score) VALUES     (40);

INSERT INTO scores (score) VALUES     (75);

INSERT INTO scores (score) VALUES     (80);

INSERT INTO scores (score) VALUES     (55);

INSERT INTO scores (score) VALUES     (50);



## SQL문 실행 예제

SQL문으로 RANK/DENSE_RANK 기능을 구현한 예제입니다.


select id, score, 

(select count(*)::int+1 end from scores a where a.score > b.score) rank,

(select count(distinct(a.score))::int+1 end from scores a where a.score > b.score) dense_rank

from scores b order by score desc;


         id       score          rank    dense_rank


          4          80             1             1

          3          75             2             2

          5          55             3             3

          1          50             4             4

          6          50             4             4

          2          40             6             5




## 함수로 구현 (ranking/dense_ranking)

동일한 값에 대한 순위를 평가하는 방법에 따라 RANK/DENSE_RANK 함수로 구분됩니다.

같은 세션에서 전역변수 처리하므로 여러번 실행하려면 init_ranking변수를 초기화 해야합니다.


DROP FUNCTION ranking;

CREATE FUNCTION  ranking (curr_val int) returning int ;

define global counter int default 0;

define global last_val int default 0;

define global seq_val int default 0;


if counter = 0 then

let counter = counter + 1;

elif seq_val - counter = 0 and last_val != curr_val then

let counter = counter + 1;

end if


let seq_val = seq_val + 1;

let last_val = curr_val;


if seq_val - counter > 1 then

return seq_val;

end if


return counter;

end function;



DROP FUNCTION dense_ranking;

CREATE FUNCTION  dense_ranking (curr_val int) returning int ;

define global counter int default 0;

define global last_val int default 0;


if counter = 0 or last_val != curr_val then

let counter = counter + 1;

end if


let last_val = curr_val;


return counter;

end function;



CREATE PROCEDURE  init_ranking ();

define global counter int default 0;

define global last_val int default 0;

define global seq_val int default 0;


let counter = 0;

let last_val = 0;

let seq_val = 0;

end procedure;



## 함수 실행 예제

call init_ranking ();

select id, score, ranking (score) rank from (select id,score from scores order by score desc);



         id       score        rank


          4          80           1

          3          75           2

          5          55           3

          1          50           4

          6          50           4

          2          40           6



call init_ranking ();

select id, score, dense_ranking (score) dense_ranking from (select id,score from scores order by score desc);



         id       score dense_ranking


          4          80             1

          3          75             2

          5          55             3

          1          50             4

          6          50             4

          2          40             5



코드는 예외처리가 더 필요할 것 같지만 결과는 잘 나온 것 같습니다.

참고가 되시길 바랍니다.



참조 사이트

https://mattmazur.com/2017/03/26/exploring-ranking-techniques-in-mysql/

http://informix-myview.blogspot.com/2012/09/in-search-of-rownum.html

728x90
728x90


Informix Dynamic Server and Linux -- Up and running

A cookbook for installing Linux and IDS





IDS was one of the first commercial database products ported to Linux. Today the advantages of running IDS 10.0 on the Linux platform are:

  • Support for new Linux platforms
  • Transparent optimization and exploitation of Linux environments
  • Exploitation of Linux 2.6 kernel features
  • Utilization of asynchronous I/O and direct I/O for enhancing I/O performance
  • Processor affinity to achieve improved scalability and parallelism
  • Performance optimization using configurable page sizes
  • Additional installation methods on Linux systems
  • Simple Network Management Protocol (SNMP) support
  • Interprocess communication with stream pipes
  • Scalability on the 2.6 kernel

This article describes a test configuration of IDS on Linux. By following the details I describe, you should be able to customize your own IDS configuration on Linux. We'll start by looking at the setup of Linux itself.

Installing Linux

Technical details for the sample system

The system used for installing Linux and IDS was a standard PC:

  • Pentium III 600MHz
  • 512MB RAM
  • 2 x 15.3GB disks (Maxtor 51536U3 ATA)

For IDS version 10.0 (32-bit) the CPU must be compatible with an Intel i686. Compatible CPU types should be at a minimum Intel Pentium II / Pentium Pro or AMD Athlon. For our sample system, the first disk was dedicated for installing the Linux OS, and the second disk provided space for the IDS databases. No partitions should exist on the disks.

Red Hat Enterprise Linux 4

For this example, Red Hat Enterprise Linux AS release 4 (Nahant) was installed on the sample PC. The following steps will help you to set up a Linux system that is ready to install and run IDS. Please note, the installation of Linux will destroy any operating system and data on the PC.

Detailed instructions can be found at the "Red Hat Enterprise Linux Documentation" page in the document "Red Hat Enterprise Linux Installation Guide for the x86, Itanium, and AMD64 Architectures.". See the Related topics section "Learn" for links.

During installation, you can use the default settings in most cases. Here are some hints and exceptions:

  • Boot the PC from the first of the 4 CDs.
  • In step Language Selection choose English.
  • In step Keyboard Configuration choose the layout for your keyboard.
  • In step Upgrade Examine select Install Red Hat Enterprise for a fresh install.
  • In step Automatic Partitioning select /dev/hda only (deselect /dev/hdb).
  • In step Package Installation Defaults select Customize software packages ....
  • In step Package Group Selection, make these selections:
    • in chapter Applications select Graphical Internet (get Firefox browser).
    • in chapter Development select Legacy Software Development (get packages for compatibility to older Red Hat versions).
  • Reboot after the installation is completed.
  • Log in as user root and open a terminal (Applications -> System Tools -> Terminal).
  • For IDS graphical tools, install OpenMotif runtime from CD #3:
    • Put CD #3 in the drive. It should be automatically mounted
    • To install the package, type following command in the terminal:
      1
      rpm -Uvh /media/cdrom/RedHat/RPMS/openmotif-2.2.3-6.RHEL4.2.i386.rpm
    • To eject the CD from the drive type the command:
      1
      eject
  • To access IDS raw devices with Kernel Asynchronous Input Output (KAIO), install libaio from CD#3:
    • Put CD#3 in the drive. It should be automatically mounted.
    • To install the package, type following command in the terminal:
      1
      rpm -Uvh /media/cdrom/RedHat/RPMS/libaio-0.3.102-1.i386.rpm
    • To eject the CD from the drive type the command:
      1
      eject

Novell SUSE Linux Enterprise Server 9

For this example SUSE Linux Enterprise Server 9 (SLES 9) was installed on the sample PC. The following steps should help to set up a Linux system which is ready to install and run IDS. Please note, the installation will destroy any operating system and data on the PC.

Detailed instructions can be found at the "SUSE Linux Documentation" page in the document "SUSE LINUX Enterprise Server 9 Administration and Installation" (PDF). See the Related topics section "Learn" for links.

During installation, you can use the default settings in most cases. Some hints and exceptions are listed below:

  • Boot the PC from the first of the 4 binary CDs.
  • In step Select your language, choose English (US).
  • In step Installation Settings
    • Click on Keyboard layout and choose the appropriate layout.
    • Click on Partitioning and check swap and root partitions are created in /dev/hda.
      • Choose Base partition setup on this proposal.
      • Choose root partition (should be /dev/hda2) and change its file system type to ext3 using the Edit menu.
    • Click on Time Zone and choose the appropriate time zone.
  • Accept the installation settings and confirm the start of installation.
  • Reboot after the installation is completed.
  • Log in and open a terminal (click on terminal looking icon in the panel).

Installing IDS

For this example, the trial version of IDS version 10 (32-bit) can be downloaded using installed Firefox or Konqueror browser from "Informix product family -- How to get Informix product downloads -- IBM Software" page. See the Related topics section "Get products and technologies" for a link. Click on Informix Dynamic Server EE V10.0 Trials for getting the tar archive iif.10.00.UC3R1TL.Linux.tar and save it to /tmp directory. Sign in with IBM ID and password may be required. Choose download using http.

If you are not already logged in as user root, then switch user id to root:

1
su -

Create group and user informix, and enter password:

1
2
3
groupadd informix<br>
useradd -g informix -m informix<br>
passwd informix

Unpack the downloaded archive of IDS:

1
2
3
4
mkdir /opt/informix<br>
chown informix:informix /opt/informix<br>
cd /opt/informix<br>
tar xvf /tmp/iif.10.00.UC3R1TL.Linux.tar

If you purchased IDS version 10, then you will probably get the IDS bundle. In this case copy the contents of directory SERVER of the unpacked bundle to the working directory and proceed.

Set environment:

1
export INFORMIXDIR=/opt/informix

Install the IDS packages:

1
./install_rpm -acceptlicense=yes

Logout from user root:

1
exit

Configuring IDS

Set up the environment

If you are not already logged in as user informix, then switch user id to informix:

1
su - informix

Create an environment file called ids.env using a graphical text editor (such as gedit or kate), for example:

1
gedit ids.env

Or, use the famous console editor vi:

1
vi ids.env

Add the following lines to the ids.env file:

1
2
3
export INFORMIXDIR=/opt/informix<br>
export INFORMIXSERVER=demo_on<br>
export PATH=$INFORMIXDIR/bin:$PATH

Save the file and exit the editor.

Set the environment for IDS:

1
. ./ids.env

(type: dot blank dot slash ids.env)
Each time you need to access this IDS instance you can set the environment from this file again.

Create and edit IDS configuration files:

1
2
3
cd $INFORMIXDIR/etc<br>
cp onconfig.std onconfig<br>
cp sqlhosts.std sqlhosts

Edit file onconfig using the editor of choice (see above), change parameters from - to:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ROOTPATH        /dev/online_root
-
ROOTPATH        /home/informix/dbspaces/online_root
 
MSGPATH         /usr/informix/online.log
-
MSGPATH         /home/informix/logs/online.log
 
LTAPEDEV        /dev/tapedev
-
LTAPEDEV        /dev/null
 
DBSERVERNAME
-
DBSERVERNAME    demo_on

Find the network node hostname of the machine:

1
uname -n

asterix is printed for example.

Edit file sqlhosts using the editor of choice (see above), change line from - to:

1
2
3
demo_on onipcshm        on_hostname     on_servername
-
demo_on onipcshm        asterix         demo_on

(Replace the word "asterix" with the network node hostname of your machine.)

Create the logs directory:

1
2
cd<br>
mkdir logs

Create the root dbspace:

1
2
3
4
mkdir dbspaces<br>
cd dbspaces<br>
touch online_root<br>
chmod 660 online_root

Startup and shutdown

Start and initialize the configured IDS instance:

1
oninit -iv

prints following message:

1
2
3
This action will initialize IBM Informix Dynamic Server;
any existing IBM Informix Dynamic Server databases will NOT be accessible -
Do you wish to continue (y/n)?

If you are certain that you want to initialize this instance of IDS, type y to initialize the instance. Note, all data will be lost if the instance has been used previously.

Now IDS is running. For testing purposes, you can create the demo database by executing the script dbaccessdemo7 To access databases, the console utility dbaccess can be used.

You can shut down the IDS instance with the command:

1
onmode -ky

and started (without initialization) with this command:

1
oninit

IDS documentation can be read online at "IBM Informix Dynamic Server information center" page. Manuals for all Informix products in different languages can be found at "Informix library" page. See the Related topics section "Learn" for links.

Configuring a raw device

The whole second disk from the example machine can be configured as a raw device. Please note all data will be lost on this disk.

The first step is to create a partition. For this, use the interactive console utility fdisk. Switch to user id root to run following commands:

1
fdisk /dev/hdb

For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
The number of cylinders for this disk is set to 29651.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
 
Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
 
Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
 
 
The number of cylinders for this disk is set to 29651.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-29651, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-29651, default 29651):
Using default value 29651
 
Command (m for help): p
 
Disk /dev/hdb: 15.3 GB, 15303075840 bytes
16 heads, 63 sectors/track, 29651 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       29651    14944072+  83  Linux
 
Command (m for help): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.

To make sure the OS is informed about the partition table changes, run this command:

1
partprobe

Once the partition /dev/hdb1 is created, its permissions must be changed for use by IDS:

1
2
chown informix:informix /dev/hdb1<br>
chmod 660 /dev/hdb1

Note, the change of permissions may be required again after reboot of the machine. This can be done using an init script.

If you are not already logged in as user informix, then switch user id to informix:

1
su - informix

Set the environment for IDS:

1
. ./ids.env

(Type: dot blank dot slash ids.env)

To remember which chunks are configured, create symbolic links in the dbspaces directory:

1
ln -s /dev/hdb1 /home/informix/dbspaces/chunk1

Now we create the chunk path named '/home/informix/dbspaces/chunk1' of the dbspace named 'dbspace1'. The size of the partition in kilobytes can be found in raw 'Blocks' in output of 'fdisk' command 'p'. It is given as parameter of option '-s' and has the value 14944072 in our example. Switch to userid informix and set ids.env environment to run following commands:

1
2
onspaces -c -d dbspace1 -p /home/informix/dbspaces/chunk1 -o 0 -s
14944072

For testing, create the demo database in dbspace1:

1
dbaccessdemo7 -dbspace dbspace1

Conclusion

In this article we've walked through the installation and configuration of specific versions of Red Hat Enterprise Linux and SUSE Linux Enterprise Server for running IDS 10, to help you get Informix up and running on Linux without difficulty. Adaptation for newer versions of the operating systems should be easy by updating the version numbers of mentioned packages.

https://www.ibm.com/developerworks/data/library/techarticle/dm-0603breitfeld/index.html

728x90
728x90

인포믹스의 memory 스레드를 간략하게 설명한 IBM 문서입니다. mt_purge_cpu_vp_caches 함수관련 이슈가 있어서 찾다보니 발견한 내용입니다. 중국어이긴 하지만 구글번역 등으로 보시면 이해하시는데 무리없으실 겁니다.



疑问

有客户问到,经常从informix服务器运行中, 看到memory线程,想了解下该线程主要做什么用的?

答案

Memory 线程, 是数据库服务器启动时fork的一个线程, 主要是用来持续进行所有cpuvp的private cache memory的清理工作(draining)。
其中, 该线程主要工作在mt_purge_cpu_vp_caches() , 该function主要是把每个VP的private cache entries remove,直到全部完成为止。

相关配置参数: VP_MEMORY_CACHE_KB

相关监控命令: onstat -g vpcache


https://www-01.ibm.com/support/docview.wss?uid=swg22011956

728x90
728x90

Technote (troubleshooting)


Problem(Abstract)

You are trying to drop or disable a trigger but such operation fails with following errors:

242: Could not open database table <table_name>

106: ISAM error: non-exclusive access

Symptom

You have trapped error -106 using 'onmode -I 106' but in the gathered output of 'onstat -k' you do not see any locks on the table for which the error was returned.


Cause

Certain DDL operations require exclusive lock placed on a table. The corresponding session also checks if the table's partition is not used by any other sessions in DIRTY READ mode.

Resolving the problem

There are two possible workarounds for this problem:

1) Use LOCK MODE WAIT for the session which runs the DDL statement.

2) Use undocumented $ONCONFIG parameter & environment variable NONEXCLTRIG.

You can set NONEXCLTRIG to the following values in $ONCONFIG file (engine restart is required so change could take effect):


    NONEXCLTRIG values can be:

    0 - Normal behaviour (exclusive lock is required)
    1 - the trigger DDL can be done without exclusive access to table, only if NONEXCLTRIG environment variable is defined in the session environment.
    2 - the trigger DDL can be done without exclusive access to table.


http://www-01.ibm.com/support/docview.wss?uid=swg21648816

728x90
728x90

Question

During restart an Informix updateable secondary server (either HDR or RSS) may spend a significant amount of time in the 'fast recovery' mode before it becomes available for SQL execution. In this scenario the data replication subsystem generates following message in the message log:

'Started processing open transactions on secondary during startup'.

Question is why does it happen?

Answer

The locks on secondary server are created by recovery threads while replaying logical log records. A secondary server does not able to create the locks when it restarted and at the same time there are open transactions being processed on the primary server, unless it replayed the log records prior to the initial checkpoint.
The updateable secondary server must be kept in the recovery mode until all such prior open transactions are completed in order to maintain the ‘committed read last committed’ isolation level.

You can find open transactions in 'onstat -x' output, which prevent secondary server from going out of 'fast recovery' mode. Following is an example of 'onstat -x' output:

Transactions                                                                                        
address          flags userthread       locks  begin_logpos      current logpos    isol    rb_time  retrys coord
700000030591028  A---- 70000003054f028  0      -                 -                 COMMIT  -        0      
700000030591358  A---- 70000003054f850  0      -                 -                 COMMIT  -        0      
700000030591688  A---- 700000030550078  0      -                 -                 COMMIT  -        0      
<...>
700000030595978  A---- 70000003055abc0  0      -                 -                 DIRTY   -        0      
700000030595ca8  A-B-- 70000003055bc10  0      124:0x0           124:0x2ef018      DIRTY   0:00     0      


In the above output the 'begin_logpos' value for the highlighted transaction is '124:0x0' (where 124 is the logical log number, and 0x0 represents offset into the logical log). The simpler reason of offset '0x0' is secondary server does not know the transaction begin address since it restarted. Therefore, the secondary server will remain in 'fast recovery' mode (however the data replication is continue working) until that transaction is committed or rolled back on the primary server.

on the primary server you can find the open transaction by running onstat -x and grep for the current logpos shown in the secondary:

onstat -x | grep 124:0x2ef018

on the primary you can find the user and session id by running onstat -u and grep for associated userthread obtained from previous onstat -x output:

onstat -u | grep userthread

After some investigation of the session ( onstat -g ses sid ) you might determine it is OK to kill this session so the secondary can complete fast recovery:

onmode -z sessionid



http://www-01.ibm.com/support/docview.wss?uid=swg21626164

728x90
728x90

Technote (FAQ)


Question

A checkpoint is taking too long. A checkpoint is stalled. Checkpoint performance is down.
How do you setup or enable checkpoint tracing?

Answer


1. Set the environment variable TRACECKPT to 1.

    export TRACECKPT=1; 
    setenv TRACECKPT 1;

2. Restart the database server. 

3. Look for checkpoint tracing information in the message log ( online.log ). Here are several examples of what you could see in the message log: 
    First example: 
      15:58:58  2040 buffers dirty 
      15:58:58  oldest lsn loguniq 1, logpos 0xf8 
      15:58:58  Reallocated 1500 dskptrs. 
      15:58:58  Reallocated 2000 dskptrs. 
      15:58:58  Reallocated 2500 dskptrs. 
      15:58:58  2040 dirty pages are to be flushed 

      15:59:02  dskflush() took 4 seconds 
      15:59:02  wait4critex() took 0 seconds 
      15:59:02  N = 2500, Avg = 1260, D_avg = 5040, Dirty = 2040 
      15:59:02  Reallocated 2000 dskptrs. 
      15:59:02  0 buffers dirty 
      15:59:02  oldest lsn loguniq 1, logpos 0xf8 
      15:59:02  safe_dskflush() took 0 seconds 
      15:59:02  Checkpoint Completed:  duration was 4 seconds.

    Second example: 
      15:59:56  1 buffers dirty 
      15:59:56  oldest lsn loguniq 4, logpos 0x187018 
      15:59:56  1 dirty pages are to be flushed 

      15:59:56  dskflush() took 0 seconds 
      15:59:56  wait4critex() took 0 seconds 
      15:59:56  N = 2000, Avg = 945, D_avg = 3781, Dirty = 1 
      15:59:56  Reallocated 1500 dskptrs. 
      15:59:56  0 buffers dirty 
      15:59:56  oldest lsn loguniq 4, logpos 0x187018 
      15:59:56  safe_dskflush() took 0 seconds 
      15:59:56  Checkpoint Completed:  duration was 0 seconds.


http://www-01.ibm.com/support/docview.wss?uid=swg21323236

728x90
728x90

인포믹스에 깨진 (일반적으로는 코드셋이 맞지 않은 경우) 문자열이 입력된 경우가 드물게 있습니다. 

10버전 이하에서는 코드셋 확인이 느슨했기 때문에 코드셋이 맞지 않아도 데이터가 입력되는 경우가 있었던 것 같습니다.


또한 TEXT/CLOB 같은 문자열을 저장하기 위한 타입은 데이터베이스 코드셋에 없는 문자열 입력이 가능하므로 이러한 상황이 발생할 여지가 있습니다.


어쨌든 결론적으로 IFX_UNLOAD_EILSEQ_MODE 라는 환경변수를 설정함으로써 코드셋이 맞지 않은 데이터를 UNLOAD할 수 있습니다.

아래 IBM 문서 내용을 참고해주세요.



Use the IFX_UNLOAD_EILSEQ_MODE environment variable to help migrate databases from Informix® Version 10 to Version 11.50 or 11.70, where character data might be encoded with a codeset that is different than the codeset used to create the Version 10 database.

In earlier versions of Informix, it was possible to load character data into a database that did not match the locale and codeset of the database. For example you could load Chinese data into a database created with the DB_LOCALE=en_US.8859-1 codeset. In newer versions of Informix, to insert Chinese data you would need a database created with the Chinese (DB_LOCALE=zh_tw.big5 locale and codeset.

ImportantFor databases created with Version 10 and Client SDK 2.4, when you attempt to unload the invalid character data an error occurs unless you have set this environment variable. The IFX_UNLOAD_EILSEQ_MODE environment variable enables DB-Access, dbexport, and High Performance Loader (HPL) to unload character and bypass the GLS validation that normally occurs when you unload data by using the Version 11.50 and 11.70 tools.
To use this environment variable, set it to any non-empty string.
Read syntax diagramSkip visual syntax diagram
>>-setenv--IFX_UNLOAD_EILSEQ_MODE--value-----------------------><
value
Any alpha or numeric value. For example: yes, true, or 1.
This environment variable takes effect when character data is being fetched or retrieved from the database.
setenv IFX_UNLOAD_EILSEQ_MODE 1
setenv IFX_UNLOAD_EILSEQ_MODE yes
setenv IFX_UNLOAD_EILSEQ_MODE on
copy to clipboard

This environment variable is similar to setting the EILSEQ_COMPAT_MODE configuration parameter in the onCONFIG file. The configuration parameter affects character data that is inserted into the database, whereas the IFX_UNLOAD_EILSEQ_MODE environment variable affects character data that is unloaded from the database.


출처

https://www.ibm.com/support/knowledgecenter/ko/SSGU8G_11.70.0/com.ibm.sqlr.doc/ids_sqr_416.htm

728x90

+ Recent posts