728x90
Question

Can we add a DBSERVER entry dynamically to the SQLHOSTS file without bouncing the database server?

Cause

A need exist to add a new connection to the instance dynamically without any down time.

Answer

Starting with Informix version 11.50.xC6 we have the ability to Dynamically Start, Stop and Restart Listen threads with the onmode -P command or by using the SQL Admin API. 

This feature allows a new listener thread to be started on a port without the need to restart the database server. Adding new entries in to the sqlhosts file and the DBSERVERALIAS parameter of the onconfig file and executing the onmode -P or SQL API commands will allow new connections to utilize the new server name.

Steps:


1. Modify the sqlhosts to add the new connection:

      new_test_tcp onsoctcp myhost 4567 

2. Modify the DBSERVERALIAS parameter of the onconfig file: 

      DBSERVERALIASES main_prim_shm:new_test_tcp 

3. Start a listener thread for the new alias:

       onmode -P start new_test_tcp

OR use the sysadmin SQL API :

      execute function admin("start listen","new_test_tcp");


728x90
728x90

Question

Changing hostname of the DB2 server. What updates in DB2 need to be made?

Cause

Changing the DB2 server's hostname.

Answer

Perform the following on the DB2 server:


1) Login as the dasadm user on UNIX/Linux or Local Administrator on Windows. Stop the DB2 Administration Server (DAS):

    db2admin stop

2) Login as the instance owner on UNIX/Linux or Local Administrator on Windows. Stop the DB2 instance:
    db2stop

3) Change the server's hostname. on a Windows system, a reboot is required before this change will take effect. Do not reboot the Windows Server at this time - you must make the DB2 Configuration changes first. 

4) Login as user ROOT if DB2 is on UNIX/Linux and Local Administrator on Windows. Update the DB2SYSTEM registry variable while in the instance home directory:
    • UNIX/Linux
      db2iset -g DB2SYSTEM=<new hostname> 
    • Windows 
      db2set -g DB2SYSTEM=<new hostname>

5) Locate db2nodes.cfg in one of the following directories:
  • UNIX/Linux:
    <db2 instance home directory>/sqllib/db2nodes.cfg

  • All Windows flavors running DB2 v8 and v9.1: 
    Program Files\IBM\SQLLIB\DB2\db2nodes.cfg 

  • Windows XP and 2003 running DB2 v9.5: 
    Documents and Settings\All Users\Application Data\IBM\DB2\<DB2COPY>\DB2\db2nodes.cfg

    NOTE: Application Data is a hidden folder

  • Windows Vista and later operating systems: ProgramData\IBM\DB2\<DB2COPY>\DB2\db2nodes.cfg
Note that only DB2 ESE has a db2nodes.cfg. If you are running other editions (WorkGroup Server, or Personal Edition) then you can skip this step and the next.

6) In the db2nodes.cfg file change <current hostname> to <new hostname>. 


7) Run the following command to list the current hostname/system name that is cataloged:
    db2 list admin node directory show detail 

    If there are no Admin Node Directory entries then you can skip the next 2 steps. It simply means that you haven't started the Control Center. The Admin Node Directory will get updated the next time the Control Center is started, based upon the current hostname. 
8) Uncatalog the current hostname using this command:
    db2 uncatalog node <nodename> 

9) Catalog the admin node with the new hostname using this command:
    db2 catalog admin tcpip node <nodename> remote <new hostname> system <new hostname> 

    <nodename> can be anything you want it to be (8 characters or less). It does not relate directly to the hostname itself.
    10) Update the admin configuration file using these commands:
      db2 update admin cfg using DB2SYSTEM <new hostname> 
      db2 update admin cfg using SMTP_SERVER <new hostname>

    11) At this time, you should restart your server if running Windows. Note that if your instances are set to auto-start, you may get error messages. These will occur if you have DB2_EXTSECURITY enabled. To correct this, you will need to update the DB2_ADMINGROUP and DB2_USERSGROUP registry entries using the db2extsec command. See the 'note' at the end of this technote for more details. 

    12) Login as the dasadm user on UNIX/Linux or Local Administrator on Windows. Start the DB2 Administration Server (DAS):
      db2admin start

    13) Login as the instance owner on UNIX/Linux or Local Administrator on Windows. Start the DB2 instance:
      db2start

    14) In Control Center find the old hostname under the "All Systems" folder and right click, choose Remove. 

    15) In Control Center add the new hostname. Right click on the "All Systems" folder and choose "Add". Click on "Discover" to locate the new hostname. 

    NOTE: 
    Starting in v9.1 FP2, DB2 supports the use of domain groups for extended security. Therefore, when you change the computer name and the computer groups DB2ADMNS and DB2USERS are local computer groups, you must update the DB2_ADMINGROUP and DB2_USERSGROUP global registries. Please see the Related URL for instructions on how to do this. 

    If Windows Extended Security has been enabled then you will need to tell DB2 to lookup the WIndows local groups DB2ADMNS and DB2USERS via the new hostname. For example if the hostname is changed to QASERVER then execute: 

    db2extsec /a QASERVER\DB2ADMNS /u QASERVER\DB2USERS 


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

    728x90
    728x90

    인포믹스 12.10이 출시되면서 인포믹스 모니터링 도구인 OAT가 Android와 iOS용으로도 공개되었습니다.

    Mobile OAT를 실행하려면 OpenAdmin Tool 3.11 버전이 설치되어 있어야합니다.

    아래는 제 iphone으로 실행한 화면을 캡쳐한 것입니다.

     

    OAT 주소, 언어, 모니터링 항목들을 설정하는 화면입니다.

     

    그룹 로그인에서는 OAT에 등록한 인스턴스 리스트를 간략하게 보여줍니다.

     

     

    아래와 같이 OAT의 주소를 직접 입력할 수 있습니다.

     

     

    DBSPACE 사용량에 대한 모니터링 내역입니다.

     

     

    아직은 모니터링 할 수 있는 영역이 다소 제한적이지만 현재로서도 상당히 유용한 툴인 것은 분명합니다.

    많은 관리자와 사용자가 사용하면서 개선이 이루어 진다면 좋겠습니다.

    728x90
    728x90

    Question

    How many processors exist on an HP-UX system?

    Answer

    This document explains how to count the number of processors on your system as IBM Informix® products defines a processor. Various IBM Informix® products are tuned based on the number of processors on your system. The NUMCPUVPS or VPCLASS onCONFIG configuration parameter, for example, should be set to one less than the actual number of physical CPUs present in the server. 

    A processor is a device that operates on core. With multiple core technology, this can be a single device or a device that has multiple core "processors". IBM Informix® products consider these multiple cores as separate physical processors. 

    On any HP-UX system, the ioscan command lists how many processors(single or multiple core) are on your system. The ioscan command (located in/usr/sbin) outputs a list of all IO devices. Each line in the output that begins with processor represents a processor that is either a single device or an instance of a multiple core device. 

    Use the following command line to include the processors in the output and automatically count them using grep (pattern match) and wc (character count). For more information see your Operating System man pages.

      /usr/sbin/ioscan -kf | grep processor | wc -l

      Example 1: 

      This example is from a machine with 2 processors. 

        $   /usr/sbin/ioscan -kf|grep processor|wc -l 
        2 

        Note: You would set the NUMCPUVPS or VPCLASS parameter to 1 in this example. 
      Example 2: 

      This example is from a machine with 4 processors. 
        $   /usr/sbin/ioscan -kf|grep processor|wc -l 
        4

      This example is from a machine with 4 processors. The Line count (wc -l) is left off to show the actual ioscan and grep output. 

        $   /usr/sbin/ioscan -kf|grep processor 
        processor   0  120            processor  CLAIMED     PROCESSOR    Processor 
        processor   1  121            processor  CLAIMED     PROCESSOR    Processor 
        processor   2  122            processor  CLAIMED     PROCESSOR    Processor 
        processor   3  123            processor  CLAIMED     PROCESSOR    Processor 

        Note: You would set the NUMCPUVPS or VPCLASS parameter to 3 in this example.


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

    728x90
    728x90

    Problem(Abstract)

    The NUMCPUVP onconfig parameter should be set to one less than the actual number of physical CPUs present in the server. This document provides the commands to determine the number of CPUs on AIX machines before setting the parameter.

    Resolving the problem

    On AIX you use the command lsdev to determine how many CPUs your system has. The command lsdev (located in /usr/sbin) is used to list the system devices. Use it with the following options to list all processors one per line:

      /usr/sbin/lsdev -C -c processor

      Example: 

      This example is from a single processor system. 

        $ lsdev -C -c processor 
        proc0 Available 00-00 Processor


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

    728x90
    728x90

    인포믹스 권한 관련하여 일부 정리해봅니다.



    AS grantor Clause

    When you grant privileges, by default, you are the one who can revoke those privileges. The AS grantor clause lets you establish another user as the source of the privileges you are granting. When you use this clause, the login provided in the AS grantor clause replaces your login in the appropriate system catalog table. You can use this clause only if you have the DBA privilege on the database.

    After you use this clause, only the specified grantor can REVOKE the effects of the current GRANT. Even a DBA cannot revoke a privilege unless that DBA is listed in the system catalog table as the source who granted the privilege.

    The following example illustrates this situation. You are the DBA and you grant all privileges on the items table to user tom with the right to grant all privileges:
    REVOKE ALL on items FROM PUBLIC;
    GRANT ALL on items TO tom WITH GRANT OPTION;
    The following example illustrates a different situation. You also grant Select and Update privileges to user jim, but you specify that the grant is made as user tom. (The records of the database server show that user tom is the grantor of the grant in the systabauth system catalog table, rather than you.)
    GRANT SELECT, UPDATE on items TO jim AS tom;
    Later, you decide to revoke privileges on the items table from user tom, so you issue the following statement:
    REVOKE ALL on items FROM tom;
    If instead, however, you try to revoke privileges from user jim with a similar statement, the database server returns an error, as the next example shows:
    REVOKE SELECT, UPDATE on items FROM jim;
    580: Cannot revoke permission.

    You receive an error because the database server record shows the original grantor as user tom, and you cannot revoke the privilege. Although you are the DBA, you cannot revoke a privilege that another user granted.

    The AS grantor clause is not valid in the GRANT DEFAULT ROLE statement.


    http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.sqls.doc/ids_sqs_0123.htm

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

    728x90
    728x90

    Question

    A sample ESQL/C program to insert data into a BLOB (TEXT) column using ESQL/C.

    Answer

    The attached program can be used as a reference for understanding the locator structure and how one can insert blob data via an ESQL/C program. This program is meant to be used only as a reference and no error checking has been taken into consideration. For example, the program will not check if the specified col1 number is valid or not. It is up to the programmer to put error checks into the code.

    The Locator Structure
    In an ESQL/C program, a locator structure is used to access simple-large-object values. The locator structure is the host variable for TEXT and BYTE columns when they are stored in or retrieved from the database. This structure describes the location of a simple-large-object value for the following two database operations:


    The locator.h header file defines the locator structure, called loc_t. ESQL/C does not automatically include the locator.h header file in an ESQL/C program. The locator.h header file must be explicitly included in any ESQL/C program that defines simple-large-object variables.

    The loc_loctype identifies the location of the simple large object data. When you setloc_bufsize to -1, ESQL/C allocates the memory buffer on a fetch or select. ESQL/C uses themalloc() system call to allocate the memory buffer to hold a single simple-large-object value.

    Compilation
      1. Save the attached program as getblob.ec.
      2. Compile using the following syntax:
        esql putblob.ec -o putblob

    Sample Output

      > putblob
      Enter a Catalog number :1
      Enter the description :
      Test insert
      Successful insert
    Disclaimer: This code has been tested on Solaris only. Behavior on any other operating system is not guaranteed.



    putblob.ec.txt
    0.0MB
    728x90
    728x90

    Question

    How to determine the number of concurrent users/sessions on Informix server?

    Answer

    Run this SQL command:

    select sh_curmaxcons, sh_ovlmaxcons from sysmaster:sysshmvals;

    sh_curmaxcons - updated as new connections are made, reset after a bounce. This means that the value will reset for each shut down and start up of the server. 

    sh_ovlmaxcons - updated at each checkpoint, persists over bounces, and upgrades. The ovlmaxcons value is initialized the first time you INSTALL the server. Thereafter, the maximum # of connections is recorded in the sysmaster database. Even after an upgrade from 9.4 to 10.0, that value will not be reset or lost. 


    위 쿼리는 인포믹스 9.4 버전 이상에서 적용된다.

    인포믹스 포럼을 살펴보니 현재 세션 개수를 확인하는 쿼리는 다음과 같다. 모든 버전에서 확인 가능하다.

    select count(*) concurrentsessions
    from sysmaster:sysrstcb
    where sysmaster:bitval(flags,1)>0 { only count busy threads }
    and sysmaster:bitval(flags,'0x80000')!=0 { only count primary threads }
    and sysmaster:bitval(flags,'0x200')==0 { remove daemon threads}
    and sysmaster:bitval(flags,'0x40')==0 { remove log backup users }
    and sysmaster:bitval(flags,'0x80')==0 { remove onmonitor users }
    and sysmaster:bitval(flags,'0x2000')==0 { remove page cleaners}
    and sysmaster:bitval(flags,'0x00000400')==0 { remove archive threads}
    and sysmaster:bitval(flags,'0x00004000')==0 { remove recovery threads}
    and sysmaster:bitval(flags,'0x00100000')==0 { remove idx blder }
    and sysmaster:bitval(flags,'0x00200000')==0 { remove btree scanner }
    and sysmaster:bitval(flags,'0x04000000')==0 { remove main loop}
    and flags < '0x20000000';

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

    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14696424

    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14697676


    728x90
    728x90


    Question

    How do you use backup and restore filters with Informix Dynamic Server 11.10?

    Answer

    With IBM® Informix® Dynamic Server™ 11.10, it is possible to apply filters during a backup and restore with both ontape and onbar. These filters basically are external programs which are called before the data is written or read either to or from disk or the storage manager. The filter programs expect data from stdin and will send their output, the processed data, to stdout. The most common example for that is to call a compression program, but it can also be used for encryption or other changes to the data. 
    If you want to use a filter to compress the data of your backup, you can define a backup filter in the Informix Configuration file like below

    Example

      For UNIX platforms:
        BACKUP_FILTER /usr/bin/compress

      For Microsoft® Windows platforms:
        BACKUP_FILTER c:\cygwin\bin\gzip.exe


    Doing a Level 0 Backup with ontape 
    ontape -s -L 0 

    Returns the following
    D:\data\backup>ontape -s -L 0
    Using the backup and restore filter c:\cygwin\bin\gzip.exe.
    10 percent done.
    20 percent done.
    30 percent done.
    40 percent done.
    100 percent done.
    File created: d:\data\backup\LBNOTE_2_L0

    Please label this tape as number 1 in the arc tape sequence.
    This tape contains the following logical logs:

     27

    Program over.

    Comparing the size of this file with a backup done without compression shows that the filter was used.

    D:\data\backup>dir
     ....
    28.11.2007  11:50        19.775.488 LBNOTE_2_20071128_115015_L0
    28.11.2007  12:46         1.171.164 LBNOTE_2_L0


    There is no hint in the Informix message log about the usage of the filter, it is only shown in the output of the ontape. To restore, you will need to define a restore filter also in the Informix Configuration file, which will put the data back into the standard format the restore expects. 

    So, to restore the backup data with the filter defined above, you need to set in the Informix Configuration file.

    For UNIX platforms:
      RESTORE_FILTER /usr/bin/uncompress

    For Microsoft® Windows platforms:
      RESTORE_FILTER 'c:\cygwin\bin\gzip.exe -d'


    Execute a restore with ontape
    ontape -r 

    Returns the following output
    Restore file d:\data\backup\LBNOTE_2_L0 and press Return to continue ...

    Archive Tape Information

    Tape type:      Archive Backup Tape
    Online version: IBM Informix Dynamic Server Version 11.10.TC2
    Archive date:   Wed Nov 28 12:46:30 2007
    User id:        ebach
    Terminal id:    LBNOTE
    Archive level:  0
    Tape device:    d:\data\backup\
    Tape blocksize (in k): 16
    Tape size (in k): system defined for directory
    Tape number in series: 1
    Using the backup and restore filter c:\cygwin\bin\gzip.exe -d.
    ...

    If you try to do a restore of a backup which has used a backup filter without the matching restore filter, you will receive an error message like in the following

    Example

    D:\data\backup>ontape -r
    Restore file d:\data\backup\LBNOTE_2_L0 and press Return to continue ...


    Archive Tape Information

    Tape type:      Archive Backup Tape
    Online version: IBM Informix Dynamic Server Version 11.10.TC2
    Archive date:   Wed Nov 28 12:46:30 2007
    User id:        ebach
    Terminal id:    LBNOTE
    Archive level:  0
    Tape device:    d:\data\backup\
    Tape blocksize (in k): 16
    Tape size (in k): system defined for directory
    Tape number in series: 1
    Physical restore failed - function Invalid archive tape failed code -1 errno 2

    Program over.

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

    728x90
    728x90


    Abstract

    Based on the fact, Optim is a 32bit application, which also can be used / installed on a Linux 64bit operation system, a customer has to install the correct Oracle client version to be able to connect the Oracle database on Linux x64.

    Content

    Starting with Oracle 11gR2 clients will no longer contain the 32bit libraries. For that reason, a 32bit Oracle client has to be installed, to be able to use Optim on Linux x64 as server.

    To get the full functionality of Optim, use the "Administrator" installation type. This type contains all libraries needed and the binaries, for example, sqlldr, the Oracle SQL Loader, sometimes needed.

    see also:
    Oracle® Database Client Installation Guide
    11g Release 2 (11.2) for Linux
    1.2.3 Separate 32-Bit Client Shiphome for 64-Bit Ports


    The supported database versions of Oracle with a current Oracle client you can find at Oracle directly:
    Note:207303.1 "Oracle Client / Server Interoperability Support"

    For 11.1-clients that means: 
    Server must have 9.2.0.4 or higher, 9.2.0.1 is not supported.


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

    728x90

    + Recent posts