728x90

Question

Remove Shared Memory Segments

Answer

Directions for removing shared memory segments are as follows: (must be root)

  1. Get your SERVERNUM from the onconfig
  2. Convert that to hex and add it to 5256 in hex
  3. ipcs -m |grep 5256+SERVERNUM(in hex)
  4. The ID is the second column in the output. Write down each of the ID numbers.
  5. Take the list of IDs and run ipcrm -m ID for each ID.

so an example is as follows: 

1. onstat -c |grep SERVERNUM 
SERVERNUM 60 # Unique id corresponding to a Dynamic Server Instance 

2. 0x5256 + 0x3c = 0x5292 

3. ipcs -m |grep 5292 
m 121 0x52924801 --rw-rw---- root informix 
m 122 0x52924802 --rw-rw---- root informix 
m 123 0x52924803 --rw-rw-rw- root informix 

4. ipcrm -m 121 
ipcrm -m 122 
ipcrm -m 123 

5. this command will confirm the segment has been removed 
ipcs -m |grep 5292


http://www-01.ibm.com/support/knowledgecenter/api/content/SSGU8G_11.50.0/com.ibm.admin.doc/ids_admin_1218.htm

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


728x90
728x90


질문

Smart blobspace는 Blob data와 다른 특징들을 가지고 있다, 해당 특징을 잘 이해한다면, 효율적으로 데이타를 관리할수 있을것이다.

응답

아래의 내용은 Smart Blob space에 대한 특징을 전체적으로 정리한 내용이다. Smart blobspace의 특성에 대하여 이해를 하고, 이를 효율적으로 사용하게 하는데 목적이 있다.
참고로, 아래의 내용은 IDS11.5기준으로 작성된 내용이며, 자세한 내용은 버젼에 따라 차이점이 있을수 있습니다.

1. Sbspace의 특징

Smart blob 데이타는 일반 데이타의 저장방법과 다른 방법으로 저장 및 조회가 된다.

Smart Large Object 사용과 관련하여, Sbspace를 사용하는 경우, Sbspace에는 아래와 같이 3가지의 데이타 영역을 가지고 있다.

1) Meta Data area : sbspace 생성시 Meta데이타 영역의 크기를 지정하여 줄수 있다(또는 default 생성). LO데이타에 대한 Accesstime, update된 내용등이 로깅된다.

2) User Data area : 각각의 LO데이타 하나가 하나의 extent와 같은 개념. - 하나의 LO데이타를 저장하기 위한 page의 set으로 구성된다.

3) Reserved area : Sbspace에 청크가 추가될때/생성될때, User Data영역의 40%를 reserved 영역으로 설정하게 된다. 이는 Sbspace영역을 효율적으로 관리/사용하기 위한 방법으로서, 해당 청크의 Meta데이타 또는 User데이타 영역이 full이 된경우에, reserved 영역의 일부를 Meta데이타영역, 또는 User데이타영역으로 전환하여 사용한다. 이는, 기존, Meta데이타와, User데이타 영역으로만 구분되어 있을때, 어는 한쪽이 먼저 full이 되는경우, 나머지 영역의 free영역을 사용할수 없게 됨으로써, 디스크영역을 효율적으로 사용하지 못한점을 개선하여, 어느쪽에서 속하지 않은 영역을 미리 확보하여, 시스템 구조상 많이 사용하게 되는 데이타 영역을 확장하여 줌으로써, 최대한 디스크영역을 효율적으로 사용할수 있게 하였다.


다음은 Sbspace의 Meta Data의 구조에 대한 설명이다. 아래와 같은 데이타들이 default로 저장이 된다.

- sbspace descriptor tblspace : 최초 생성이후 증가하지 않음
- chunk adjust tblspace : sbsp에 chunk가 추가되는 경우에 증가됨
- Level-1 archive tblspace
- Level-2 archive tblspace
- Chunk LO header tblspace : 청크가 추가될때 증가됨
- Chunk user-data free-list tblspace : chunk가 많이 쪼개질수록, 증가한다 ( 즉, 작은 크기의 sblob가 많이 저장될수록 많이 증가하게된다 )


아래는 sbspace에 대하여 'oncheck -pe' 결과이다.

-----------------------------------------------------------------------------
% oncheck -pe mysbsp


DBspace Usage Report: mysbsp Owner: informix Created: 09/23/2012


Chunk Pathname Pagesize(k) Size(p) Used(p) Free(p)
2 /myids/chunk/sdatadbs.115 4 25000 see below see below

Description Offset(p) Size(p)
------------------------------------------ -------- --------
RESERVED PAGES 0 2
CHUNK FREELIST PAGE 2 1
sbsp:'informix'.TBLSpace 3 50
SBLOBSpace LO [2,2,1] 53 100
SBLOBSpace LO [2,2,2] 153 20
SBLOBSpace LO [2,2,3] 173 100
SBLOBSpace LO [2,2,4] 273 20
SBLOBSpace LO [2,2,5] 293 100
SBLOBSpace LO [2,2,6] 393 20
SBLOBSpace LO [2,2,7] 413 100
SBLOBSpace LO [2,2,8] 513 20
SBLOBSpace LO [2,2,9] 533 100
SBLOBSpace LO [2,2,10] 633 20
SBLOBSpace FREE USER DATA (AREA 1) 653 6049
SBLOBSpace RESERVED USER DATA (AREA 1) 6702 4988
sbsp:'informix'.sbspace_desc 11690 4
sbsp:'informix'.chunk_adjunc 11694 4
sbsp:'informix'.LO_ud_free 11698 32
sbsp:'informix'.LO_hdr_partn 11730 557
SBLOBSpace FREE META DATA 12287 1076
SBLOBSpace RESERVED USER DATA (AREA 2) 13363 4988
SBLOBSpace FREE USER DATA (AREA 2) 18351 6649

Total Used: 1250
Total SBLOBSpace FREE META DATA: 1076
Total SBLOBSpace FREE USER DATA: 22674
----------------------------------------------
파란색은, user data관련된 영역
녹색은, Meta data관련된 영역
빨강색은 Reserved 데이타 영역입니다.
-------------------------------------------------------------------------------------
일반적으로 초기에 할당된 Meta데이타영역을 다 소진하고, 추가로 할당되는 경우에는, 내부적으로 시스템이 그 크기를 결정하게 되므로, 임의로 증가하는 크기를 지정하여 줄수 없다.

참고 : Structure of the Meta Data
http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.adref.doc/ids_adr_0337.htm?resultof=%22%6d%65%74%61%64%61%74%61%22%20



2. Smart blob 및 이의 Meta Data에 모니터링 방법

위의 'oncheck -pe'의 결과에서 Meta 데이타의 가용영역을 확인하기 위하여는 "FREE META DATA" 크기와, "RESERVED USER DATA (AREA 1/2)" 가 얼마나 남아있는지가 중요한 요소가 된다. 이에 대한 값을 확인후, 여유가 없는 경우에는 청크를 추가하여 주어야 한다.

참고 : Sbspace 모니터링
http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.admin.doc/ids_admin_0637.htm


3. sbspace와 관련하여, online.log에 표시되는 메세지

Sbspace의 Metadata 관련하여 아래와 같은 메세지가 MSGPATH로그에 표시될수 있다. 
위에서 설명한 바와 같이, sbspace의 영역을 효율적으로 관리하기 위하여 선할당 되었던, reserved 영역이, Meta데이타 또는 User데이타 영역으로 할당 또는 free되는 과정에서 online.log에 아래와 같은 메세지들이 로깅될수 있습니다.

1) Allocated number pages to Metadata from chunk number.
2) Allocated number pages to Userdata from chunk number.
3) Freeing reserved space from chunk number to Metadata.
4) Freeing reserved space from chunk number to Userdata.

Freeing reserved space from chunk number to Userdata.
Cause : The user-data area in chunk number is full. The database server is trying to free space from the reserved area to the user-data area.
Action : None required.


참고 : Sbspace Metadata Messages.
http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.adref.doc/ids_adr_0716.htm?resultof=%22%6d%65%74%61%64%61%74%61%22%20


http://www-01.ibm.com/support/docview.wss?uid=swg21631385&myns=swgimgmt&mynp=OCSSGU8G&mync=E

728x90
728x90


Question

How to perform a dummy update on a table to remove any inplace alters.

Answer

UPDATE tab1 SET col1=col1 WHERE 1=1 ; The table name in this example is tab1, the column name is col1. one restriction is that the column chosen must be numeric.


http://www-01.ibm.com/support/docview.wss?uid=swg21674841&myns=swgimgmt&mynp=OCSSGU8G&mync=E

728x90
728x90

Question

High availability replication (HDR) requires a trust relationship for user informix between the machines in the HDR pair. Is there an alternative to using hosts.equiv for establishing the trust?

Answer

You can use the .netrc file to establish trust between computers. Locate the file in the informix user home directory on both machines. It should have a line like the following:

    machine machine_name login informix password informix_password 
      machine_name 
      the name of the remote machine in the HDR pair. 

      informix_password 
      the password for user informix on the remote machine.


Caution: Be sure to set appropriate permissions on the .netrc file to protect the password.



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

728x90
728x90


Problem(Abstract)

This article shows several methods of producing values in minutes from the difference of two datetime values. These examples can also be applied to produce hours and seconds.

Resolving the problem

Q. How can I determine the number of hours, minutes or seconds difference between two datetime values?


A. This can be accomplished with SQL using the following methods:

  • The following SQL script uses a temp table to calculate the number of minutes difference between col1 and col2. This method works with any version of IBM® Informix® Dynamic Server (IDS):
      create temp table tmp_dt_tab 
      ( 
        col1 datetime year to second, 
        col2 datetime year to second, 
        col3 interval minute(9) to minute 
      ) with no log;
      insert into tmp_dt_tab values (CURRENT YEAR TO SECOND, "2001-09-11 12:00:00", NULL);
      update tmp_dt_tab set col3 = (col1 - col2);


  • The following SQL script uses an interval to implicitly cast into minutes the difference between the current datetime and noon on 9/11/2001. This method works with any version of IDS:
      select interval(0) minute(9) to minute + 
             (current year to minute - "2001-09-11 12:00") 
        from systables 
       where tabid = 99;


  • The following SQL script explicitly casts into minutes the difference between the current datetime and noon on 9/11/2001. This method requires IDS version 9.x or 10.x:
      select (current year to minute - 
              "2001-09-11 12:00")::interval minute(9) to minute 
        from systables 
       where tabid = 99;


  • The following SQL script explicitly casts into minutes the difference between the current datetime and noon on 9/11/2001. This method requires IDS version 9.x or 10.x:
      select cast ((current year to minute - "2001-09-11 12:00") as 
                    interval minute(9) to minute) 
        from systables 
       where tabid = 99;


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

    728x90
    728x90


    Problem(Abstract)

    This article describes a method to find the IBM Informix Dynamic Server configuration file settings.

    Resolving the problem

    INTRODUCTION

    The values in the onCONFIG configuration file may not be the settings current in effect by the database server. This is true when:

    • One of the parameters in the file is changed after the database server is started
    • A parameter has been changed dynamically with the onparams utility
    • A parameter that has been change dynamically with the onmode utility


    You can find out what configuration parameters the database server is currently using by running an SQL query against the sysmaster database. 


    BEFORE YOU BEGIN 

    The database server must be running. 


    STEPS 

    1. Start an application that allows you to make queries on the database server (dbaccess, for example). 

    2. Connect to the sysmaster database on the database server. 

    3. Execute this SQL: 
      SELECT cf_name, cf_default, cf_effective, cf_original FROM   syscfgtab;

    Each row returned in the output represents one configuration parameter. Here is a definition of each of the columns: 

    Column name
    Meaning
    cf_name
    This is the parameter name.
    cf_default
    This is the default value if no valid value is present in the onCONFIG file.
    cf_effective
    This is the current value of the parameter.
    cf_original
    This is the value the parameter had when the database server was started.


    728x90
    728x90

    Question

    Sometime you may need to restore a single table from an archive. In fact you may want the table exactly as it was at a specific date and time, and we can do this using archecker.

    It is important to note that the format of the datetime you provide to archecker depends the values in environment variables such as DBTIME, GL_DATETIME, or CLIENT_LOCALE when the back up was taken.

    Answer

    The following steps are a guide for people who want to use a non-default database locale.

    The first thing is to find out which datetime format should be used. This is decided by the following environment variables in this order:

    a) DBTIME environment variable:
    setenv DBTIME '%Y-%m-%d %H:%M:%S'

    b) If DBTIME is not set, then the value of the GL_DATETIME environment variable will be used:
    setenv GL_DATETIME '%Y-%m-%d %H:%M:%S'

    c) If neither DBTIME or GL_DATETIME are set, the default time format from the CLIENT_LOCALE will be used.
    This ESQL/C program shows the time format for a given CLIENT_LOCALE.

    /* start datetime.ec */
    -------------------------------------------------------------------------------
    #datetime.ec
    #include <stdio.h>

    main(int argc, char **argv)
    {
    $datetime year to second dt;
    char output[100];
    char buffer[100];

    if (argc!=2) {
    printf(" USAGE : datetime <CLIENT_LOCALE value> \n");
    printf(" EXAMPLE : datetime ko_kr.ksc \n");
    exit(1);
    }

    sprintf(buffer,"CLIENT_LOCALE=%s",argv[1]);
    putenv(buffer);
    dtcurrent(&dt);
    dttofmtasc(&dt,output,sizeof(output),NULL);
    printf("%s \n",output);
    }
    -------------------------------------------------------------------------------
    /* end datetime.ec */

    You compile the ESQL/C program above with this command:
    esql -o datetime datetime.ec -static

    You then execute it like this:
    datetime de_de.8859-1

    The output looks like this:
    Mi. 08 Dez. 2010, 21:19:16


    Once the relevant datetime format is known, we can restore one table at a point in time. The example restores a single table from a database where DB_LOCALE & CLIENT_LOCALE are both set to de_de.8859-1, and DBTIME & GL_DATETIME are not set. the datetime will be as shown above

    1. Create SQL command file for archecker with a correct time format.
    -------------------------------------------------------------------------------
    #Archecker SQL example...
    #/informix/adm/point-in-time-recovery.cmd
    database mydb;

    create table t_source (
    cm_cd smallint not null ,
    c_cmp_cd integer not null ,
    corp_ins_no char(13),
    prv_no char(20),
    is_rpt char(1),
    rpt_ymd integer
    ) in mydbsp ;

    create table t_target (
    cm_cd smallint not null ,
    c_cmp_cd integer not null ,
    corp_ins_no char(13),
    prv_no char(20),
    is_rpt char(1),
    rpt_ymd integer);

    insert into t_target select * from t_source;
    restore to 'Mi. 08 Dez. 2010, 01:02:03';

    2. Run the archecker command for recovery. 

    archecker -tvs -f /informix/adm/point-in-time-recovery.cmd 

    3. See the recovery result from ac_msg.log.



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

    728x90
    728x90


    Question

    What is the minimum amount of contiguous memory needed for ontape archive to work?

    Cause

    Lack of available contiguous memory can cause ontape archive to fail with an assertion warning "ISAM error: An error has occurred during archive back up".

    Answer

    When you start an ontape archive, the ontape (front-end) process will allocate four blocks of contiguous memory in the size of TAPEBLK configuration parameter. If you have constraints on available memory, a workaround could be reduce the value of TAPEBLK configuration parameter to a minimum value (On UNIX: 32K and on Windows: 16K).


    728x90
    728x90


    Problem(Abstract)

    On AIX platform connection to the database server failing with invalid password message, when Informix strarted with user 'informix'. However, if you start it as user 'root', problem does not occur.

    Following is a different manifestation of the similar problem. 

    With user 'informix' connecting to database server using 'dbaccess -> Query-language -> Select Database' worked fine. However, same user failing with invalid password message during 'dbaccess -> Connection -> Connect -> Database Server -> User Name -> Password'. This problem occurred with TCP/IP as well as shared memory connections.

    Symptom

    The following message will be recorded in the message log file when the connection to the database server fails:

     Check for password aging/account lock-out.

     listener-thread: err = -952: oserr = 0: errstr = informix@hostname: User (informix@hostname)'s password is not correct for the database server.


    Cause

    AIX 6.1 and later implemented a Loadable Password Algorithm (LPA) mechanism that allows easily deploy new password encryption algorithms. Each supported password encryption algorithm is implemented as a LPA load module that is loaded at runtime when the algorithm is needed. The supported LPAs and their attributes are defined in the /etc/security/pwdalg.cfg system configuration file. By default only user 'root' can read this system configuration file.

    # ls -ld /etc/security /etc/security/pwdalg.cfg

       drwxr-x--- 9 root security  4096 Jun 28 09:13 /etc/security

       -rw-r----- 1 root security  3807 Mar 04 2010 /etc/security/pwdalg.cfg


    Resolving the problem

    Informix does not support LPA. However, changing permission of the system configuration file may be a possible solution.


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

    728x90
    728x90


    Problem(Abstract)

    The -952 error is generally a bad account/password combination. However when there is 100% confidence that the account/password combination is correct, a -952 error can still occur. This article explains one scenario and a possible solution for that problem.

    Symptom

    Assumptions:

    1. 100% confidence that the account/password combination is correct
    2. The OS is properly configured to authenticate Kerberos/AD user accounts
    3. The user account is a remote Kerberos/AD account
    4. AIX OS

    A -952 error is reported in the server message log and possibly a -951 error to the client.

    Cause

    The remote AD server may not have a crypt hash password stored for the user account. If so it will return "*" for the crypt hash password value. This value does not match the crypt hash value of the passed-in password.

    Resolving the problem

    Take one of the following actions where applicable:

    1. Ensure the permissions of the oninit binary are rwsr-sr--, owner is root and group is informix
    2. Try running the instance as user root instead of user informix
    3. Use some other form of authentication such as PAM or SSO

    Related information

    Single Sign-On With IBM Informix
    Setting up Kerberos/SSO in IDS using Windows AD
    Configuring Informix Clients for Single Sign-On
    Pluggable Authentication Module with Informix Dynamic S
    -951 / -952 when using Loadable Password Algorithm (LPA
    A possible solution for a -952 error when seen on AIX w


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

    728x90

    + Recent posts