Dm Ids Cert5557 PDF

Embed Size (px)

Citation preview

  • 8/11/2019 Dm Ids Cert5557 PDF

    1/38

  • 8/11/2019 Dm Ids Cert5557 PDF

    2/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 2 of 38

    PrerequisitesThis tutorial is written for users with basic knowledge of Structured Query Language (SQL).

    System requirements

    To understand and test the concepts discussed in this tutorial, you need a running instance of IDS11.50.

    The onstat, oninit, and onmode utilitiesMajor components of the serverIBM Informix Dynamic Server (IDS) consists of three major components, namely the oninitprocesses (virtual processors), the shared memory segments, and the disk space storage. Uponstarting the server, an oninit process reads the necessary information from the configuration fileand disk before creating the shared memory segments. The required virtual processors are thenstarted, as specified in the configuration file.

    Figure 1 shows the virtual processes interacting with the shared memory segments and disksusbsystem. Besides the buffer pool, which contains the data or index information, a large part ofshared memory contains control data, which the virtual processes (or threads) use to coordinateand execute their activities. As for the disk subsystem, it contains the persistent information, whichthe virtual processes will read and write from. Persistent information is data that is not lost evenafter IDS has shut down .

    Figure 1. Major component of IDS

  • 8/11/2019 Dm Ids Cert5557 PDF

    3/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 3 of 38

    Modes of IDSIDS has four principle operating modes:

    Offline mode Quiescent mode Administrative mode Online mode

    Offline mode

    In this mode, the server is not running and no shared memory segments or virtual processorsare created. Using the following onstat command, the below output will be shown if the server isoffline:

    $ onstat -shared memory not initialized for INFORMIXSERVER 'ol_115fc3'

    Quiescent mode

    In quiescent mode, the shared memory is initialized and the virtual processors are started.Administration that does not require SQL connection is allowed in this mode. No user connection isallowed in this mode.

    Issuing the following onstat command will show the below output when the server is in this mode:

    $ onstat -IBM Informix Dynamic Server Version 11.50.FC3 -- Quiescent -- Up 00:21:42 -- 149504 Kbytes

    Administrative modeAny type of administration activity that requires SQL should use this mode. This mode is identicalto online mode, except that only admin users can connect to the server. Virtual processors andshared memory is initialized.

    In this mode, only user informix and DBSA group can connect to the server by default. To enableother users to also connect, set the onconfig parameter ADMIN_USER_MODE_WITH_DBSA to 1 withthe permitted user listed in the configuration parameter ADMIN_MODE_USERS. For example, theconfiguration can look like this:

    ADMIN_MODE_USERS jgyap, kohcf, jagena, nopavis

    At this mode, sending onstat will receive the following output:

    $ onstat -IBM Informix Dynamic Server Version 11.50.FC3 -- Single-User -- Up 00:23:07--149504 Kbytes

    Online mode

    This is the normal operating mo de in which authorized activity of the various users is carried out.Virtual proc essors and shar ed memory is initialized.

  • 8/11/2019 Dm Ids Cert5557 PDF

    4/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 4 of 38

    Again, onstat will show you the online mode:

    $ onstat -IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 00:41:57 -- 149504 Kbytes

    Transitory modeIt is possible for the server to be in a transitory mode, such as recovery mode and shutdown mode.Recovery mode is when the server is changing from offline to quiescent or online. Shutdown modeis when the server is going from online to quiescent.

    In Microsoft Windows, the server runs as a service. Therefore, the server can be started (onlinemode) or stopped (offline mode) using the Services Tool accessible from your control panel or NETcommand. For example, you can issue the following command to start the server with the servicename ol_115fc3:

    NET start ol_115fc3

    To stop the service:

    NET stop ol_115fc3

    Disk space initializationThe creation of shared memory segment is sometimes called shared memory initialization. Thereis another type of initialization that is called disk space initialization, where the initial chunk of theroot dbspace is initialized in an internal format.

    Disk space initialization is required to be done when a new instance is created. Use the followingcommands to do disk space initialization:

    UNIX:

    oinit -i

    Windows:

    starts dbservername -i

    Or use the Instance Manager program to create the new instance.

    To skip the requirement to respond yes, use the y option:

    UNIX:

    oninit -iy

    Windows:

    starts dbservername -iy

  • 8/11/2019 Dm Ids Cert5557 PDF

    5/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 5 of 38

    To get a verbose trace during the disk initialization, use the v option:

    UNIX:

    oninit -ivy

    Windows:

    starts dbservername -ivy

    To let the engine stay in quiescent mode after disk initialization, add the s option:

    UNIX:

    oninit -ivys

    Windows:

    starts dbservername -ivys

    The server will automatically do the shared memory initialization as well and bring the engineonline during disk initialization.

    Note: If disk initialization is done on an existing instance, all the data in the old instance will belost.

    IDS mode management

    When the engine is in offline mode, use the oninit utility to bring up the server to the desired mode.When it is no in offline mode, use the onmode utility.

    Table 1 shows the oninit or onmode utility and its option to use in order to set the server to adesired mode.

    Table 1. Mode management using oninit and onmode

    Target mode Original mode: Offline Original mode: Not offline

    Offline n/a onmode -k

    Quiescent oninit -s onmode -s or onmode -u

    Administrative oninit -j -U onmode -j -U

    Online oninit onmode -m

    Therefore, if the desired target mode is quiescent mode, and current mode of the server is offline,then issue the following command:

    oninit -s

  • 8/11/2019 Dm Ids Cert5557 PDF

    6/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 6 of 38

    However, if the engine is not in offline mode (It's either in quiescent or administrative mode), thenissue one of the following two options:

    For graceful shutdown:

    onmode -s

    Fore Immediate shutdown:

    onmode -u

    In graceful shutdown, existing user sessions are allowed to continue execution, but newconnections are not allowed. However, in immediate shutdown, current sessions are terminatedimmediately and transactions are rolled back.

    Use the -U option to allow users other than informix and those belonging to DBSA group to

    connect to the server when it is in administrative mode. For example, the following commandallows users jgyap, nopavis, and chinth to connect to the server when it is in administrative mode:

    onmode -j -U j gyap nopavis chinth

    To remove the users, issue this command:

    onmode -U " "

    Other oninit options

    During start up, the server cleans up temporary tables that are left over from the last shutdown. Toinstruct the server not to carry out this clean up, you can use the following command:

    oninit -p

    The server provides replication facilities such as HDR and Enterprise Replication (described inPart 9 of this series). To start up the server without initializing the HDR and Enterprise Replication,use the following command:

    oninit -D

    To start the HDR server in standard mode, use this command:oninit -S

    Use the following command to get the detail about the oninit itself:

    http://www.ibm.com/developerworks/data/tutorials/dm-ids-cert5559/index.htmlhttp://www.ibm.com/developerworks/data/tutorials/dm-ids-cert5559/index.html
  • 8/11/2019 Dm Ids Cert5557 PDF

    7/38

  • 8/11/2019 Dm Ids Cert5557 PDF

    8/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 8 of 38

    , Llog used 1

    11:26:04 Checkpoint Completed: duration was 0 seconds.11:26:04 Fri Aug 7 - loguniq 21, logpos 0xe27018, timestamp: 0x1c1355 Interval: 3744

    11:26:04 Maximum server connections 111:26:04 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used23, Llog used 7

    11:30:46 Explain file for session 201:/usr2/as_support/jgyap/sqexplain.out.201

    In the sqexplain.out.201 file, you will able to check the query plain executed by thesession 201.

    To turn off the SQL explain, issue the following command:

    onmode -Y 201 0

    IDS also allows the dynamic addition and removal of a virtual processor. To add two more cpuvirtual processors, you can use the following command:

    onmode -p +2 cpu

    Check the online.log to see that the operation is successfully executed:

    Listing 3. Checking the online.log

    $ onstat -m

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 17 days 22:30:38-- 522240 Kbytes

    Message Log File: /usr2/support/products/sr_11.50.FC3/tmp/online.log

    01:23:50 Checkpoint Completed: duration was 0 seconds.01:23:50 Sat Aug 8 - loguniq 22, logpos 0xc34018, timestamp: 0x1c9916 Interval: 3808

    01:23:50 Maximum server connections 101:23:50 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used26, Llog used 8

    01:28:50 Checkpoint Completed: duration was 0 seconds.01:28:50 Sat Aug 8 - loguniq 22, logpos 0xc35044, timestamp: 0x1c991f Interval: 3809

    01:28:50 Maximum server connections 101:28:50 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used2, Llog used 1

    01:43:53 Checkpoint Completed: duration was 0 seconds.01:43:53 Sat Aug 8 - loguniq 22, logpos 0xc36044, timestamp: 0x1c992b Interval: 3810

    01:43:53 Maximum server connections 101:43:53 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used2, Llog used 1

    01:55:11 Dynamically added 2 cpu VPs

    To take the processors away when no they are no longer needed, issue the following command:

    onmode -p -2 cpu

  • 8/11/2019 Dm Ids Cert5557 PDF

    9/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 9 of 38

    Similarly, check the online.log using onstat -m to determine if onmode operation is successful.

    Another way to check if the operation is successful is to use onstat -g glo . Listing 4 provides asample of its output:

    Listing 4. onstat -g glo output$ onstat -g glo

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 17 days 23:16:17-- 522240 Kbytes

    MT global info:sessions threads vps lngspins0 24 11 157068

    sched calls thread switches yield 0 yield n yield forevertotal: 30052583 24391872 114838 18595853 104014per sec: 52 42 0 31 0

    Virtual processor summary: class vps usercpu syscpu total cpu 5 160.06 10.67 170.73 aio 2 0.53 5.69 6.22 lio 1 1.30 7.84 9.14 pio 1 0.03 1.26 1.29 adm 1 0.01 0.01 0.02 msc 1 0.02 0.01 0.03 total 11 161.95 25.48 187.43

    Individual virtual processors: vp pid class usercpu syscpu total Thread Eff 1 9258 cpu 38.60 3.87 42.47 3728.55 1% 2 9259 adm 0.01 0.01 0.02 0.00 0% 3 9260 cpu 44.39 2.66 47.05 8483.41 0% 4 9261 cpu 76.98 4.12 81.10 8657.88 0% 5 9262 lio 1.30 7.84 9.14 1357.97 0% 6 9263 pio 0.03 1.26 1.29 92.94 1% 7 9267 aio 0.41 3.72 4.13 328.48 1% 8 9268 msc 0.02 0.01 0.03 0.23 13% 9 9269 aio 0.12 1.97 2.09 258.58 0% 10 26623 cpu 0.03 0.01 0.04 11.39 0% 11 26624 cpu 0.06 0.01 0.07 10.37 0% tot 161.95 25.48 187.43

    By monitoring the number of virtual processors (vps column in the "Virtual processor summary"section) for the cpu class before and after the onmode -p command, you can verify whether theonmode command was executed successfully.

    To list out all the options available, you can issue the following:

    Listing 5. List of available options$ onmodeusage: onmode [-abBCCcDdFIjklMmnOpQRrSsuWYyZz] | [-wf =] | [-wm =] -a Increase shared memory segment size. -b Revert Dynamic Server disk structures. -BC [1|2] Change server large chunk mode

  • 8/11/2019 Dm Ids Cert5557 PDF

    10/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 10 of 38

    -c [block | unblock] Do Checkpoint. Block or unblock server. -C {start |stop |threshold | duration |rangesize |alice | compression } Tune B-tree scanner. -D -d {standard|{primary|secondary }} set DR server type DR secondary only: {idxauto {on|off}} set DR automatic index repair mode {index :[owner.]#} DR repair index {add RSS } add RSS server {chang e RSS } change RSS server password {delet e RSS } remove RSS server definition {RSS } set RSS server type {set SDS primary [force]} define SDS primary server alias {clear SDS primary [force]} remove SDS primary server alias {make primary [force]} make server into the MACH11 primary -e {on|off|enable|flush} configure or flush shared statement cache. -F Free unused memory segments -I stop verbose error trapping -I [] trap specified error for session ID -j Change to single-user mode -k Shutdown completely -l Force to next logical log

    -M -m Go to multi-user on-line -n Set shared memory buffer cache to non-resident -O Override space down blocking a checkpoint -p Start up or remove virtual processors of a specific class -Q -R Rebuild the /INFORMIXDIR/etc/.infos.DBSERVERNAME file -r Set shared memory buffer cache to resident -S -s Change to quiescent mode -u Change to quiescent mode and kill all attached sessions -W {STMT_CACHE_NOLIMIT {0|1} | STMT_CACHE_HITS } Sets ssc parameters. -wf = Update the value of the specified configuration parameter and save the new value to the onconfig file. -wm = Update the value of the specified configuration parameter without saving the new value to the onconfig file. The new value is written to server memory only and will not be retained once the server is restarted. -y Do not require confirmation -Y [filename] Set or unset dynamic explain 0=off 1=plan + statistics on 2=only plan on filename is a valid argument only when setting the dynamic explain or dynamic explain statistics on -Z heuristically complete specified transaction -z Kill specified session id

    Monitoring IDS using onstat utilityWhen the server starts, it creates structure control blocks in the shared memory segments. Thesecontrol blocks are used internally by the server for the various operations. Thus, by reading thecontrol structures, you are able to monitor the state or different events of the server. The onstatutility is primarily used for that purpose.

    Figure 2 shows the onstat utility reading the different C language structures in the shared memory.These structures are information related to sessions, locks, buffers, logs, and so on. The onstatutility reads these structures and displays them in a readable format.

  • 8/11/2019 Dm Ids Cert5557 PDF

    11/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 11 of 38

    Figure 2. IDS shared memory overview

    For a start, the simplest onstat command is as follows:

    $ onstat -

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 17 days 08:12:09 --522240 Kbytes

    It shows that the version of IDS running is 11.50.FC3 and that it had been in online mode for 17days, 8 hour, 12 minutes, and 9 seconds. The memory it is using is 522240KB.

    To find out about sessions information, use the -g ses option:

    Listing 6. -g ses option$ onstat -g ses

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 00:00:45 --149504 Kbytes

    session #RSAM total used dynamicid user tty pid hostname threads memory memory explain21 informix - 0 - 0 12288 11688 off20 informix 93 28925 acme 1 106496 84920 off18 informix - 0 - 1 348160 329960 off17 informix - 0 - 1 299008 274344 off16 informix - 0 - 1 417792 344576 off3 informix - 0 - 0 16384 13272 off2 informix - 0 - 0 12288 11688 off

    As shown in Listing 6, a list of sessions and their information are displayed. Session id in thefirst column is a unique number used by the engine to track each session. The user id, pid of theclient, and the hostname that the connection is from are also shown. One interesting column isthe RSAM thread, which shows how many threads are spawned for that session. It is possibleto have multiple threads associated with one session. Usually, for one client session, there will

  • 8/11/2019 Dm Ids Cert5557 PDF

    12/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 12 of 38

    be one corresponding sqlexec thread at the database server end. This thread is responsible forreceiving the instruction from the client and sending information back to it. The server might spawnadditional threads for a session if required. One such example of additional thread is the scanthread, used for scanning disk for data.

    You can obtain the details for a given session:

    Listing 7. Getting info about session 20

    $ onstat -g ses 20

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 00:02:04 --149504 Kbytes

    session effective #RSAM total used dynamicid user user tty pid hostname threads memory memory explain20 informix - 93 28925 acme 1 106496 84920 off

    tid name rstcb flags curstk status

    47 sqlexec 1115375c8 Y--P--- 7839 cond wait netnorm -

    Memory pools count 2name class addr totalsize freesize #allocfrag #freefrag20 V 11258d040 102400 20768 94 1220*O0 V 1125f1040 4096 808 1 1

    name free used name free usedoverhead 0 6576 scb 0 144opentable 0 3608 filetable 0 832log 0 16536 temprec 0 21664keys 0 176 gentcb 0 1584ostcb 0 2816 sqscb 0 19112sql 0 72 rdahead 0 1120hashfiletab 0 552 osenv 0 2648sqtcb 0 7128 fragman 0 352

    sqscb infoscb sqscb optofc pdqpriority sqlstats optcompind directives1125be0c0 1125d5028 0 0 0 2 1

    Sess SQL Current Iso Lock SQL ISAM F.E.Id Stmt type Database Lvl Mode ERR ERR Vers Explain20 - db1 CR Not Wait 0 0 9.24 Off

    Last parsed SQL statement : select * from t1

    The additional information you can obtain includes detail of the thread associated with the

    session, the detail of the memory used as in the "Memory pools section", and the detail of the SQLstatement parsed or executed. The column "SQL ERR" and "ISAM err" shows you if this sessionencountered any errors when executing the SQL statement.

    To view dbspace and chunk information, use the -d option:

  • 8/11/2019 Dm Ids Cert5557 PDF

    13/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 13 of 38

    Listing 8. -d option$ onstat -d

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 00:03:43-- 149504 Kbytes

    Dbspacesaddress number flags fchunk nchunks pgsize flags owner name111444028 1 0x40001 1 1 2048 N B informix rootdbs 1 active, 2047 maximum

    Chunksaddress chunk/dbs offset size free bpages flags pathname1114441c0 1 1 0 100000 29151 PO-B- /support/rootchk 1 active, 32766 maximum

    NOTE: The values in the "size" and "free" columns for DBspace chunks are displayed in terms of "pgsize" of the DBspace to which they belong.

    Expanded chunk capacity mode: always

    This onstat displays the output into two main sections: dbspaces and chunks.

    In the "Dbspaces" section, the important field to take note is "fchunk", which indicates the firstchunk number (which is the identifier for the chunk in the "Chunks" section) of the dbspace. The"nchunks" tells you how many chunks this dbspace has altogether.

    From the "Chunks" section, the size of the chunk and the amount of free space available areshown in the "siz" and "free" columns, respectively. As the special "NOTE" written at the bottom ofthe output indicates, the unit for "size" and "free" column are in pages of dbspace that it belongsto. For example, for the chunk 1 in this case, its size is 100000 pages, and size of each page fordbspace 1 is 2048 bytes, as shown in the pgsize column in the "Dbspace" section. Thus, the sizeof chunk 1 is 204 800 000 bytes.

    There are many other options available. To list them, you can use the following command:

    Listing 9. List of available options$ onstat --usage: onstat [ -abBcCdDfFgGhjklLmOpPRstTuxXz ] [ -i ] [ -r [] ] [ -o [] ] [ ]

    -- Print this help text Read shared memory information from specified dump file

    -a Interpreted as onstat -mcuxskbPFhRtdGflLpO; onstat -g all; onstat -XC -b Print buffers -B Print all buffers -c Print configuration file -C Print b-tree scanner requests -d [update] Print spaces and chunks update - Ask server to update BLOB chunk statistics -D Print spaces and detailed chunk stats -f Print dataskip status -F Print page flushers

    -g MT COMMAND or ENTERPRISE REPLICATION COMMAND (see below)

  • 8/11/2019 Dm Ids Cert5557 PDF

    14/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 14 of 38

    MT COMMANDS: act Print active threads afr Print allocated pool fragments all Print all MT information ath Print all threads buf Print profile information related to buffer pools. ckp Print checkpoint statistics cmsm Print Connection Manager statistics con Print conditions with waiters cpu Print CPU info for all threads dbc Print dbScheduler/dbWorker thread info ddr Print DDR log post processing information dic Print dictionary cache information dis Print a list of database servers and the status of each dll Print dynamic library statistics dmp Dump bytes of shared memory starting at dri Print data replication information dsc Print a list of distribution cache information env [ all | [] ] [[,...]] Display environment variable settings. ffr

    Print free pool fragments glo Print MT global information his [] Prints SQL statement tracing information for no = Complete output from trace buffer idxscan Print index scan profiles imc Print information about connected MaxConnect instances iob Print big buffer usage by IO VP class iof Print disk IO statistics by chunk/file iog Print AIO global information iov Print disk IO statistics by vp ipl Print index page logging status lap Print light append information lmx Print all locked mutexes lsc Print Light Scan information mem [|] Print pool statistics. mgm Print Memory Grant Manager information nbm Print block map for non-resident segments nsc [] Print net shared memory status nsd Print net shared memory data nss [] Print net shared memory status ntd Print net dispatch information ntm Print net message information ntt Print net user thread access times ntu Print net user thread profile information opn [] Print open tables plk Print partition lock profiles

    pos Print /INFORMIXDIR/etc/.infos.DBSERVERNAME file ppf [ | 0] Print partition profiles pqs [] Print statistics for an active query prc Print information about SPL routine cache proxy [all | [ [ []]] ] Print updatable secondary related information qst Print queue statistics rbm Print block map for resident segment rea Print ready threads rss [verbose | log | ] Print RSS server related information

  • 8/11/2019 Dm Ids Cert5557 PDF

    15/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 15 of 38

    rwm print Read/Write Mutex lists sch Print VP scheduler statistics sds [verbose | ] Print SDS related information seg Print memory segment statistics ses [] Print session information sle Print all sleeping threads smb Print smart-large-object usage smx [ses] Print smx related information spi Print spin locks with long spins sql [] Print SQL information src Search memory for , where ==(memory&) ssc [pool|all] Prints ssc pool summary, or statement cache summary and entries, including key only entries (all) stk Dump the stack of a specified thread stm [] Prints all prepared statements approximate memory usage in a session stq []

    Print stream queue information sts Print max and current stack sizes tgp Print generic page thread profiles tpf [ | 0] Print thread profiles ufr Print pool usage breakdown vpcache Print CPU VP memory block cache statistics wai Print waiting threads wmx Print all mutexes with waiters wst Print thread wait statistics

    ENTERPRISE REPLICATION COMMANDS: cat [scope | replname ] Print Enterprise Replication global catalog information cdr Print Enterprise Replication statistics cdr config [parameter_name] [long] cdr config CDR_ENV [variable_name] [long] Print Enterprise Replication configuration information Not specifying a parameter will display the name of and information about all available parameters. dtc Print statistics for the Enterprise Replication delete table cleaner dss [ UDR | UDRx ] Print statistics about data sync threads and user-defined data types grp [ A|E|Ex|G|L|Lx|M|Mz|P|pager|R|S|Sl|Sx|T|UDR|UDRx ] Print statistics about the Enterprise Replication grouper nif [ all | sites | serverid | sum ] Print statistics about the Enterprise Replication network interface

    que Print statistics for the Enterprise Replication high-level queues rcv [serverid] Print statistics about the Enterprise Replication receive manager rep [replname] Print events that are in the queue for the schedule manager rqm [ ACKQ | CNTRLQ | RECVQ | SENDQ | SYNCQ | SBSPACES | FULL | BRIEF | VERBOSE ] Print statistics of the Enterprise Replication low-level queues sync Print the Enterprise Replication synchronization status

    -G Print global transaction ids -h Print buffer hash chain info -i Interactive mode

  • 8/11/2019 Dm Ids Cert5557 PDF

    16/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 16 of 38

    -j Print interactive status of the active onpload process -k Print locks -l Print logging -L Print distribution of available locks on the lock free lists -m Print message log -o Put shared memory into specified file (default: onstat.out) -O Print Optical Subsystem memory and staging cache information -p Print profile -P Print partition buffer summary -r Repeat options every seconds (default: 5) -R Print LRU queues -s Print latches -t Print TBLspaces -T Print tablespace information -u Print user threads -x Print transactions -X Print entire list of sharers and waiters for buffers -z Zero profile counts

    Data movement utilitiesExport and import database objectsThe dbschema utility can be used to export various database objects such as tables, storedprocedures, sequences, and so on, without unloading the data.

    For example, to obtain the schema of the table t1 in database db1, you can use the followingcommand:

    Listing 10. Obtain table schema dbschema -t t1 -d db1

    DBSCHEMA Schema Utility INFORMIX-SQL Version 11.50.FC3

    { TABLE "informix".t1 row size = 4 number of columns = 1 index size = 0 }create table "informix".t1 ( c1 integer );

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

    To get schemas for all the tables in db1, issue the following command:

    dbschema -t all -d db1

    To get the stored procedure sp1 in db1:

    dbschema -f sp1 -d db1

    Similarly, to get all the stored procedures in db1:

    dbschema -f all -d db1

    If you want to export the schema of the whole database, issue the following command:

    dbschema -d db1

  • 8/11/2019 Dm Ids Cert5557 PDF

    17/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 17 of 38

    To recreate the objects in another database, simply run the dbschema output (without the header)using any user front-end tools such as dbaccess or the OpenAdmin Tool.

    To suppress the header of dbschema output, use the -q option:

    Listing 11. Suppress dbschema output header$ dbschema -q -t t1 -d db1

    { TABLE "informix".t1 row size = 4 number of columns = 1 index size = 0 }create table "informix".t1 ( c1 integer );

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

    Table 2 lists the other important options to take note of:

    Table 2. Other important options of dbschema Options Display

    -hd Distribution of a column, a table, or all the tables

    -seq Syntax of sequence

    -p Permission of user

    -s Synonyms

    Export and import table data To export and import a data into a table, you can use one of the following:

    SQL statements UNLOAD and LOAD HPL dbload onload/onunload

    For instance, to export the data for table t1 in database db1, you can use the following command:

    unload to 'my.dat' select * from t1;

    Typically, the file content will look like that in Listing 12:

    Listing 12. Example file content$ more my.dat1|2|3|4|5|6|7|8|9|10|

  • 8/11/2019 Dm Ids Cert5557 PDF

    18/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 18 of 38

    Note that the columns of the table are delimited by the vertical bar (|).

    To change the delimiter to the dollar ($) sign, you can issue the following command:

    Listing 13. Change delimiterunload to 'my.dat' delimiter '$' select * from t1;

    $ more my.dat1$2$3$4$5$6$7$8$9$10$

    To load the data from the file to the table t1 in db1, simply run the following command in db1:

    load from 'my.dat' insert into t1;

    To load the file you unloaded with the $ delimiter:

    load from 'my.dat' delimiter '$' insert into t1;

    Export and import database or table in binary format

    The onunload and onload utilities allow you to export and import the database or table data inbinary format. This method provides the fastest transfer speed among the utilities discussed so far.However, handling transfer in binary format results in several restrictions, such as (but not limitedto):

    The source and target databases must be in a database server with the same version. The source and target database servers must be residing on the OS of the same page size,

    same representation of numeric data, and same byte alignment for structures and union. Cannot transfer between GLS and non-GLS locale.

    onunload and onload can be used to export the whole database or a specific table to either a tape

    or a file.

    To unload a whole database to a file /tmp/tape, issue the following command:

    onload -t /tmp/tape db1

    To import the database into the target database server from a file that is transferred to the /tmp2directory on that machine:

    onunload -t /tmp2/tape db1

  • 8/11/2019 Dm Ids Cert5557 PDF

    19/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 19 of 38

    dbloadThe dbload utility provides similar functionality to that of a LOAD SQL statement, but with moreflexibility. However, the cost of better flexibility is a hit in performance and is as easy to use as theLOAD SQL statement.

    To use dbload, you need to first create a command file. The command file describes input data fileand mapping of the input data file fields to the columns of the target table.

    For example, say you have a command file name "mycmd" that looks like this:

    FILE orders.unl DELIMITER '|' 10;INSERT INTO orders;

    Here, the command file describes that the name of the input file is orders.unl, the delimiter use is |,there are 10 fields, and this data is to be loaded to the orders table.

    To run the dbload against the database mydb, issue the following command:dbload -d mydb -c mycmd

    Let's explore how dbload can provide more flexibility. Consider a command file with content asshown in Listing 14:

    Listing 14. Command file contentFILE orders.unl DELIMITER '|' 10;INSERT INTO new_orders (col1, col2, col5, col6, col3) VALUES (f01, f03, f07, f05, 'new_constant');

    This command file uses the orders.unl input file also. However, it is now inserting the data into thenew_orders table. As the dbload internally assigns names to the columns of the input commandfile, starting with f01, you can use these internally named fields in the INSERT statement. Asdemonstrated here, the INSERT SQL is loading the field f01 into col1 column of new orders table,f03 into col2, f07 into col5, f05 into col6, and the string 'new_constant' into col3.

    In addition, you can specify the number of bad rows to ignore when loading by using the -e option.Use the -i option for a specific row.

    High Performance Loader (HPL)High Performance Loader (HPL) provides an efficient and flexible way to load or unload a largeamount of data. To appreciate its flexibility and efficiency, let's take a quick look at how the loadand unload are being done.

    To use HPL to load the data, a set of metadata components needs to be defined first. Thecomponents are:

    Device array - describes the source, which can either be a file, tape, or pipe(UNIX). There isno 2GB limitation on the source.

  • 8/11/2019 Dm Ids Cert5557 PDF

    20/38

  • 8/11/2019 Dm Ids Cert5557 PDF

    21/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 21 of 38

    Tasks or sensors that run only during startup of the server are called startup tasks or startupsensors, respectively.

    The IDS scheduler runs the tasks and sensors at specified times or intervals. It takes theinformation about the task and sensor in the ph_task table in the sysadmin database.

    To stop the Scheduler, run the following command:

    Listing 15. Stop the Scheduler$ dbaccess sysadmin -

    Database selected.

    > execute function task ("scheduler stop");

    (expression) Successfully shutdown scheduler

    1 row(s) retrieved.

    To start it, run this command:

    Listing 16. Start the Scheduler$ dbaccess sysadmin -

    Database selected.

    > execute function task ("scheduler start");

    (expression) Successfully started 2 threads

    1 row(s) retrieved.

    Running onstat -g ath will show the thread of the scheduler threads (dbScheduler, dbWorker1,and dbWorker2):

    Listing 17. onstat -g ath$ onstat -g ath

    IBM Informix Dynamic Server Version 11.50.FC3 -- On-Line -- Up 1 days 00:45:40-- 149504 Kbytes

    Threads: tid tcb rstcb prty status vp-class name

    2 112038808 0 1 IO Idle 4lio* lio vp 0 3 1120582a8 0 1 IO Idle 5pio* pio vp 0 4 1120782a8 0 1 IO Idle 6aio* aio vp 0 5 1120972a8 0 1 IO Idle 7msc* msc vp 0 6 1120c62a8 0 1 IO Idle 8aio* aio vp 1 7 1120e6548 11152e028 3 sleeping secs: 1 3cpu main_loop() 8 112058508 0 1 running 1cpu* tlitcppoll 9 112078c40 0 2 sleeping forever 1cpu* tlitcplst 10 1120978f8 11152e878 1 sleeping secs: 1 1cpu flush_sub(0) 11 112097be0 11152f0c8 1 sleeping secs: 1 3cpu flush_sub(1) 12 11218b028 11152f918 1 sleeping secs: 1 3cpu flush_sub(2) 13 11218b310 111530168 1 sleeping secs: 1 3cpu flush_sub(3) 14 11218b5f8 1115309b8 1 sleeping secs: 1 1cpu flush_sub(4) 15 1121e76a0 111531208 1 sleeping secs: 1 3cpu flush_sub(5)

  • 8/11/2019 Dm Ids Cert5557 PDF

    22/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 22 of 38

    16 1121e7988 111531a58 1 sleeping secs: 1 1cpu flush_sub(6) 17 1121e7c70 1115322a8 1 sleeping secs: 1 3cpu flush_sub(7) 18 1122365b0 111532af8 2 sleeping secs: 1 1cpu aslogflush 19 1122d9370 111533348 1 sleeping secs: 99 3cpu btscanner_0 35 112572d50 111534c38 3 sleeping secs: 1 1cpu* onmode_mon 36 1122fb970 1115343e8 3 sleeping secs: 1 3cpu periodic 45 1125f6520 111536d78 1 cond wait bp_cond 3cpu bf_priosweep() 261 112947808 1115375c8 1 cond wait netnorm 1cpu sqlexec 267 112362d48 111535488 1 sleeping secs: 152 3cpu* dbScheduler 268 112c42d20 111535cd8 1 sleeping forever 3cpu dbWorker1 269 11249e4c0 111536528 1 sleeping forever 1cpu dbWorker2

    In Listing 17, you can see the dbScheduler thread, which constantly manages the sensors ortasks, and the dbWorker threadsthe threads that execute the sensor and task (put on queue forthem by the dbScheduler).

    The sysadmin databasesysadmin is a system database created automatically during server initialization. It containsinformation that the Scheduler uses to run the task or sensor. At the heart of the sysadmindatabase is the ph_task table, which basically records information about a task or sensor and

    when to run it. Additionally for sensor, it contains information about what to collect and where tostore it.

    Let's take a look at a built-in example:

    Listing 18. Task exampletk_id 1tk_name mon_command_historytk_description Monitor how much data is kept in the command history tabletk_type TASK

    tk_sequence 23tk_result_tabletk_createtk_dbs sysadmintk_execute delete from command_history where cmd_exec_time < ( select current - value::INTERVAL DAY to SECOND from ph_threshold where name = 'COMMAND HISTORY RETENTION' )tk_delete 0 01:00:00tk_start_time 02:00:00tk_stop_timetk_frequency 1 00:00:00tk_next_execution 2009-08-05 23:46:05tk_total_executio+ 23tk_total_time 0.20672tk_monday ttk_tuesday ttk_wednesday ttk_thursday ttk_friday ttk_saturday ttk_sunday ttk_attributes 404tk_group TABLEStk_enable ttk_priority 0

    From the tk_type, you know that this is a task and its name is "mon_command_history".

  • 8/11/2019 Dm Ids Cert5557 PDF

    23/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 23 of 38

    This task will execute the action as specified in tk_execute, which is:

    Listing 19. Task specified in tk_execute

    delete from command_history where cmd_exec_time < ( select current - value::INTERVAL DAY to SECOND

    from ph_threshold where name = 'COMMAND HISTORY RETENTION' )

    If you run the following subquery, this SQL, in effect, deletes the rows from command_history where the cmd_exec_time is before 2009-07-06 09:13:49.000:

    Listing 20. Subquery to delete rows

    select current - value::INTERVAL DAY to SECOND from ph_threshold where name = 'COMMAND HISTORY RETENTION';

    select current as now,valuefrom ph_threshold where name = 'COMMAND HISTORY RETENTION'

    Output:

    (expression)

    2009-07-06 09:29:21.000

    now 2009-08-05 09:29:21.000value 30 0:00:00

    In this example, you also see another table in sysadmin database being usedph_threshold . Thistable is used to keep threshold, which will trigger the delete statement, which is 30 days before thepoint when the task is executing.

    tk_start_time indicates this task will run at 2 am daily from Monday to Sunday since tk_monday totk_sunday are all marked true.

    Let's now look at an example of a sensor:

    Listing 21. Sensor example

    tk_id 6tk_name mon_vpstk_description Process time of the Virtual Processorstk_type SENSORtk_sequence 117tk_result_table mon_vpstk_create create table mon_vps (ID integer, vpid smallint, num_ready smallint, class integer, usecs_user float, usecs_sys float )tk_dbs sysadmintk_execute insert into mon_vps select $DATA_SEQ_ID, vpid, num_ready, class, usecs_user, usecs_sys FROM sysmaster:sysvplsttk_delete 15 00:00:00tk_start_time

  • 8/11/2019 Dm Ids Cert5557 PDF

    24/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 24 of 38

    tk_stop_timetk_frequency 0 04:00:00tk_next_execution 2009-08-05 07:46:05tk_total_executio+ 117tk_total_time 8.074843700000tk_monday ttk_tuesday ttk_wednesday ttk_thursday ttk_friday ttk_saturday ttk_sunday ttk_attributes 405tk_group CPUtk_enable ttk_priority 0

    Note that the tk_type field value indicates that this task is a sensor. And tk_execute indicates theinformation to capture and keep them in mon_vps table. The tk_result_table specifies the schemaof the mon_vps table.

    By default, the sysadmin database resides in the rootdbs. To move it out to another dbspace, usethe following SQL Admin API:

    EXECUTE FUNCTION task("reset sysadmin","dbs1");

    Checking the online.log:

    Listing 22. Check online.log

    onstat -m

    10:09:46 SCHAPI: thread dbScheduler task mon_checkpoint(0-457) shutting down10:09:46 SCHAPI: thread dbWorker1 task mon_config_startup(3-38) shutting down10:09:46 SCHAPI: thread dbWorker2 task mon_memory_system(8-231) shutting down10:09:46 SCHAPI: 'sysadmin' database will be moved to 'dbs1'. See online message log.10:09:46 Building 'sysadmin' database ...10:09:53 Unloading Module 10:09:57 Loading Module 10:10:05 Unloading Module 10:10:05 Loading Module 10:10:05 'sysadmin' database built successfully.10:10:05 SCHAPI: Started dbScheduler thread.10:10:05 SCHAPI: Started 2 dbWorker threads.

    SQL Admin API functions

    Traditionally, administration tasks, such as management of dbspaces, chunks, logical logs, orphysical logs, are done using utilities such as onspaces, onparams, and onmode. However, withthe introduction of SQL Admin API functions, a set of UDRs now provides similar functionality.The DBA can now execute these administration tasks from a remote machine as long as it canrun the user routine just like a query. Also, the result and audit trail of the action can be kept in acommand_history table in the sysadmin database.

    Two UDRs called task and admin are used. Their functionality is identical, except the result returnvalue is different. For task, the return status is in the form of character:

  • 8/11/2019 Dm Ids Cert5557 PDF

    25/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 25 of 38

    EXECUTE FUNCTION task('create dbspace', 'dbspace2', '/CHUNKS/dbspace2');(expression) created dbspace number 2 named dbspace2

    For admin, return status is an integer, which is kept in the cmd_ret_status field of thecommand_history table:

    EXECUTE FUNCTION admin('create dbspace', 'dbspace2', '/CHUNKS/dbspace2');(expression) 107

    IDS user interfaces

    IDS provides two user interfaces, namely dbaccess and the OpenAdmin Tool (OAT). This sectionof the tutorial provides a quick overview of these frontend tools.

    dbaccess

    The dbaccess utility provides quick and flexible access to the database engine. It can run in amenu driven mode or interactive mode. In addition, it can be used as part of a script.

    To run dbaccess, ensure that the following environment variables are set correctly:

    INFORMIXSERVER - Server name to be connected to INFORMIXDIR - Directory where IDS is installed PATH - The path which contains dbaccess INFORMIXSQLHOSTS - File describing connection information TERM - Code for terminal (for example, vt100) TERMCAP - Typically, the one supplied by database server in $INFORMIXDIR/etc/termcap

    Menu-driven interactive mode

    Let's first get an overall idea of the menu options available. Table 3 lists the available main menuoptions, which include their own sets of options:

    Table 3. dbaccess menu overview

    Main menu option Sub-option Action

    Query-language

    New Type new SQL statements in text editor.Run Execute current SQL statements.

    Modify Modify current SQL statements in SQL editor.

    Use-editor Switch to a system editor to enter or modifySQL statements.

    Output Send output from an SQL editor to printer, file,or page.

    Choose Choose and load a file to the text editor.

    Save Save SQL statements to a file.

  • 8/11/2019 Dm Ids Cert5557 PDF

    26/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 26 of 38

    Info Display an SQL statement from the database.

    Exit Return to the main menu or command line.

    Connection

    Connect Connect to a database server and select adatabase.

    Disconnect Disconnect from a database environment.

    Exit Return to the main menu or command line.

    Database

    Select Select a database.

    Create Create a database.

    Info Retrieve database information.

    Drop Delete an existing database.

    Close Close the current database.

    Exit Return to the main menu or command line.

    Table

    Create Create a table.

    Alter Alter a table.

    Drop Delete a table from the database.

    Info Display table information.

    Move Move a table from current database to another.

    Exit Return to the main menu or command line.

    Session n/a Describe the database server and hostcomputer.

    Exit n/a End database access.

    To start the menu-driven dbaccess, enter:

    dbaccess

    You will see the following screen:

    Figure 3. dbaccess - Query-language menu

    To traverse and highlight a different menu option, use the left or right arrow key. When the desiredmenu option is highlighted, use the Enter key to select it. Alternatively, you can key in the alphabetcapitalized in the menu option. For example, if you want to choose Database , simply key in d or D.

    After selecting Database, you then come to the following screen, which prompts the databaseaction to be carried out:

  • 8/11/2019 Dm Ids Cert5557 PDF

    27/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 27 of 38

    Figure 4. dbaccess select database

    If you choose Select , a list of databases will be shown, as Figure 5 illustrates:

    Figure 5. dbaccess database listing

    Use the down arrow key to traverse the list to the desired database. Optionally, you can key in thedatabase name. If you enter db1 , you will see the following screen:

    Figure 6. dbaccess database selected

    Take note of the following line:

    ----------------------- db1@ol_115fc3 ---------- Press CTRL-W for Help --------

    It shows that the database selected is db1 and the instance (or server) name is ol_115fc3.

    At this point, to go up one level in the menu, choose Exit to exit current menu level. You will get

    back to the top menu with the following screen:

    Figure 7. dbaccess - Main menu

    Choose Query-language . You will see the following screen:

  • 8/11/2019 Dm Ids Cert5557 PDF

    28/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 28 of 38

    Figure 8. dbaccess - SQL menu

    At this point, you have a list of SQL actions you can perform.

    As you are here for the first time, choose New :

    Figure 9. dbaccess - SQL entry

    Key in the SQL statement that you want, and press the Esc key when done:

    Figure 10. dbaccess - Run SQL

    As "Run" is highlighted, pressing the Enter key will give you the SQL result as below:

    Figure 11. dbaccess - Run SQL result

    If you want to modify it, there are two ways to do so. If you chose the Modify option, it will bringyou back to screen similar to when you choose New , but this time with the SQL statement you justran. You can also use the option Use-editor to modify the query. In UNIX, the editor will default tovi and on Windows to Notepad. Using a text editor provides you a faster way to change the SQL.When modification is completed in the editor, remember to save and exit, and it will bring you backto the dbaccess screen with the changed SQL.

    The dbaccess utility is able to display table information. If you go back to the main menu againand select the Table option followed by Info menu option, a list of tables in the database will bedisplayed. Let's say table t1 is chosen, as illustrate in Figure 12:

  • 8/11/2019 Dm Ids Cert5557 PDF

    29/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 29 of 38

    Figure 12. dbaccess - Table information

    From here, you can display table information such as column detail, indexes, fragmentation, andso on.

    Interactive non-menu modeTo run the dbaccess in this mode, simply use the following command:

    $ dbaccess db1 -

    Database selected.

    You will get a ">" prompt. Issue the SQL and end it with a semicolon. Press Enter to run the SQL:Listing 23. Run the SQL> select * from t1;

    c1

    1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

    20 row(s) retrieved.

    Send the interrupt key. (The key combination for interrupt is usually Ctrl+C, but it depends on yourterminal I/O options. Use stty -a to check your setting for interrupt.)

    You can run a UNIX command in this mode simply by placing an exclamation point (!) before thecommand.

    Batch command input in UNIXYou can pipe SQL into the dbaccess utility as follows:

  • 8/11/2019 Dm Ids Cert5557 PDF

    30/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 30 of 38

    Listing 24. Pipe SQL into the dbaccess utility$ echo "select * from t2" | dbaccess db1

    Database selected.

    c1

    1 2

    2 row(s) retrieved.

    Database closed.

    You can also run it in batch command input in UNIX, like this:

    $ dbaccess db1 When the prompt is returned, enter the desired SQL statements, separated by a semicolon. When

    ready to run, enter the exclamation point (!), as in Listing 25:

    Listing 25. Enter and run SQL statements> select * from t1;> !

    Database selected.

    c1

    1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9

    10

    20 row(s) retrieved.

    It is possible to place a list of SQL statements in a command file and run them from dbaccess.

    For example, let's say you have a command file name mytest.sql with the following SQLstatements:

    update t1 set c1=20;select * from t1;

  • 8/11/2019 Dm Ids Cert5557 PDF

    31/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 31 of 38

    To run it, follow the commands in Listing 26:

    Listing 26. Run SQL statements from dbaccess$ dbaccess db1 mytest.sql

    Output:

    Database selected.

    20 row(s) updated.

    c1

    20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

    20

    20 row(s) retrieved.

    Database closed.

    OpenAdmin Tool for IDSOpenAdmin Tool for IDS (OAT) is a PHP-based browser application that allows you to managemultiple IDS instances across different geographical locations. With the use of SQL Admin APIand sysmaster database information, OAT is able to monitor and carry all the monitoring and

    administrative tasks on remote IDS instances.It allows (but is not limited to) the following tasks:

    1. Space administration on dbspace, chunks, physical log, and logical logs2. Server administration on onconfig parameters3. Enterprise replication administration4. Performance analysis5. SQL Toolbox, which allows viewing of database objects and executing SQL statements6. Managing Task Scheduler

  • 8/11/2019 Dm Ids Cert5557 PDF

    32/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 32 of 38

    OAT is an open-source project, and thus allows users the possibility to expand its functionality ifrequired. It can be downloaded free of charge (see Resources .)

    Install and configure OAT

    After downloading OAT, run the installer.

    On the login screen, enter the appropriate server details:

    Figure 13. OAT login screen

    You can get a visual of the geographical distribution of the various instances and their statusesif you entered the latitude and longitude information. All of this is available in one shot in yourfavorite browser.

    Figure 14. OAT Health Center

  • 8/11/2019 Dm Ids Cert5557 PDF

    33/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 33 of 38

    On the left pane, you will see the options for functionalities the tool provides, namely:

    1. Health Check - gives a list of alerts to DBA and a dashboard for resources (in other words,cpu, lock) usage

    2. Logs - logs content for Admin API, IDS, and OnBar activities

    3. Task Scheduler - provides information for setup and execution details of Task Scheduler4. Space Administration - disk space management5. Server Administration - includes setup for MACH, configuration for IDS, virtual processor

    management, and Auto Update Statistics Information6. Enterprise Replication - Enterprise Replication management7. Performance Analysis - allows you to specify reports on various resources or SQL, and

    monitor current sessions and their details8. SQL Toolbox - includes a schema browser to view the schema of the database object and

    also a SQL Editor for running SQL statement to be run

    Choosing the Space Administration , you will see the following:

    Figure 15. OAT space management

    On this page, you can manage dbspace and chunks.

    If you click on one of the dbspace, the following page will be loaded, which gives details of thatdbspace:

  • 8/11/2019 Dm Ids Cert5557 PDF

    34/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 34 of 38

    Figure 16. OAT dbspace detail

    The SQL Explorer shows the details of the SQL statement executed when you enable tracing:

    Figure 17. OAT SQL detail

    This screen gives us a summary of the SELECT , UPDATE, DELETE , and INSERT operations.

    You can drill into each SQL for its detailed, as illustrated in Figures 18 -20:

  • 8/11/2019 Dm Ids Cert5557 PDF

    35/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 35 of 38

    Figure 18. OAT SQL detail

    Figure 19. OAT SQL detail

  • 8/11/2019 Dm Ids Cert5557 PDF

    36/38

    developerWorks ibm.com/developerWorks/

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 36 of 38

    Figure 20. OAT SQL detail

    Conclusion

    This tutorial has introduced the various tools and utilities that are available with IDS to easeadministration tasks. At the end of this tutorial, you should be able to:

    Use oninit and onmode utilities to change the mode of the database server Use onstat to monitor the database server Use the available data movement utilities to move database objects and data between

    databases Describe functionality of sysadmin database and SQL Admin API Demonstrate knowledge of the features available in dbaccess and OAT

  • 8/11/2019 Dm Ids Cert5557 PDF

    37/38

    ibm.com/developerWorks/ developerWorks

    Informix Dynamic Server 11.50 Fundamentals Exam 555certification preparation, Part 7: Tools and utilities Page 37 of 38

    Resources

    Learn

    developerWorks Informix zone : Get the resources you need to advance your skills in the

    Informix arena. "The IDS Detective Game " (developerWorks, April 2008): Learn or teach the basics of

    Informix Dynamic Server (IDS) and relational databases with an interactive game called "TheIDS Detective Game".

    IDS roadmap for administrators, developers, and end users : Find resources for all aspects ofIDSplanning, installing, configuring, administering, tuning, monitoring, and more.

    Informix Education Training Path : See the courses you need to take to achieve particularskills or certification.

    Informix library : Learn more details about IDS from the online manuals or the IDS InformationCenter.

    IBM Informix Dynamic Server 11.50 Information Center : Find information that you need to usethe IDS family of products and features. developerWorks Information Management zone : Learn more about Information Management.

    Find technical documentation, how-to articles, education, downloads, product information,and m ore.

    Stay current with developerWorks technical event s a nd webcasts .

    Get products and technologies

    Informix Dynamic Server Express Edition : Download a trial version of Informix DynamicServer Express Edition to get started with IDS.

    Informix Dynamic Server Enterprise and Developer Edition : Download a free trial version ofInformix Dynamic Server Enterprise or Developer Edition.

    OpenAdmin Tool for IDS (OAT) : Download OAT. Download IBM product evaluation versions or explore the online trials in the IBM SOA

    Sandbox , and get your hands on application development tools and middleware productsfrom DB2, Lotus, Rational, Tivoli, and WebSphere.

    Discuss

    Participate in the discussion forum for this content. IDS Experts Blog : Read the technical notes on Informix Dynamic Server from a worldwide

    team of Development and Technical Support engineers. Participate in developerWorks blogs and get involved in the My developerWorks community ;

    with your personal profile and custom home page, you can tailor developerWorks to yourinterests and interact with other developerWorks users.

    http://www.ibm.com/developerworks/downloads/soasandbox/http://www.ibm.com/developerworks/downloads/http://www.ibm.com/developerworks/downloads/soasandbox/http://www.ibm.com/developerworks/downloads/soasandbox/http://www.ibm.com/developerworks/offers/techbriefings/http://www.ibm.com/developerworks/offers/techbriefings/http://www.ibm.com/developerworks/offers/techbriefings/http://www.ibm.com/developerworks/communityhttp://www.ibm.com/developerworks/blogs/http://www.ibm.com/developerworks/blogs/page/idsteam/http://www.ibm.com/developerworks/forums/forum.jspa?forumID=548http://www.ibm.com/developerworks/downloads/soasandbox/http://www.ibm.com/developerworks/downloads/soasandbox/http://www.ibm.com/developerworks/downloads/http://www.openadmintool.org/http://www.ibm.com/developerworks/downloads/im/ids/learn.htmlhttp://www.ibm.com/developerworks/downloads/im/dsexp/learn.htmlhttp://www.ibm.com/developerworks/offers/techbriefings/http://www.ibm.com/developerworks/data/http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsphttp://www.ibm.com/software/data/informix/pubs/library/http://www-304.ibm.com/jct03001c/services/learning/ites.wss/us/en?pageType=page&c=a0000489http://www.ibm.com/developerworks/data/roadmaps/roadmap_ids.htmlhttp://www.ibm.com/developerworks/edu/dm-dw-dm-0804moffatt-i.htmlhttp://www.ibm.com/developerworks/data/products/informix/
  • 8/11/2019 Dm Ids Cert5557 PDF

    38/38

    developerWorks ibm.com/developerWorks/

    About the author

    Joo Guan Yap

    Joo Guan graduated from Nanyang University of Singapore with a Bachelor ofApplied Science (Computer engineering) Degree in 1996 and was involved in variousIT development projects. He joined IBM Informix support in 2001 and is now involvedin Advanced Support work.

    Copyright IBM Corporation 2009(www.ibm.com/legal/copytrade.shtml)Trademarks(www.ibm.com/developerworks/ibm/trademarks/)

    http://www.ibm.com/developerworks/ibm/trademarks/http://www.ibm.com/legal/copytrade.shtml