command line‎ > ‎

maintenance

Utility functions to maintain Informix instances and databases from the command line.

instance

These utilities are used to help maintain the instances

auto

Run a service against every instance on the host. e.g.

infx auto service=backup-dbs

Runs the backup-dbs service on each instance on this host.

clean

Remove old service log files

infx clean

In config.ini, define how the service and instance logs will be cleaned up. Specify a number of log files to keep for each service, otherwise defaults to  28.

Example:

[cleanup]
backup-logs=3
restore=-1

This example will only keep three days of logical log backup service logs. Setting restore=-1 will keep all restore service log files.

idsinstall

Installs Informix software from a tar file.

infx idsinstall tar=iif.11.70.FC4TL.linux-x86_64.tar

This will install Informix version 11.70FC4TL. By default, infx looks for the tar file in /infx/tar. Specify an absolute path to specify a file in a different location.

A unique directory is used for each version. The above tar file will install to /infx/sw/IIF_11.70FC4TL.

database

These utilities are used to help maintain the instances

sch

Get schema information about a table. You must supply a template to format the output for the command line. The examples use the included test templates.

demo1@bobii:/home/informix/jgh>infx table func=sch tab=barlog db=bartest templ=infx-test-tabsch

info for table: bartest:..barlog

columns
        col no=1 name=id attrs=serial not null
        col no=2 name=stamp attrs=datetime year to second
        col no=3 name=note attrs=char(128)
        col no=4 name=logno attrs=integer

options: extent size 16 next size 16
lock mode row

constraints

index
        name=ix1_barlog type=U attrs=id opt=in idx01


info

Get information about a table, broken down by partitions.. You must supply a template to format the output for the command line. The examples use the included test templates.

demo1@bobii:/home/informix/jgh>infx table func=info tab=barlog db=bartest templ=infx-test-partinfo
partitions:
name=barlog, owner=informix, object=barlog, space=dat01, ext=1
name=barlog-ix1_barlog, owner=informix, object=ix1_barlog, space=idx01, ext=1

ddl

Print out the table schema SQL from the Informix dbschema utility,

demo1@bobii:/home/informix/jgh>infx table func=sch tab=barlog db=bartest templ=infx-test-tabddl

grant dba to "informix";

{ TABLE "informix".barlog row size = 144 number of columns = 4 index size = 9 }
create table "informix".barlog
  (
    id serial not null ,
    stamp datetime year to second,
    note char(128),
    logno integer
  ) extent size 16 next size 16 lock mode row;

revoke all on "informix".barlog from "public" as "informix";


grant select on "informix".barlog to "public" as "informix";
grant update on "informix".barlog to "public" as "informix";
grant insert on "informix".barlog to "public" as "informix";
grant delete on "informix".barlog to "public" as "informix";
grant index on "informix".barlog to "public" as "informix";

create unique index "informix".ix1_barlog on "informix".barlog
    (id) using btree  in idx01;

shrink

Execute the SQL Admin API table shrink task on the specified table.

infx sysadnin func=shrink tab=barlog db=bartest

Shrinks the barlog table in the bartest database.

repack

Execute the SQL Admin API table repack task on the specified table.

infx sysadnin func=repack tab=barlog db=bartest

Repacks the barlog table in the bartest database.

resize

Alter the specified tables first and next extent size. Sizes default to megabytes.

infx sysadnin func=resize first=512 next=256 tab=barlog db=bartest

Sets the first extent size to 512mb and the next extent size to 256mb for the barlog table in the bartest database.

lmode

Change the specified tables lock mode between row and page.

infx sysadnin func=lmode lmode=row tab=barlog db=bartest

Sets row mode locking for the barlog table in the bartest database.

infx sysadnin func=lmode lmode=page tab=barlog db=bartest

Sets page mode locking for the barlog table in the bartest database.

files

Use these functions to manage instance files. infx automatically maps functional file names to paths within the instance tree.

 name final path
 config /infx/local/etc/config.ini or /infx/etc/config.ini
 onconfig $INFORMIXDIR/etc/$ONCONFIG
 sqlhosts $INFORMIXSQLHOSTS
 deny-* /infx/inst/$INFORMIXSERVER/etc/deny-*
 allow-* /infx/inst/$INFORMIXSERVER/etc/allow-*
 /logs/ /infx/inst/$INFORMIXSERVER/logs/*
 *.ini /infx/local/etc/*.ini or /infx/etc/*.ini
 *.onconfig /infx/local/etc/*.onconfig or /infx/etc/*.onconfig
 *.inst /infx/local/etc/*.inst or /infx/etc/*.inst 
 oncfg $INFORMIXDIR/etc/oncfg_$ONCONFIG_DBSERVERNAME_$ONCONFIG_DBSERVERNUM
 online.log $ONCONFIG_MSGPATH
 console $ONCONFIG_CONSOLE
 bar_act_log $ONCONFIG_BAR_ACT_LOG
 bar_debug_log $ONCONFIG_BAR_DEBUG_LOG

file

Cat the contents of the specified file

infx file file=config.ini

Cats the contents of /infx/local/etc/config.ini

infx file file=bar_act_log

Cats the contents of the BAR_ACT_LOG file as specified in ONCONFIG.

file-new

Create a new file

infx file-new file=deny-auto-backup-dbs

Create a file to stop the instance being included in the backup by the auto service.

file-rm

Remove a file

infx file-rm file=deny-auto-backup-dbs

Remove the file that stops the instance being included in the backup by the auto service.

file-copy

Make a local copy of a config file in /infx/etc 

infx file-copy file=sub-infx-ontape.ini

Create a copy of the standard sub-infx-ontape.ini file in /infx/local/etc