728x90

1. 압축

### tar cvf - [묶을 소스 파일] | gzip -c > 만들 파일 이름

 tar cvf - /etc | gzip -c > etc.tar.gz


2. 압축해제

gzip -dc xxx.tar.gz | tar xvf -

728x90
728x90

Question

This article goes over the environment variable that can be used to change the default resources used by the engine for Kernel Asynchronous I/O (KAIO) on the IBM AIX platform.

Answer

If you seem to have sluggish performance during peak I/O usage times or see a message in the online.log that says:


    KAIO out of OS resources errno = 11

    or
    *** _aiowrite() returning EAGAIN ***

Then the Kernel Asynchronous I/O (KAIO) subsystem may need to be tuned. The IBM Informix engines do this thru an Operating System (OS) structure called an Asynchronous IO Control Block (AIOCB). A certain number of AIOCB's are allocated at initialization time and reused as long the instance is online. If the number of AIOCB's is low, performance will be negatively impacted because the engine will be forced to wait until an AIOCB becomes available.

To change the number of AIOCB's defined, set the environment variable IFMX_AIXKAIO_NUM_REQ to the desired number, then shutdown and restart the database engine. If the value of IFMX_AIXKAIO_NUM_REQ is greater than 4096, then 4096 AIOCB's will be allocated. If the value of IFMX_AIXKAIO_NUM_REQ is less than 128, then 128 AIOCBs will be allocated. If IFMX_AIXKAIO_NUM_REQ is not set, then the default value is 1024. These values may change in future versions of the OS or engines.

Example:
    To lower the number of concurrent KAIO requests to 512 from the default of 1024 : 
      $  export IFMX_AIXKAIO_NUM_REQ=512



Tuning Kernel Asynchronous IO (KAIO) for IBM Informix on AIX

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


IC50164: KAIO: OUT OF RESOURCES, ERRNO 11 REQUIRES INCREASE IN IFMX_AIXKAIO_NUM_REQ on AIX FROM 4K TO 8K

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

728x90
728x90

You can perform routine administrative tasks that can prevent assertion failures or help prepare for recovering from assertion failures.

To prevent assertion failures on Informix®, perform the following tasks regularly:

Table 1. Preventing assertion failures.
Prevention taskPurpose
Test your applications thoroughly in a realistic environment before releasing your applications into production.Applications can trigger assertion failures.

Make sure that you have allocated enough resources: for example, physical and logical logs and shared memory.

Check and repair the consistency of your data.

Run the following oncheck commands to check your system:

  • oncheck -cD: Data pages
  • oncheck -cI: Index pages
  • oncheck -cr: Reserved pages
  • oncheck -ce: Chunk-free list
  • oncheck -cc: System catalogs
  • oncheck -pe: Physical information about chunks
Diagnosing and repairing consistency problems quickly can prevent major problems like data loss and assertion failures.
Upgrade to the latest major and fix pack release.Assertion failures can be caused by product defects. You can avoid many product defects by upgrading to the most current release.
Update statistics.

When you change a table or indexing schema, update statistics to update the dictionary cache. By default, statistics are updated automatically by the Scheduler. You can customize automatic statistics updating for your system.

Queries that use stale statistics can use too many resources and cause assertion failures. Stale statistics can also have a negative affect on query performance.

Always update statistics after upgrading.

Monitor and complete in-place alter operations.

You can view pending in-place alter operations in the sysadmin:ph_alerttable or the Health Center > Alerts screen in the IBM® OpenAdmin Tool (OAT) for Informix. You can force the completion of in-place alter operations for a specific table by running the following dummy UPDATE statement:

UPDATE table_name SET column_one = column_one WHERE 1=1;
Pending in-place alter operations can use too many resources and cause assertion failures.

Complete in-place alters before upgrading.

To prepare for assertion failures on Informix, perform the following tasks regularly:

Table 2. Preparing for assertion failures.
Preparation taskPurpose
Back up your data and logical logs.

You can use the on-Bar utility or the ontape utility to back up your data and logical logs. The on-Bar utility requires a storage manager.

If data loss occurs, you can recover your data and recent transactions.
Back up your database and storage space schema information.

Run the following commands to back up your schema information:

  • dbschema -ss -d database_name > dbschema_ss_database_name.out: Saves the schema information about the specified database in a file.
  • dbschema -c > dbschema_c.out: Saves the commands to reproduce storage spaces, chunks, physical logs, and logical logs in a file.
In a catastrophic failure, you can recreate your system.


http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp?topic=%2Fcom.ibm.support.core.doc%2Fifx_ts_afprevent.htm

728x90
728x90

An assertion failure occurs when the database server cannot continue normal processing and must shut down. You can correct some of the problems that cause assertion failures, such as disk issues. For other problems that cause assertion failures, you must contact IBM® Software Support.

If your production server is currently down, contact IBM Software Support immediately.

To correct an assertion failure:

  1. Look at the online log for the assertion failure message.
    The location of the online log is specified by the MSGPATH configuration parameter. Default:
    • UNIX: $INFORMIXDIR/tmp/online.log
    • Windows: %INFORMIXDIR%\online.log
  2. Perform any action mentioned in the assertion failure message. For example, you might need to run an oncheck command or increase the size of the physical or logical log buffer.
    The following table lists the common types of assertion failures and what you can do to correct the underlying problems.
    Table 1. Common types of assertion failures.
    ErrorCauseSolutions
    bfcheckCorrupted data page, index, or partition page
    • Run the oncheck command in the assertion failure message.
    • If an index is corrupted, drop and recreate the index.
    • If a partition page is corrupted, you might need to restore the data.
    I/O write chunkNot enough shared memory or a hardware problem
    • Look at your operating system logs for hardware problems or problems with other software. Sometimes other software can trigger an Informix® assertion failure. Fix any hardware or other software problems.
    • Free up or increase shared memory for the database server.
    No exception handlerMemory corruptionLook at your operating system logs for hardware problems or problems with other software. Fix any hardware or other software problems.
    sigkillThe oninit daemon was stopped.Restart the database server.
    segv

    sigbus

    • Memory corruption
    • An ill-behaved C user-defined routine
    • A defect in the database server
    • Look at your operating system logs for hardware problems or problems with other software. Fix any hardware or other software problems.
    • If you use C user-defined routines, check your code for problems. Make sure that your user-defined routines follow the guidelines for well-behaved routines.
    • If you are not running the latest Informix fix pack, check the latest Fixed and known defects file to see whether this issue is fixed. Upgrade to the latest Informix fix pack.
  3. Restart the database server. Some assertion failures can be solved by the database server during startup.
  4. If the database server does not start or the problem recurs, collect the following files for IBM Software Support in addition to the standard list of information to gather.
    Table 2. Files for support.
    FileLocation
    assertion failure files: af.xxx, where xxx is the hexadecimal number associated with the failureSpecified by the DUMPDIR configuration parameter. Default:
    • UNIX: $INFORMIXDIR/tmp
    • Windows: %INFORMIXDIR%\tmp
    sqlhosts fileSpecified by the INFORMIXSQLHOSTS environment variable. Default:
    • UNIX: $INFORMIXDIR/etc
    • Windows: registry
    onconfig fileSpecified by the ONCONFIG environment variable. Default:
    • UNIX: $INFORMIXDIR/etc
    • Windows: %INFORMIXDIR%\etc
    online log fileSpecified by the MSGPATH configuration parameter. Default:
    • UNIX: $INFORMIXDIR/tmp/online.log
    • Windows: %INFORMIXDIR%\online.log
    shared memory dump files:shmem.xxx, where xxx is the hexadecimal number associated with the failureSpecified by the DUMPDIR configuration parameter. Default:
    • UNIX: $INFORMIXDIR/tmp
    • Windows: %INFORMIXDIR%\tmp

    Generated only if the DUMPSHMEM configuration parameter is set to 1 or 2.

  5. Contact IBM Software Support.

728x90
728x90

LOCKS Configuration Parameter


The LOCKS configuration parameter specifies the initial size of the lock table.

The lock table holds an entry for each lock. If the number of locks allocated exceeds the value of the LOCKS configuration parameter, the database server increases the size of the lock table. The lock table can be increased a maximum of 99 times.

onconfig.std value
20000
units
Number of locks in the internal lock table
range of values
2,000 through 8,000,000 for 32-bit database servers 2,000 through 500,000,000 for 64-bit database servers
takes effect
When the database server is shut down and restarted
utilities
onstat -k (see onstat -k command: Print active lock information.)
refer to
  • The memory and locking chapters in your IBM® Informix® Performance Guide
  • The shared memory chapter in the IBM Informix Administrator's Guide

The database server increases the size of the lock table by attempting to double the lock table on each increase. However, the amount added during each increase is limited to a maximum value. For 32-bit platforms, a maximum of 100,000 locks can be added during each increase. Therefore, the total maximum locks allowed for 32-bit platforms is 8,000,000 (maximum number of starting locks) + (99 (maximum number of dynamic lock table extensions) x 100,000 (maximum number of locks added per lock table extension). For 64-bit platforms, a maximum of 1,000,000 locks can be added during each increase. Therefore, the total maximum locks allowed is 500,000,000 (maximum number of starting locks) + (99 (maximum number of dynamic lock table extensions) x 1,000,000 (maximum number of locks added per lock table extension).

With the initial lock table stored in resident memory and each additional lock stored in virtual memory, locks can become a resource drain if you have a limited amount of shared memory. The amount of storage occupied by a single lock depends on the word size and operating system, and is subject to change. Currently, the amount of storage ranges from approximately 100 to 200 bytes. You can see the amount of storage required to support additional locks by restarting the server with a different value of the LOCKS configuration parameter (without making other changes), and observing the increase in memory used as shown by onstat -g mem" for the resident pool.


저만큼 크게 잡은 데를 본적은 없다. 10점대와 비교하면 증가하는 횟수에 차이가 있다


http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=%2Fcom.ibm.adref.doc%2Fids_adr_0094.htm&resultof="locks"%20

http://www.ibm.com/developerworks/data/library/techarticle/dm-0701herber/index.html

728x90
728x90

Question

How can I connect to archived data using DG4ODBC in a UNIX environment?

Answer

DG4ODBC is used in UNIX environments to access archived data. This facility requires the use of Optim Connect (Attunity) 5.3.2 or above, and the Optim Connect ODBC 3.5 driver.

DG4ODBC requires that unixODBC Manager be installed on the UNIX server where Optim Connect daemon is running.

unixODBC Manager 

The example below is set up and configured using the unixODBC Manager from unixODBC, which can be downloaded from: ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.1.tar.gz

Once you download the file you will need to follow the steps outlined to install and configure the Manager on the Unix server where the Optim Connect daemon is installed. 

Note: If the DB is a 64-bit Database you must install and configure the unixODBC Manager as 64-bit, and load the 64-bit ODBC driver from Optim Connect. This can be found under the installation directory of Optim eg: \path\odm\thin clients\

Before connecting to the datasource you will need to define an environment variable called ODBCINI.ini. For example: 

export ODBCINI.ini=/path/odbc.ini

This can be added to the Optim rtsetenv script, which sets up the Optim environment prior to starting the Optim Server and the Optim Connect daemon.

Below are sample entries for files that need to be defined on the DB Server, namely, tnsnames.ora, listener.ora and the file initDG4.ora (which points to the Datasource (Archive File or Archive Collection) that you have defined in Optim Connect). 

Note: There is an ENVS parameter defined in the listener.ora file which points to the ODBC.ini file. This is the environment variable containing the parms for the unixODBC Manager. Also, this variable contains the path to the Optim Connect driver which is used to connect to the Archive File or Collection.

tnsnames.ora entry:

DG4 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = tcp)(HOST = localhost)(PORT = 1522))
)
(CONNECT_DATA =
(PRESENTATION=RO)
(SERVICE_NAME = DG4)
)
(HS=Ok)
)

listener.ora entry:

(SID_DESC =
(SID_NAME = DG4)
(ORACLE_HOME = /export/opt1/users/oracle/ora11/product/11.1.0/db_1)
(PROGRAM=dg4odbc)
(ENVS="ODBCINI=/export/opt1/users/oracle/unixodbc64/etc/odbc.ini,LD_LIBRARY_PATH=/export /opt1/users/oracle/Attunity/odbc35_64bit,LIBPATH=/export/opt1/users/oracle/Attunity/odbc35_64bit")
)

initDG4.ora entry:

# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.

#
# HS init parameters
#
HS_FDS_CONNECT_INFO=REMOTE
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_CONNECT_STRING=DG4 (This is the datasource name defined in the Optim Connect binding) 

odbc.ini entry:

[DG4]
Driver=/export/opt1/users/oracle/Attunity/odbc35_64bit/thinapi3.so
BindUrl=localhost:2551/Navigator
DefTDPName=DG4
#Debug/generalTrace=TRUE
#Debug/logFile=/export/opt1/users/oracle/tmp/sqllinkserver.log
#Debug/apiTrace=TRUE


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

728x90
728x90

Question

On DB2 UDB Version 8 FixPak 11 or later, after following the steps to set up the unixODBC driver manager as stated in the documentation section "Setting up the unixODBC Driver Manager", you receive the following error when you test the connection:

$ isql -v testdb username mypassword 
[IM005][unixODBC][Driver Manager]Driver's SQLAllocHandle on 
SQL_HANDLE_DBC failed 
[ISQL]ERROR: Could not SQLConnect

Cause

Documentation incorrectly states to use

Answer

The following step in the documentation is NOT necessary for DB2 UDB Version 8 FixPak 11 or above.

For AIX only: Extract the shared library from the ODBC driver for DB2 to yield
shr.o on 32-bit platforms and shr_64.o on 64-bit platforms: 

cd /u/db2inst1/sqllib/lib
ar -x libdb2.a 

cd /u/db2inst1/sqllib/lib
ar -x -X 64 libdb2o.a

The library db2o.o is already bundled with DB2 UDB. You just need to edit your odbc.ini file to use the correct library.

Example:

[TESTDB] 

Description=TEST database 
Driver=/home/username/sqllib/lib/db2o.o



728x90
728x90

This topic explains how to set up client access to DB2® databases for ODBC applications in Linux and UNIX operating systems. If your application is a CLI application, you are only required to perform the task in the Before you begin section to set up your environment.

Before you begin

Before setting up the ODBC environment, ensure you have set up the CLI environment.

About this task

For ODBC applications on UNIX that need to access a DB2 database, follow the steps described below.

Procedure

  1. Ensure that an ODBC driver manager is installed and that each user that will use ODBC has access to it. DB2 does not install an ODBC driver manager, so you must use the ODBC driver manager that was supplied with your ODBC client application or ODBC SDK in order to access DB2 data using that application.
  2. Set up .odbc.ini, the end-user's data source configuration. Each user ID has a separate copy of this file in their home directory. Note that the file starts with a dot. Although necessary files are usually updated automatically by the tools on most platforms, users of ODBC on UNIX platforms will have to edit them manually.

    Using an ASCII editor, update the file to reflect the appropriate data source configuration information. To register a DB2 database as an ODBC data source there must be one stanza (section) for each DB2 database.

    The .odbc.ini file must contain the following lines (examples refer to configuration of the SAMPLE database data source):
    • in the [ODBC Data Source] stanza:
         SAMPLE=IBM DB2 ODBC DRIVER
      which indicates that there is a data source called SAMPLE that uses the IBM® DB2 ODBC DRIVER;
    • in the [SAMPLE] stanza:
      on AIX®, for example,
         [SAMPLE]
         Driver=/u/thisuser/sqllib/lib/libdb2.a
         Description=Sample DB2 ODBC Database
      on the Solaris operating system, for example,
         [SAMPLE]
         Driver=/u/thisuser/sqllib/lib/libdb2.so
         Description=Sample DB2 ODBC Database

      which indicates that the SAMPLE database is part of the DB2 instance located in the directory/u/thisuser.

      With the introduction of the 64-bit development environment, there have been a number of inconsistencies among vendors regarding the interpretation of the sizes of certain parameters. For example, the 64-bit Microsoft ODBC Driver Manager treats SQLHANDLE and SQLLEN as both 64-bits in length, whereas Data Direct Connect and open source ODBC driver managers treat SQLHANDLE as 64-bit, but SQLLEN as 32-bit. The developer must therefore pay careful attention to which version of the DB2 driver is required. Specify the appropriate DB2 driver in the data source stanza, according to the following information:
      Type of applicationDB2 driver to specify
      32-bit CLIlibdb2.*
      32-bit ODBC Driver Managerlibdb2.*
      64-bit CLIlibdb2.*
      64-bit ODBC Driver Managerlibdb2o.* (db2o.o for AIX)
      Note: The file extension of the DB2 driver to specify depends on the operating system. The extensions are as follows:
      • .a - AIX
      • .so - Linux, Solaris, HP-IPF
      • .sl - HP-PA
  3. Ensure that the application execution environment has reference to the ODBC driver manager by including the corresponding shared library in the environment variable for the library path. The following table indicates the library name by operating system
    Operating systemEnvironment variableLibrary name
    AIXLIBPATHlibodbc.a
    HP-UX, Linux, and SolarisLD_LIBRARY_PATHlibodbc.so
  4. Enable a system-wide .odbc.ini file to be used by setting the ODBCINI environment variable to the fully qualified pathname of the .ini file. Some ODBC driver managers support this feature which allows for centralized control. The following examples show how to set ODBCINI:
    in the C shell,
       setenv ODBCINI /opt/odbc/system_odbc.ini
    in the Bourne or Korn shell,
       ODBCINI=/opt/odbc/system_odbc.ini;export ODBCINI
  5. Once the .odbc.ini file is set up, you can run your ODBC application and access DB2 databases. Refer to the documentation that comes with your ODBC application for additional help and information.

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.apdv.cli.doc/doc/t0006349.html
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.apdv.cli.doc/doc/t0010406.html

http://www.unixodbc.org/doc/db2.html

728x90
728x90

To run ODBC applications on Linux or UNIX operating systems, you must configure the unixODBC Driver Manager.

Procedure


To set up the unixODBC Driver Manager for use with CLI and ODBC applications:

  1. Download the latest unixODBC source code from http://www.unixodbc.org.
  2. Untar the source files. For example:
    gzip -d unixODBC-2.2.11.tar.gz
    tar xf unixODBC-2.2.11.tar
  3. For AIX® only: Configure the C compiler to be thread-enabled:
    export CC=xlc_r
    export CCC=xlC_r
  4. To compile a 64-bit version of the driver manager using the xlc_r compilers, set the environment variablesOBJECT_MODE and CFLAGS:
    export OBJECT_MODE=64
    export CFLAGS=-q64 -DBUILD_REAL_64_BIT_MODE
  5. Install the driver manager in either your home directory or the default /usr/local prefix:
    • (Home directory) Issue the following command in the directory where you untarred the source files:
      ./configure --prefix=$HOME -DBUILD_REAL_64_BIT_MODE --enable-gui=no 
                                         --enable-drivers=no
    • (/usr/local as root) Issue the following command:
      ./configure --enable-gui=no --enable-drivers=no
      (prefix 옵션을 생략하면 /usr/local 디렉토리를 사용한다)
  6. Optional: Examine all configuration options by issuing the following command:
    ./configure --help
  7. Build and install the driver manager:
    make
    make install
    Libraries will be copied to the [prefix]/lib directory, and executables will be copied to the [prefix]/bindirectory.
  8. For AIX only: Extract the shared library from the ODBC driver for DB2® to yield shr.o on 32-bit operating systems and shr_64.o on 64-bit operating systems. To avoid confusion, rename the files db2.o and db2_64.o, respectively. These steps are necessary on AIX because the unixODBC Driver Manager loads the driver dynamically.
    • On 32-bit operating systems, issue the following commands:
      cd INSTHOME/sqllib/lib
      ar -x libdb2.a
      mv shr.o db2.o
      where INSTHOME is the home directory of the instance owner.
    • On 64-bit operating systems, issue the following commands:
      cd INSTHOME/sqllib/lib
      ar -x -X 64 libdb2.a
      mv shr_64.o db2_64.o
      where INSTHOME is the home directory of the instance owner.
    Ensure that your INI file references the correct library.
  9. Optional: For AIX only: Extract libodbc.alibodbcinst.a, and libodbccr.a if you will be dynamically loading the driver manager: (명령을 수행하기 전에 OBJECT_MODE 환경변수가 설정되어 있는지 확인한다)
    ar -x libodbc.a
    ar -x libodbcinst.a
    ar -x libodbccr.a 
    This produces libodbc.so.1libodbcinst.so.1, and libodbccr.so.1 respectively in the [prefix]/lib/so directory. (파일확장자는 unixODBC 버전에 따라 달라질 수 있다)
  10. Build the application and ensure it is linked to the unixODBC Driver Manager by including the -L[prefix]/lib -lodbc option in the compile and link command.
  11. Specify the paths for at least the user INI file (odbc.ini) or the system INI file (odbcinst.ini), and set the ODBCHOME environment variable to the directory where the system INI file was created.
    Important: Provide absolute paths when specifying the paths of the user and system INI files. Do not use relative paths or environment variables.
    Note: If compiling 64-bit applications for the ODBC Driver, use the -DODBC64 option to enable the 64-bit definitions in the driver manager.

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.apdv.cli.doc/doc/t0010406.html


728x90
728x90

DB2에서는 온라인 백업 수행중 테이블 TRUNCATE가 수행되지 않는다. 엄밀히 말하자면 기본적으로 TRUNCATE TABLE 기본 옵션이 DROP STORAGE를 사용하기 때문인데 카탈로그 테이블 경함으로 인한 것으로 보인다.

부득이 백업 수행중에 TRUNCATE를 해야한다면 REUSE STORAGE 옵션을 사용한다.

이렇게 했을 경우 테이블에 할당된 공간은 해제되지 않는다. (기존의 공간을 계속 차지한 상태)


 description

  • ADMIN_MOVE_TABLE issues TRUNCATE TABLE e.g. after having created
    a row compression dictionary from a table sample.
    The TRUNCATE  TABLE statement is issued without the "REUSE
    STORAGE"
    option and therefore defaults to "DROP STORAGE".
    TRUNCATE TABLE ... DROP STORAGE is not compatbile with online
    backup.
    Either TRUNCATE waits or the online backup has to wait ...
    We need to issue TRUNCATE TABLE with REUSE STORAGE clause.


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

728x90

+ Recent posts