728x90

* 11.70에서 개선된 통계 갱신 방법


자동 통계 갱신

ONCONFIG 파일에서 AUTO_STAT_MODE, STATCHANGE 파라미터 값을 설정할 때 활성화 된다.

STATCHANGE 값은 테이블 변경에 대한 임계치를 퍼센트 단위로 나타내며 0에서 100사이의 값을 지정한다.

지정한 값에 도달한 테이블은 자동으로 통계 갱신이 이루어진다.


이를 세션 레벨로 설정하려면 다음 명령을 수행한다.

SET ENVIRONMENT STATCHANGE "5";

UPDATE STATISTICS LOW FOR TABLE tab1;


위와 같이 수행하면 onCONFIG 값에 정의한 STATCHANGE 값을 대체하여 통계 갱신이 이루어진다.



테이블 레벨로 설정하려면 다음 명령을 수행한다.

CREATE TABLE tab1(cid serial, lname varchar(32), fname varchar(32)) STATCHANGE 5;

ALTER TABLE tab1 STATCHANGE AUTO;


위와 같이 수행하면 테이블 생성시 지정한 STATCHANGE 값 또는 onCONFIG 파라미터 값을 사용하여 통계 갱신이 이루어진다.



Fragment-Level 통계 갱신

CREATE TABLE 또는 ALTER TABLE 문에서 STATLEVEL을 정의한다.

STATLEVEL은 TABLE, FRAGMENT, AUTO 값중 하나를 선택할 수 있다.


테이블을 생성할 때 다음과 같이 STATLEVEL을 명시한다.

CREATE TABLE tab1(col1 integer, col2 char(10)

FRAGMENT BY expression

(col1 >= 0 AND col1 < 1000) IN dbspace1,

(col1 >= 1000 AND col1 < 2000) IN dbspace2,

(col1 >= 2000 AND col1 < 3000) IN dbspace3,

remainder in rootdbs

STATLEVEL FRAGMENT;


또는 다음과 같이 ALTER 명령을 수행한다.

ALTER TABLE tab1 STATLEVEL FRAGMENT;



http://www.ibm.com/developerworks/data/library/techarticle/dm-1104fragmentstats/index.html#

728x90
728x90

IDS 11.7에 있는 Floating User 라이센스에 대한 설명 입니다


정확한 명칭은 Floating User Single Session Single Install (FUSSSI) 라이센스 입니다설치된 인포믹스 DB intall에 대한 최대 session수 만큼 구매해야하는 user 라이센스 입니다기존 concurrent session 라이센스와 크게 다르지 않은 것으로 판단 됩니다.

Rational Floating 
라이센스처럼 라이센스 센터에서 물리적으로 실시간 확인을 하는 것으로 보이지는 않습니다.

아래 링크는 Floating User Single Session Single Intall Concurrent Session 라이센스에 대한 원문 설명서 입니다.


1. Informix Dynamic Server 11.7 License Program (Floating User Single Session Single Install license
에 대한 설명)
http://www-03.ibm.com/software/sla/sladb.nsf/lilookup/1A073E1463FE4E82852577B9007601C1?opendocument&li_select=1EB66FFD8BB5E510852577B9007601AF


2. Informix Dynamic Server 11.5 License Program (Concurrent Session license
에 대한 설명)
http://www-03.ibm.com/software/sla/sladb.nsf/lilookup/439E79422D3677EF85257679004476D7?opendocument&li_select=F9B7C5C38363423C85257679004476B8


3. 
아울러 IDS 11.7 제품 비교가 되어 있는 페이지도 링크 보내 드립니다.
http://www.ibm.com/developerworks/data/library/techarticle/dm-0801doe/
728x90
728x90

11.50.xC6 버전에서 추가된 기능


테이블 분할 변경 시 트랜잭션 강제 아웃 >> 일정 시간 지난 후, 자동으로 Exclusive Lock 획득

로깅 데이터베이스에서 ALTER FRAGMENT on TABLE 조작을 실행할 때 서버가 테이블에서 로크를 보유하거나 열려 있는 트랜잭션을 강제 아웃시킬 수 있도록 설정할 수 있습니다. 하루 24시간 실행되는 사용 중인 시스템에서 이를 실행할 수 있으며, 분할을 변경하기 전에 세션이 닫힐 때까지 기다리지 않아도 됩니다. 

서버가 트랜잭션을 강제 아웃시킬 수 있도록 설정하면 이 서버는 다른 사용자의 트랜잭션을 롤백합니다. 또한 ALTER FRAGMENT on TABLE 조작을 수행하는 세션이 롤백하는 동안 유지 커서를 닫습니다.

전제조건:

  • informix 사용자이거나 데이터베이스에서 DBA 권한이 있어야 합니다.
  • 테이블이 로깅 데이터베이스에 있어야 합니다.

테이블 분할을 변경할 때 트랜잭션을 강제 아웃시키는 방법:

  1. SET ENVIRONMENT문의 FORCE_DDL_EXEC 환경 옵션을 다음 값 중 하나로 설정하십시오.
    • ALTER FRAGMENT on TABLE문이 발행되는 경우 'on''on'또는 '1'을 사용하여 서버가 테이블에서 로크 및 배타적 액세스를 확보할 때까지 해당 테이블에서 로크를 보유하거나 열려 있는 트랜잭션을 강제 아웃시킬 수 있습니다.
    • 양수는 시간(초)을 나타냅니다. 숫자 값을 사용하여 서버는 테이블에서 배타적 액세스 및 배타적 로크를 확보할 때까지 또는 지정된 시간 제한이 발생할 때까지 트랜잭션을 강제 아웃시킬 수 있습니다. 서버가 지정된 시간에 따라 트랜잭션을 강제 아웃시킬 수 없는 경우, 서버는 트랜잭션 강제 아웃을 중지합니다.
    예를 들어, ALTER FRAGMENT on TABLE문이 발행될 때 FORCE_DDL_EXEC 환경 옵션이 100초동안 작동되도록 설정하려면 다음을 지정하십시오.
    SET ENVIRONMENT FORCE_DDL_EXEC '100';
  2. 트랜잭션을 강제 아웃시키기 전에 서버가 지정된 시간동안 기다리도록 하려면 로크 모드를 대기로 설정하십시오.
    예를 들어, 20초동안 대기하도록 로크 모드를 설정하려면 다음을 지정하십시오.
    SET LOCK MODE TO WAIT 20;

    자세한 정보는 로크 모드를 대기로 설정의 내용을 참조하십시오.

  3. 예를 들어, 분할을 첨부, 분리, 수정, 추가 또는 삭제하려면 ALTER FRAGMENT on TABLE문을 실행하십시오.

FORCE_DDL_EXEC 환경 옵션을 사용하여 ALTER FRAGMENT on TABLE 조작을 완료한 후 FORCE_DDL_EXEC 환경 옵션을 설정 해제할 수 있습니다. 예를 들어, 다음을 지정합니다.

SET ENVIRONMENT FORCE_DDL_EXEC 'OFF'

자세한 정보는 IBM Informix SQL 안내: 구문에서 FORCE_DDL_EXEC 환경 옵션에 대한 주제를 참조하십시오.


http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp?topic=/com.ibm.perf.doc/ids_prf_760.htm

http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=/com.ibm.gsg.doc/ids_rel_241.htm&resultof=%22force_ddl_exec%22%20

http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=/com.ibm.sqls.doc/ids_sqs_2072.htm&resultof=%22force_ddl_exec%22%20


728x90
728x90

인포믹스 관련 블로그

http://www.informix-dba.com/2010/07/increasing-buffers-and-reducing-io-with.html

 

http://performancetips.blogspot.com/2008/08/using-onstat-commands-to-tune-informix.html


http://informix-technology.blogspot.com/2011/03/informix-1170xc2-its-out.html


Effectively working with Informix Servers on AIX

http://www-304.ibm.com/support/docview.wss?uid=swg21579767


인포믹스 제품 Fix Pack 다운로드

https://www-304.ibm.com/support/docview.wss?dc=D420&rs=0&uid=swg24009130&context=SSGU5D&cs=utf-8&loc=en_US

 

인포믹스 / 오라클 데이터베이스 관련 정보

http://www.dbdummy.com/category/informix-database


Frequently Asked Questions for Informix Products

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


Informix Chat with the Lab series

https://www.ibm.com/developerworks/wikis/display/ifmxchatwithlab/Home


Collecting Data: Read first for Informix Family products

https://www-304.ibm.com/support/docview.wss?dc=DB520&rs=630&uid=swg21242979&context=SSGU8G&cs=utf-8&lang=en&loc=en_US


Support Home

http://www-947.ibm.com/support/entry/portal/Overview/Software/Information_Management/Informix_Servers


IBM 인포믹스 테크니컬 커뮤니티

http://www-01.ibm.com/software/kr/data/informix/ITC/relativeWeb.html


인포믹스 ebook

http://findebookee.com/i/informix

728x90
728x90

That's why it is ALWAYS recommended to use symbolic links for chunk paths 

NOT the actual device or file paths. What version of IDS do you have? If 

you are running IDS 10.00 or later, you can restore your last archive and 

remap the chunks during the restore (see the Backup and Restore Guide manual 

for your version).


BTW, your root chunk is NOT working either. Changing ROOTPATH in the 

ONCONFIG file only changes the initial file opening that the engine uses to 

read the reserved pages. once that's done, it closes ROOTPATH and opens all 

of the chunks, including the initial root chunk, using the chunk table found 

in the reserved pages which will be wrong even for the root chunk.


If you are running an earlier version that does not permit chunk renaming 

using ontape/onbar, call us at oninit (www.oninit.com) we may be able to 

help.


Art S. Kagel 

Oninit (www.oninit.com) 

IIUG Board of Directors (art@iiug.org)


Disclaimer: Please keep in mind that my own opinions are my own opinions and 

do not reflect on my employer, oninit, the IIUG, nor any other organization 

with which I am associated either explicitly or implicitly. Neither do 

those opinions reflect those of other individuals affiliated with any entity 

with which I am affiliated nor those of the entities themselves.


On Mon, Mar 30, 2009 at 10:49 AM, ALEXANDRE MARINI < 

amarini@fazenda.ms.gov.br> wrote:


> Hello, friends! 

> I´m having some trouble here. 

> Our O.S. team had added some additional disks on our storage. 

> When they restarted the server, the storage has changed the device letters: 

> from 

> /dev/hdb5, for example, that´s our root dbspace, 

> it changed to /dev/hdc5. 

> Then I made my onconfig ROOTPATH change to the correct device, that´s fine. 

> But for the other dbspaces (/dev/hdb6 and on...) I couldn´t change these 

> paths. 

> I´ve even tryed to edit the oncfg_[servername].[servernum] file, but it´s 

> worthless. When I start the database instance, the file´s re-created 

> somehow. 

> All the problem it´s because we don´t use symbolic links anymore, the paths 

> are all pointing to the real linux devices. 

> Is there some way to change them to symbolic links on the fly" ??? 

> Or just doing a backup / restore (onbar with a rename option flag)??? 

> once more, thanks for all. 


http://www.iiug.org/forums/ids/index.cgi/noframes/read/15370

728x90

'Informix > informix reference' 카테고리의 다른 글

FORCE_DDL_EXEC 환경 옵션  (0) 2011.03.31
informix link  (0) 2011.03.29
How to reorganize a table effectively  (0) 2011.03.14
informix 트랜잭션 관리  (0) 2011.03.12
Informix JDBC 연결 테스트  (0) 2011.03.09
728x90

Question


Too many extents in a table can cause problems:
1. Can impact the performance of accessing the table, engine can not access the data effectively as they are stored discontinuously.
2. Can reach the storage limitation of the table, more data can not be inserted into the table again.

So
1. Need to reorganize a table with many extents and reclaim the space.
2. Decide to delete most rows from a huge table
3. Decide to change the structure of a huge table

Answer


1. Create an object raw table with the same structure as the original table, the differences are table name and table type

2. Transfer data by "insert into ... select * from ..." clause

3. Change the table to standard type, rename or drop the original table, then rename the object table to original table's name

4. Recreate any necessary index and constraint on the new table

Benefit:
1. Process is very efficient
2. Can avoid long transaction
3. Minimize the impact to the original table, can stop the process at any time
4. Don't lose any data

Limitation:
During the transfer of data from original table to object table, the data in original table can be changed unless you lock it or complete this task during a maintenance window.

Example:
We will reorganize a table customer, with one index and one primary key;

create raw table customer_new
(
customer_num serial not null ,
fname char(15),
lname char(15),
company char(20),
address1 char(20),
address2 char(20),
city char(15),
state char(2),
zipcode char(5),
phone char(18)
) extent size 16 next size 16 lock mode page;

insert into customer_new select * from customer;

alter table customer_new type (standard);

drop table customer;

rename table customer_new to customer;

set pdqpriority high;
alter table customer add constraint primary key (customer_num) constraint pk_customer;
create index zip_ix on customer (zipcode) ;


Example:
Need to repack & shrink the table customer_new and release the free space

1. Before action
oncheck -pt stores:customer_new

TBLspace Report for stores:informix.customer_new

Physical Address 2:536
Creation date 11/11/2009 12:11:21
TBLspace Flags 801 Page Locking
TBLspace use 4 bit bit-maps
Maximum row size 134 
Number of special columns 0 
Number of keys 0 
Number of extents 40 
Current serial value 962567 
Current SERIAL8 value 1 
Current BIGSERIAL value 1 
Current REFID value 1 
Pagesize (k) 2 
First extent size 8 
Next extent size 32 
Number of pages allocated 3776 
Number of pages used 3761 
Number of data pages 3760 
Number of rows 52632 
Partition partnum 2097237 
Partition lockid 2097237 

Extents 
Logical Page Physical Page Size Physical Pages
0 2:1438 8 8
8 2:1454 152 152
160 2:1610 40 40
200 2:1654 48 48
248 2:1706 40 40
288 2:1750 48 48
336 2:1802 40 40
376 2:1846 48 48
424 2:1898 40 40
464 2:1942 48 48
512 2:1994 40 40
552 2:2038 48 48
600 2:2090 40 40
640 2:2134 48 48
688 2:2190 88 88
776 2:2286 88 88
864 2:2382 96 96
960 2:2486 80 80
1040 2:2574 96 96
1136 2:2678 80 80
1216 2:2766 96 96
1312 2:2870 80 80
1392 2:2958 96 96
1488 2:3062 80 80
1568 2:3150 96 96
1664 2:3254 80 80
1744 2:3342 64 64
1808 2:3414 96 96
1904 2:3518 80 80
1984 2:3606 96 96
2080 2:3718 176 176
2256 2:3910 176 176
2432 2:4102 192 192
2624 2:4310 160 160
2784 2:4486 160 160
2944 2:4662 192 192
3136 2:4870 160 160
3296 2:5046 192 192
3488 2:5254 160 160
3648 2:5430 128 128
Allocated 3776 pages, there are 52632 rows in this table.

2. Delete some data
dbaccess stores <<!
delete from customer_new where customer_num > 1000;
!

Database selected.

52590 row(s) deleted.

Database closed.

oncheck -pt stores:customer_new

TBLspace Report for stores:informix.customer_new

Physical Address 2:536
Creation date 11/11/2009 12:11:21
TBLspace Flags 801 Page Locking
TBLspace use 4 bit bit-maps
Maximum row size 134 
Number of special columns 0 
Number of keys 0 
Number of extents 40 
Current serial value 962567 
Current SERIAL8 value 1 
Current BIGSERIAL value 1 
Current REFID value 1 
Pagesize (k) 2 
First extent size 8 
Next extent size 32 
Number of pages allocated 3776 
Number of pages used 3761 
Number of data pages 3 
Number of rows 42 
Partition partnum 2097237 
Partition lockid 2097237 

Extents 
Logical Page Physical Page Size Physical Pages
0 2:1438 8 8
8 2:1454 152 152
160 2:1610 40 40
200 2:1654 48 48
248 2:1706 40 40
288 2:1750 48 48
336 2:1802 40 40
376 2:1846 48 48
424 2:1898 40 40
464 2:1942 48 48
512 2:1994 40 40
552 2:2038 48 48
600 2:2090 40 40
640 2:2134 48 48
688 2:2190 88 88
776 2:2286 88 88
864 2:2382 96 96
960 2:2486 80 80
1040 2:2574 96 96
1136 2:2678 80 80
1216 2:2766 96 96
1312 2:2870 80 80
1392 2:2958 96 96
1488 2:3062 80 80
1568 2:3150 96 96
1664 2:3254 80 80
1744 2:3342 64 64
1808 2:3414 96 96
1904 2:3518 80 80
1984 2:3606 96 96
2080 2:3718 176 176
2256 2:3910 176 176
2432 2:4102 192 192
2624 2:4310 160 160
2784 2:4486 160 160
2944 2:4662 192 192
3136 2:4870 160 160
3296 2:5046 192 192
3488 2:5254 160 160
3648 2:5430 128 128

Although the data was deleted, but the space is not released.

3. Then run Repack and Shrink
dbaccess sysadmin <<!
> execute function task("table repack shrink", "customer_new", "stores");
> !

Database selected.

(expression) Succeeded: table repack shrink stores:informix.customer_new 

1 row(s) retrieved.

Database closed.

4. After action
oncheck -pt stores:customer_new

TBLspace Report for stores:informix.customer_new

Physical Address 2:536
Creation date 11/11/2009 12:11:21
TBLspace Flags 801 Page Locking
TBLspace use 4 bit bit-maps
Maximum row size 134 
Number of special columns 0 
Number of keys 0 
Number of extents 1 
Current serial value 962567 
Current SERIAL8 value 1 
Current BIGSERIAL value 1 
Current REFID value 1 
Pagesize (k) 2 
First extent size 8 
Next extent size 32 
Number of pages allocated 8 
Number of pages used 8 
Number of data pages 3 
Number of rows 42 
Partition partnum 2097237 
Partition lockid 2097237 

Extents 
Logical Page Physical Page Size Physical Pages
0 2:1438 8 8

The pages didn't store data were released. Can reclaim lots of space and decrease the number of table's extents.

Related information

Reorganize table by oncheck in IDS 7.31.xDx
Reorganize table by repack and shrink in IDS 11.5


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

728x90

'Informix > informix reference' 카테고리의 다른 글

informix link  (0) 2011.03.29
Chunk path rename - is it possible?  (0) 2011.03.28
informix 트랜잭션 관리  (0) 2011.03.12
Informix JDBC 연결 테스트  (0) 2011.03.09
dbexport/dbimport 수행시 extent size 변경  (0) 2011.03.08
728x90

상태

① onstat -l 로 확인했을 때 logical log file 사용량이 모두 100%

② 인포믹스 엔진 상태

IBM Informix Dynamic Server Version 11.50.FC7 -- on-Line (CKPT REQ) -- Up 10 days 05:40:21 -- 258576 Kbytes


load또는 insert/delete/update로 인하여 logical log가 대량으로 발생할 때 Checkpoint pending 상태로 변경될 수 있다.

정상 상태로 변경하려면 다음 순서대로 수행한다.


1. onconfig 파일의 TAPEDEV, LTAPEDEV 파라미터 값을 확인하여 /dev/null로 변경한다.

2. ontape으로 logical log를 백업하려면 /dev/null 값을 사용할 수 없다. 따라서 symbolic link를 사용하여 /dev/null을 가리키도록 한다.

3. ontape -a

4. onstat - 로 확인하여 엔진 상태를 확인


이후에는 풀백업을 수행하도록 하고 TAPEDEV, LTAPEDEV 파라미터 값을 원래대로 변경하여 사용한다.

필요한 경우 logical log 추가 작업을 수행한다.

728x90
728x90

1. db 생성시 별도의 옵션이 없다면 no-logging 모드로 설정된다.

create database testdb


2. db 생성시 logging 모드로 설정하려면 다음과 같이 수행한다.

create database testdb with log (unbuffered logging)

create database testdb with bufferd log (buffered logging)


3. no-logging 모드의 db를 logging 모드로 설정하는 방법은 다음과 같다.

ontape -s -U testdb (unbuffered logging)

ontape -s -B testdb (buffered logging)


4. db의 logging 모드를 확인하는 쿼리

select name, is_logging, is_buff_log from sysmaster:sysdatabses


5. 트랜잭션 사용

begin work;

insert/delete/update;

commit/rollback work;


http://www-903.ibm.com/kr/bbs/board_detail.jsp

http://database.sarang.net/?inc=read&aid=1841&criteria=informix&subcrit=&id=&limit=20&keyword=auto&page=1

728x90
728x90

데모 소스

$INFORMIXDIR/jdbc/demo/basic/SimpleConnection.java


1. java 컴파일러 확인

- JDK 설치여부

(javac, java가 설치되어 있는지 확인한다.)


2. JDBC Driver 확인

- Informix JDBC Driver 설치

(윈도우의 경우 setup.jar 파일로 설치한다)


3. 환경변수 확인

PATH=

CLASSPATH=$INFORMIXDIR/jdbc/lib/ifxjdbc.jar:.

(java 컴파일러 및 ifxjdbc.jar 파일의 위치를 명시한다)


4. 자바 컴파일

javac SimpleConnection.java


5. 실행

java SimpleConnection jdbc:informix-sqli://HOSTNAME:PORT/DBNAME:informixserver=SERVERNAME;user=informix;password=informix

728x90
728x90

dbexport -ss 옵션은 다음과 같은 서버 특정 정보를 생성합니다


① 시작 및 다음 익스텐트 크기

② 테이블이 분할된 경우 분할화 정보

③ 로크 모드

④ 테이블의 DBSPACE

⑤ 단순 대형 객체의 BLOBSPACE

⑥ 스마트 대형 객체의 DBSPACE


-ss 옵션을 사용하지 않으면 dbimport 수행시 테이블의 익스텐트 크기가 자동으로 변경됩니다.

728x90

+ Recent posts