Kate Tomchik The Home Depot, USA International Informix Users Group Board Of Directors Friday, December 8, 2006 • 16:20 p....
Unix DBA Cross Training Informix and DB2 Informix to DB2 and back again If you know one of these, learn how to get around ...
Why I became a DB2 DBA…
What Informix instances are running? <ul><li>/>cd /INFORMIXTMP </li></ul><ul><li>/INFORMIXTMP> ls -l VP* </li></ul><ul><li...
What Informix instances are running? <ul><li>See main PID of each instance running: </li></ul><ul><li>ps -ef | grep oninit...
What DB2 Instances are running? <ul><ul><li>> db2ilist   #-- not always set up </li></ul></ul><ul><ul><li>calvin:/opt/hd/d...
Typical Informix processes <ul><li>>ps –fu informix </li></ul>informix 10977 10976  0  Mar  7  ?  2:01 oninit informix 109...
Typical DB2 processes <ul><li>calvin: /home/kate> ps -fu infi11 | grep db2  </li></ul><ul><li>in11  647364  876768  0  Jul...
Kate’s First rule of DBA support <ul><li>When user calls with a problem verify the database is up. </li></ul><ul><li>If no...
Start the Informix Instance <ul><li>>su – informix; oninit -v  # --- Informix </li></ul><ul><li>hobbes: /users/informix> o...
Start the DB2 Instance <ul><li>>su – {instance}; db2start  </li></ul><ul><li>#--- db2 {run as id of instance} </li></ul><u...
Start DB2 Instance (processes) <ul><li>calvin: /opt/hd/db/db2/instance/in60> ps -fu in60 </li></ul><ul><li>UID  PID  PPID ...
Stop an Informix Instance <ul><li>> onmode -k  # --- in informix </li></ul>hobbes: /users/informix> onmode -k This will ta...
Stop a DB2 Instance <ul><li>>db2stop [force]  # --- run as userid of instance, force detaches users </li></ul><ul><li>calv...
Db2_kill  <ul><li>> db2_kill  # db2 utility </li></ul><ul><li>calvin: /opt/hd/db/db2/instance/in60> db2_kill </li></ul><ul...
Hard Kill an Instance (dangerous) <ul><li>Informix: </li></ul><ul><li>> ps -ef | grep oninit  # --- find #1 owned process ...
Kate’s 2 nd  Rule of DBA Support <ul><li>If one user is stopping 100 users from getting to their tables, that user must di...
Kill a user attachment in Informix <ul><li>> onstat –u  {Identify correct sessionid} </li></ul><ul><li>> onmode –z {SSID} ...
Kill a user attachment in DB2 <ul><li>db2 connect to  {database} </li></ul><ul><li>db2 list applications show detail </li>...
Kill a user attachment in DB2  Example <ul><li>> db2 list applications show detail  </li></ul><ul><li>Auth Id  Application...
Kate’s 3 rd  Rule : Check the Error logs – DB2 <ul><li>>{db2 path}sqllib/db2dump/db2diag.log </li></ul><ul><li>calvin:/opt...
inis32.nfy (v8 file) <ul><li>Typical Entries: </li></ul><ul><li>ADM7514W  Database manager has stopped. </li></ul><ul><li>...
Db2diag.log – Typical Entries <ul><li>2005-08-02-15.01.16.014367  Instance:in32  Node:000 </li></ul><ul><li>PID:2318574(db...
Logfiles - Informix <ul><li>> onstat –c | grep MSGPATH </li></ul><ul><li># could be named anything.  </li></ul><ul><li>> v...
Example Log File - Informix <ul><li>Sun Jun 11 07:20:02 2006 </li></ul><ul><li>07:20:02  Checkpoint Completed:  duration w...
Kate’s last support law: Call IBM when first two laws don’t find the issue   <ul><li>IBM support calls create PMRs {Proble...
DB2 Version and Fixpak <ul><li>> su - in11  # enter password </li></ul><ul><li>> db2level </li></ul><ul><li>calvin:/opt/hd...
Informix Version <ul><li>> onstat – </li></ul><ul><li>hobbes:/home/informix> onstat -  </li></ul><ul><li>Informix Dynamic ...
View the Configuration Files <ul><li>Informix: </li></ul><ul><li>>view $INFORMIXDIR/etc/onconfig </li></ul><ul><li># chang...
DB2 Environment Variables (some) <ul><li>calvin:> db2set -all </li></ul><ul><li>[i] DB2COMM=tcpip </li></ul><ul><li>[i] DB...
Informix Environment Variables (some) <ul><li>> onstat –g env </li></ul><ul><li>INFORMIXDIR  /usr/informix </li></ul><ul><...
Schema of the Database <ul><li>DB2 Database Schema (remember alex): </li></ul><ul><li>>db2look –d {database} –a –l –e –x –...
Get Databases for an Instance   <ul><li>Must run as the instance owner: </li></ul><ul><li>> db2 &quot;list db directory&qu...
Database Connection State <ul><li>> db2 &quot;get connection state&quot; </li></ul><ul><li>Database Connection State </li>...
Connect to a Database <ul><li>INFORMIX </li></ul><ul><li>>  dbaccess {database} {command.sql} </li></ul><ul><li>Gives erro...
Statistics for a table – DB2 <ul><li>DB2 statistics is runstats (see IBM documentation  Command Reference  for full detail...
Statistics for table - Informix <ul><li>Update statistics commands (see documentation for full command ) using SQL file to...
Current path of Instance <ul><li>Not  similar to >echo $INFORMIXDIR  </li></ul><ul><li>Since DB2 instance path does not sh...
Some parameters in the DBM <ul><li>Database Manager Configuration </li></ul><ul><li>Node type = Enterprise Server Edition ...
Backup a Database – DB2 <ul><li>Db2 “backup db {database} {online} {incremental} use {backup mgr} </li></ul><ul><li>Multip...
Backup a Database - Informix <ul><li>To a tape drive: </li></ul><ul><li>>ontape –s  </li></ul><ul><li>(at prompt, enter le...
Get list of past backups <ul><li>> db2 list history backup all for {database} </li></ul><ul><li>Op Obj Timestamp+Sequence ...
Get list of last backup - Informix <ul><li>>onstat –g arc </li></ul><ul><li>hobbes:/users/informix> onstat -g arc </li></u...
Check quality of the backup – DB2 <ul><li>Checksum: </li></ul><ul><li>Db2adutl verify full taken at {datetime} db {databas...
Restore Database – DB2 <ul><li>Db2 “restore database {database} use {ex: tsm} taken at {date/time} </li></ul><ul><li>NOTE:...
Example Restore – DB2 <ul><li>Get last good backup date/time: </li></ul><ul><li>>db2 list history backup all for db010 </l...
Restore Informix database <ul><li>>onbar –r [ dbspaces list] </li></ul><ul><li>-or- </li></ul><ul><li>>ontape -r </li></ul>
Run SQL Against a Table – DB2 <ul><li>db2 connect to {database} </li></ul><ul><li>db2 “select * from {table-name}” </li></...
External SQL File – DB2 <ul><li>Create a file that contains each SQL command separated by a “;” </li></ul><ul><li>calvin: ...
External SQL file - Informix <ul><li>>cat file.sql </li></ul><ul><li>select count(*) from errorlog </li></ul><ul><li>>dbac...
Tables space info – DB2 <ul><li>db2 “list tablespaces” </li></ul><ul><li>Tablespaces for Current Database </li></ul><ul><l...
Tablespace info – DB2 <ul><li>User created tablespace: </li></ul><ul><li>Tablespace ID  = 3 </li></ul><ul><li>Name  = PR00...
Tablespace Detailed info – DB2 <ul><li>> db2 “list tablespaces show detail” | more </li></ul><ul><li>Tablespace ID  = 3 </...
Tablespace info - Informix <ul><li>>onstat –d </li></ul><ul><li>hobbes: /home/kate> onstat -d </li></ul><ul><li>Informix D...
Add disk space – DB2 <ul><li>Expand the containers for a tablespace. </li></ul><ul><li>>alter tablespace {tbspacename} ext...
Add Disk Space - Informix <ul><li>>onspaces –a {spacename} –p {pathname} –o {offset} –s {size in kb NOT pages} </li></ul><...
Get Stored Procedure SQL – DB2 <ul><li>Db2 “export to {filename} of del select text from syscat.procedures where procname=...
Stored Procedure SQL - Informix <ul><li>Dbschema –d db001 –f all </li></ul><ul><li>DBSCHEMA Schema Utility  INFORMIX-SQL V...
Instance Creation – DB2 <ul><li>You must have root access to create </li></ul><ul><li>You must have user ids created for e...
Instance Creation – Informix <ul><li># must be informix to create </li></ul><ul><li>export ONCONFIG=in01 </li></ul><ul><li...
Some Important System Tables – DB2 <ul><li>Prefix with owner/schema  “syscat” </li></ul><ul><li>Syscat.Tables </li></ul><u...
Important system tables - Informix <ul><li>“ informix”.systables </li></ul><ul><li>“ informix”.sysindexes </li></ul><ul><l...
RTFM – Where to find the manuals <ul><li>INFORMIX: </li></ul><ul><li>www.iiug.org  – has everything!! Content added daily....
Performance Tuning <ul><li>Clearly, there are numerous sessions at this conference with suggestions for performance tuning...
Answer… <ul><li>Increase memory to database (i.e. add buffers). </li></ul>
Informix Performance Tuning for Beginners <ul><li>ADD BUFFERS: </li></ul><ul><li>vi onconfig  </li></ul><ul><li># increase...
DB2 Performance Tuning for Beginners <ul><li>ADD BUFFERS: </li></ul><ul><li>Db2 “select bpname, npages, pagesize from sysc...
Monitoring Environment <ul><li>Informix – Check out all the onstat functions </li></ul><ul><li>Onstat --  # double dash di...
Name one DB2 feature I would like to see in Informix… <ul><li>AUTOCONFIGURE!! </li></ul><ul><li>To use (example): </li></u...
Name one Informix feature I would like to see in DB2… <ul><li>This is personal preference, but I LOVE the fact that when y...
To Advanced beyond Beginner Status <ul><li>Recommendation: Take a class if you need to work in a new language (sorry, this...
Why conferences are important..
Kate Tomchik <ul><li>The Home Depot, Lead DBA </li></ul><ul><li>International Informix Users Group </li></ul><ul><li>Board...
Upcoming SlideShare
Loading in...5
×

Slide 1 - International Informix Users Group

1,741

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,741
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Db2sysc is the main process. One exists for each DB2 instance running.
  • In earlier versions, the db2level would only show the initial version installed on the box (i.e 7 and before). So, if you installed 7 Fixpack 2, then patched it to Fixpack 5, it would still show two in the db2level output.
  • Note: bug in 8.1 FP 12 does not allow the “l” (el)
  • DIAGLEVEL, NOTIFYLEVEL Value from 1 to 10 that instructs the engine on the severity of errors to log in the db2diag.log and the {instance}.nfy files. DIAGPATH, DFTDBPATH Show directory names for the error logging and the database files MAXAGENTS User connection limits SVCENAME Name as listed in the /etc/services file for this port. (Similar to sqlhosts file entries for Informix)
  • Slide 1 - International Informix Users Group

    1. 1. Kate Tomchik The Home Depot, USA International Informix Users Group Board Of Directors Friday, December 8, 2006 • 16:20 p.m. – 17:30 p.m. Platform: Unix Unix DBA Cross Training Informix and DB2
    2. 2. Unix DBA Cross Training Informix and DB2 Informix to DB2 and back again If you know one of these, learn how to get around in the other.
    3. 3. Why I became a DB2 DBA…
    4. 4. What Informix instances are running? <ul><li>/>cd /INFORMIXTMP </li></ul><ul><li>/INFORMIXTMP> ls -l VP* </li></ul><ul><li>srwxrwxrwx 1 root informix 0 Jul 28 2005 VP.in02.0101s </li></ul><ul><li>srwxrwxrwx 1 root informix 0 Jul 28 2005 VP.in02.0301s </li></ul><ul><li>srwxrwxrwx 1 root informix 0 Jul 28 2005 VP.in51.0101s </li></ul><ul><li>Each name after the VP. is a instance name. This lists two, in02 and in51. in02 has two TCP/IP socket names, so therefore is has two names listed in the directory. </li></ul>
    5. 5. What Informix instances are running? <ul><li>See main PID of each instance running: </li></ul><ul><li>ps -ef | grep oninit | grep &quot; 1 &quot; </li></ul><ul><li>informix 1927 1 0 Jul 28 ? 243:26 oninit </li></ul><ul><li>informix 1492 1 0 Jul 28 ? 803:06 oninit </li></ul>
    6. 6. What DB2 Instances are running? <ul><ul><li>> db2ilist #-- not always set up </li></ul></ul><ul><ul><li>calvin:/opt/hd/db/db2/instance/in11> db2ilist </li></ul></ul><ul><ul><li>in32 </li></ul></ul><ul><ul><li>in33 </li></ul></ul><ul><ul><li>in11 </li></ul></ul><ul><li>> # This shows active instances: </li></ul><ul><li>> ps -ef | grep db2sysc | grep -v grep </li></ul><ul><li>calvin: /home/lkt01> ps -ef | grep db2sysc | grep -v grep </li></ul><ul><li>in11 876768 917730 0 Jul 27 - 0:09 db2sysc 0 </li></ul><ul><li>in33 1056790 1392730 0 Jul 27 - 0:09 db2sysc 0 </li></ul><ul><li>in32 1933360 2170886 0 Aug 12 - 0:01 db2sysc 0 </li></ul>
    7. 7. Typical Informix processes <ul><li>>ps –fu informix </li></ul>informix 10977 10976 0 Mar 7 ? 2:01 oninit informix 10998 10977 0 Mar 7 ? 0:25 oninit informix 10993 10977 0 Mar 7 ? 0:26 oninit informix 10984 10977 0 Mar 7 ? 0:27 oninit informix 11011 10977 0 Mar 7 ? 0:24 oninit informix 11009 10977 0 Mar 7 ? 0:27 oninit informix 11018 10977 0 Mar 7 ? 0:24 oninit informix 10981 10977 0 Mar 7 ? 0:27 oninit informix 11005 10977 0 Mar 7 ? 0:25 oninit informix 11017 10977 0 Mar 7 ? 0:25 oninit informix 10999 10977 0 Mar 7 ? 0:25 oninit informix 10976 1 0 Mar 7 ? 1:56 oninit informix 11019 10977 0 Mar 7 ? 0:24 oninit informix 10990 10977 0 Mar 7 ? 0:27 oninit informix 11004 10977 0 Mar 7 ? 0:26 oninit
    8. 8. Typical DB2 processes <ul><li>calvin: /home/kate> ps -fu infi11 | grep db2 </li></ul><ul><li>in11 647364 876768 0 Jul 27 - 0:36 db2gds 0 </li></ul><ul><li>in11 786632 876768 0 Jul 27 - 0:04 db2ipccm 0 </li></ul><ul><li>in11 811222 647364 0 Aug 13 - 0:04 db2dlock (DB014) 0 </li></ul><ul><li>in11 876768 917730 0 Jul 27 - 0:09 db2sysc 0 </li></ul><ul><li>in11 901346 876768 0 Jul 27 - 0:00 db2syslog 0 </li></ul><ul><li>in11 934120 647364 0 Jul 27 - 0:00 db2srvlst 0 </li></ul><ul><li>in11 983280 876768 0 Jul 27 - 0:00 db2tcpcm 0 </li></ul><ul><li>in11 999672 876768 0 Jul 27 - 0:00 db2resync 0 </li></ul><ul><li>in11 1016056 876768 0 Jul 27 - 0:00 db2spmrsy 0 </li></ul><ul><li>in11 1040638 647364 0 Jul 27 - 0:00 db2spmlw 0 </li></ul><ul><li>in11 1261798 647364 0 Aug 13 - 0:06 db2loggw (DB014) 0 </li></ul><ul><li>in11 1327176 786632 0 Jul 27 - 2:42 db2agent (instance) 0 </li></ul><ul><li>in11 1491052 647364 0 Jul 27 - 0:02 db2cart 0 </li></ul><ul><li>in11 1556610 647364 0 Jul 27 - 1:19 db2agent (DB014) 0 </li></ul><ul><li>in11 1564804 647364 0 Jul 27 - 0:03 db2agent (idle) 0 </li></ul><ul><li>in11 1753190 647364 0 Aug 13 - 0:00 db2pfchr 0 </li></ul><ul><li>in11 1884196 647364 0 Aug 13 - 0:00 db2event DB2DETAILDEADLOCK) 0 </li></ul><ul><li>in11 2015258 647364 0 Aug 13 - 0:00 db2pfchr 0 </li></ul><ul><li>in11 2023660 647364 0 Aug 13 - 0:00 db2loggr (DB014) 0 </li></ul><ul><li>in11 2433208 647364 0 Aug 13 - 0:00 db2pclnr 0 </li></ul>
    9. 9. Kate’s First rule of DBA support <ul><li>When user calls with a problem verify the database is up. </li></ul><ul><li>If not up, restart it. </li></ul><ul><li>If it is up, try bouncing it anyway.  </li></ul>
    10. 10. Start the Informix Instance <ul><li>>su – informix; oninit -v # --- Informix </li></ul><ul><li>hobbes: /users/informix> oninit -v </li></ul><ul><li>Checking group membership to determine server run modesucceeded </li></ul><ul><li>Reading configuration file '/opt/isv/informix/etc/in51'...succeeded </li></ul><ul><li>Creating /INFORMIXTMP/.infxdirs ... succeeded </li></ul><ul><li>Creating infos file &quot;/opt/isv/informix/etc/.infos.in51&quot; ... &quot;/opt/isv/informix/etc/.conf.in51&quot; ... succeeded </li></ul><ul><li>… (lots more good stuff) </li></ul><ul><li>Checking location of physical log...succeeded </li></ul><ul><li>Initializing dataskip structure...succeeded </li></ul><ul><li>Checking for temporary tables to drop </li></ul><ul><li>Forking onmode_mon thread...succeeded </li></ul><ul><li>Verbose output complete: mode = 5 </li></ul>
    11. 11. Start the DB2 Instance <ul><li>>su – {instance}; db2start </li></ul><ul><li>#--- db2 {run as id of instance} </li></ul><ul><li>calvin: /opt/hd/db/db2/> su – in60 </li></ul><ul><li>calvin: /opt/instance/in60> db2start </li></ul><ul><li>08-16-2005 13:28:17 0 0 SQL1063N DB2START processing was successful. </li></ul><ul><li>SQL1063N DB2START processing was successful. </li></ul>
    12. 12. Start DB2 Instance (processes) <ul><li>calvin: /opt/hd/db/db2/instance/in60> ps -fu in60 </li></ul><ul><li>UID PID PPID C STIME TTY TIME CMD </li></ul><ul><li>in60 1335306 7127088 0 13:28:16 - 0:00 db2ipccm 0 </li></ul><ul><li>in60 1687694 7192802 0 13:18:55 pts/0 0:00 -ksh </li></ul><ul><li>in60 1695826 4866232 0 13:28:17 - 0:00 db2srvlst 0 </li></ul><ul><li>in60 2252828 7127088 0 13:28:17 - 0:00 db2spmrm 0 </li></ul><ul><li>in60 3645576 4866232 0 13:28:17 - 0:00 db2resyn 0 </li></ul><ul><li>in60 4530428 1687694 1 13:28:24 pts/0 0:00 ps -fu in60 </li></ul><ul><li>in60 4603946 7127088 0 13:28:16 - 0:00 db2tcpcm 0 </li></ul><ul><li>in60 4628634 7127088 0 13:28:16 - 0:00 db2tcpcm 0 </li></ul><ul><li>in60 4866232 7127088 0 13:28:16 - 0:00 db2gds 0 </li></ul><ul><li>in60 6955014 4866232 0 13:28:17 - 0:00 db2spmlw 0 </li></ul><ul><li>in60 7127088 4997122 0 13:28:16 - 0:00 db2sysc 0 </li></ul>
    13. 13. Stop an Informix Instance <ul><li>> onmode -k # --- in informix </li></ul>hobbes: /users/informix> onmode -k This will take IBM Informix Dynamic Server OFF-LINE - Do you wish to continue (y/n)? y There are 1 user threads that will be killed. Do you wish to continue (y/n)? Y Hobbes: /users/informix> ps –fu informix informix 11417 10291 1 10:48:57 pts/0 0:00 ps -fu informix informix 10291 10289 1 10:43:45 pts/0 0:00 -ksh
    14. 14. Stop a DB2 Instance <ul><li>>db2stop [force] # --- run as userid of instance, force detaches users </li></ul><ul><li>calvin: /opt/hd/db/db2/instance/in60 </li></ul><ul><li>> db2stop force </li></ul><ul><li>08-16-2005 13:22:17 0 0 SQL1064N DB2STOP processing was successful. </li></ul><ul><li>SQL1064N DB2STOP processing was successful. </li></ul><ul><li>> ps -fu in60 </li></ul><ul><li>UID PID PPID C STIME TTY TIME CMD </li></ul><ul><li>in60 1687694 7192802 0 13:18:55 pts/0 0:00 -ksh </li></ul><ul><li>in60 4538434 1687694 1 13:27:02 pts/0 0:00 ps –fu in60 </li></ul>
    15. 15. Db2_kill <ul><li>> db2_kill # db2 utility </li></ul><ul><li>calvin: /opt/hd/db/db2/instance/in60> db2_kill </li></ul><ul><li>calvin: ipclean: Removing DB2 engine and client's IPC resources for in60. </li></ul><ul><li>calvin: db2_kill [] completed ok </li></ul><ul><li>NOTE: It is a good practice to run db2_kill after every running of db2stop to clean up any shared memory segments prior to a db2 restart. </li></ul><ul><li>Be aware that db2_kill of any flavor should be a last resort for your method of stopping the instance (using it instead of db2stop), because if any process holds data - you may lose or corrupt the data. </li></ul>
    16. 16. Hard Kill an Instance (dangerous) <ul><li>Informix: </li></ul><ul><li>> ps -ef | grep oninit # --- find #1 owned process </li></ul><ul><li>> kill -9 {PID} </li></ul><ul><li>DB2: </li></ul><ul><li>> ps -ef | grep db2sysc {0} # --- 0 process for multiprocessor engine </li></ul><ul><li>kill -9 {PID} </li></ul><ul><li># May need to kill each node’s parent process when not a single node env </li></ul>
    17. 17. Kate’s 2 nd Rule of DBA Support <ul><li>If one user is stopping 100 users from getting to their tables, that user must die. </li></ul><ul><li>(Of course, I only mean the offending process) </li></ul>
    18. 18. Kill a user attachment in Informix <ul><li>> onstat –u {Identify correct sessionid} </li></ul><ul><li>> onmode –z {SSID} </li></ul><ul><li>hobbes:/users/informix> onstat –u | grep sally </li></ul><ul><li>address flags sessid user tty wait tout locks </li></ul><ul><li>e4ccdc78 Y--P--- 819941 sally ttyp3 e533a800 0 999,998 </li></ul><ul><li>nreads nwrites </li></ul><ul><li>999,998 1 </li></ul><ul><li>hobbes:/users/informix> onmode –z 819941 </li></ul>
    19. 19. Kill a user attachment in DB2 <ul><li>db2 connect to {database} </li></ul><ul><li>db2 list applications show detail </li></ul><ul><li># identify bad process and get the Appl. Handle & Coordinator PID/Thread. </li></ul><ul><li>db2 “force application (AH)” </li></ul><ul><li>NOTE: you really need the quotes and () </li></ul>
    20. 20. Kill a user attachment in DB2 Example <ul><li>> db2 list applications show detail </li></ul><ul><li>Auth Id Application Appl. Application Id </li></ul><ul><li>Handle </li></ul><ul><li>IN60 db2bp 471 *LOCAL.in60.060606150430 </li></ul><ul><li>> db2 &quot;force application (471)&quot; </li></ul><ul><li>DB20000I The FORCE APPLICATION command completed successfully. </li></ul><ul><li>DB21024I This command is asynchronous and may not be effective immediately. </li></ul>
    21. 21. Kate’s 3 rd Rule : Check the Error logs – DB2 <ul><li>>{db2 path}sqllib/db2dump/db2diag.log </li></ul><ul><li>calvin:/opt/hd/db/db2/instance/in11/sqllib/db2dump>ls -l </li></ul><ul><li>-rw-rw-rw- 1 in11 sysadm 4821 Jul 27 07:46 in11.nfy </li></ul><ul><li>-rw-rw-rw- 1 in11 sysadm 46803 Jul 27 12:04 db2diag.log </li></ul><ul><li>-rw-r----- 1 in11 sysadm 5242044 Jul 27 07:36 db2eventlog.000 </li></ul><ul><li>db2diag.log – main log of database activity </li></ul><ul><li>in11.nfy - contains notifications based on NOTIFY level </li></ul><ul><li>db2eventlog.000 - similar to /tmp/af files of IFX since they are created during database errors, but these are not readable. Send to IBM when opening a PMR. </li></ul>
    22. 22. inis32.nfy (v8 file) <ul><li>Typical Entries: </li></ul><ul><li>ADM7514W Database manager has stopped. </li></ul><ul><li>2005-11-02-18.57.12.883227 Instance:in32 Node:000 </li></ul><ul><li>PID:573572(db2star2) TID:1 Appid:none </li></ul><ul><li>base sys utilities startdbm Probe:911 </li></ul><ul><li>ADM7513W Database manager has started. </li></ul><ul><li>2005-11-02-13.12.15.570194 Instance:in32 Node:000 </li></ul><ul><li>PID:2457760(db2agent (CQMASTR2) 0) TID:1 Appid:*LOCAL.in32.0800F2181219 </li></ul><ul><li>database monitor sqm.evmgr::log_ev_err Probe:2 Database:db036 </li></ul><ul><li>ADM2004E The Event Monitor &quot;DB2DETAILDEADLOCK&quot; was not activated because there was not enough storage space in the database monitor heap. To remedy this problem, increase the MON_HEAP_SZ DBM configuration parameter and restart the instance. </li></ul>
    23. 23. Db2diag.log – Typical Entries <ul><li>2005-08-02-15.01.16.014367 Instance:in32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DB033) 0) TID:1 Appid:*LOCAL.in32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:0 Database:DB033 </li></ul><ul><li>Starting a full database backup. </li></ul><ul><li>2005-08-02-15.01.53.519377 Instance:in32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DB033) 0) TID:1 Appid:*LOCAL.in32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:128 Database:DB033 </li></ul><ul><li>Estimated size of backup in bytes: </li></ul><ul><li>0x0FFFFFFFFFFF5008 : 0x0000000008489000 .....H.. </li></ul><ul><li>2005-08-02-15.01.53.524680 Instance:in32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DB033) 0) TID:1 Appid:*LOCAL.in32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:128 Database:DB033 </li></ul><ul><li>Actual size of backup in bytes: </li></ul><ul><li>0x0FFFFFFFFFFF5010 : 0x0000000008405000 [email_address] </li></ul><ul><li>2005-08-02-15.01.53.529787 Instance:in32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DB033) 0) TID:1 Appid:*LOCAL.in32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:130 Database:DB033 </li></ul><ul><li>Backup Complete. </li></ul>
    24. 24. Logfiles - Informix <ul><li>> onstat –c | grep MSGPATH </li></ul><ul><li># could be named anything. </li></ul><ul><li>> view {MSGPATH} </li></ul><ul><li>hobbes: /usr/informix/bin> onstat -c | grep MSGPATH </li></ul><ul><li>MSGPATH /usr/informix/in07.log </li></ul>
    25. 25. Example Log File - Informix <ul><li>Sun Jun 11 07:20:02 2006 </li></ul><ul><li>07:20:02 Checkpoint Completed: duration was 0 seconds. </li></ul><ul><li>07:20:02 Checkpoint loguniq 205864, logpos 0x4018, timestamp: 0x5bc1aa47 </li></ul><ul><li>07:20:02 Maximum server connections 2 </li></ul><ul><li>07:20:03 Level 0 Archive started on r001, l001, d002, d003, d004, i001, i003, i004 </li></ul><ul><li>07:30:10 Checkpoint Completed: duration was 0 seconds. </li></ul><ul><li>07:30:10 Checkpoint loguniq 205864, logpos 0xc018, timestamp: 0x5bc1ae99 </li></ul><ul><li>07:30:10 Maximum server connections 2 </li></ul><ul><li>07:40:16 Fuzzy Checkpoint Completed: duration was 0 seconds, 1 buffers not flushed, </li></ul><ul><li>timestamp: 0x5bc1b084. </li></ul><ul><li>07:40:16 Checkpoint loguniq 205864, logpos 0xe0d0, timestamp: 0x5bc1b084 </li></ul><ul><li>07:40:16 Maximum server connections 2 </li></ul><ul><li>07:47:44 Archive on r001, l001, d002, d003, d004, i001, i003, i004 Completed. </li></ul>
    26. 26. Kate’s last support law: Call IBM when first two laws don’t find the issue <ul><li>IBM support calls create PMRs {Problem ManagementRecords} These are now used for Informix as well. </li></ul><ul><li>You will want to have the following: </li></ul><ul><li>Hardware type and operating system version </li></ul><ul><li>>uname –a # ex AIX 5.1 </li></ul><ul><li>Complete version name and fixpak </li></ul><ul><li>Configuration file output, environment variables set, schema output </li></ul><ul><li>Ability to send the log files via ftp to IBM. </li></ul>
    27. 27. DB2 Version and Fixpak <ul><li>> su - in11 # enter password </li></ul><ul><li>> db2level </li></ul><ul><li>calvin:/opt/hd/db/db2/instance/in11> db2level </li></ul><ul><li>DB21085I Instance “in11&quot; uses &quot;32&quot; bits and DB2 code release SQL08013&quot; with level identifier &quot;02040106&quot;. </li></ul><ul><li>Informational tokens are &quot;DB2 v8.1.1.24&quot;, &quot;s030728&quot;, &quot;U488481&quot;, and FixPak &quot;3&quot;. </li></ul><ul><li>Product is installed at &quot;/usr/opt/db2_08_01&quot;. </li></ul>
    28. 28. Informix Version <ul><li>> onstat – </li></ul><ul><li>hobbes:/home/informix> onstat - </li></ul><ul><li>Informix Dynamic Server Version 9.40.FC1 -- On-Line -- Up 438 days 16:21:59 -- 10224988 Kbytes </li></ul>
    29. 29. View the Configuration Files <ul><li>Informix: </li></ul><ul><li>>view $INFORMIXDIR/etc/onconfig </li></ul><ul><li># changes can be made here </li></ul><ul><li>>view $INFORMIXDIR/etc/sqlhosts </li></ul><ul><li>> onstat –c #start up configuration </li></ul><ul><li>DB2: Instance variables </li></ul><ul><li>> db2 get dbm cfg | more </li></ul><ul><li>#- you scroll through the file. Updates cannot be made directly to the file, you use a utility </li></ul><ul><li>> db2 update dbm cfg using {parameter} {value} </li></ul><ul><li>DB2: Database variables </li></ul><ul><li>> db2 get db cfg for {database} | more </li></ul>
    30. 30. DB2 Environment Variables (some) <ul><li>calvin:> db2set -all </li></ul><ul><li>[i] DB2COMM=tcpip </li></ul><ul><li>[i] DB2AUTOSTART=YES </li></ul><ul><li>[g] DB2_EEE_LICENSE_POLICY=1125904201875456 </li></ul><ul><li>[g] DB2ADMINSERVER=db2as </li></ul><ul><li>calvin:> env | grep DB2 </li></ul><ul><li>DB2INSTANCE=ad11 </li></ul>
    31. 31. Informix Environment Variables (some) <ul><li>> onstat –g env </li></ul><ul><li>INFORMIXDIR /usr/informix </li></ul><ul><li>ONCONFIG in51 </li></ul><ul><li>INFORMIXSERVER in51 </li></ul><ul><li>PATH $INFORMIXDIR/bin:${PATH} </li></ul><ul><li>TERMCAP $INFORMIXDIR/etc/termcap </li></ul><ul><li>DBTEMP /tmp </li></ul>
    32. 32. Schema of the Database <ul><li>DB2 Database Schema (remember alex): </li></ul><ul><li>>db2look –d {database} –a –l –e –x –o {output file} </li></ul><ul><li>Informix: </li></ul><ul><li>>dbschema –d {database} –ss </li></ul>
    33. 33. Get Databases for an Instance <ul><li>Must run as the instance owner: </li></ul><ul><li>> db2 &quot;list db directory&quot; </li></ul><ul><li>System Database Directory </li></ul><ul><li>Number of entries in the directory = 1 </li></ul><ul><li>Database 1 entry: </li></ul><ul><li>Database alias = DB060 </li></ul><ul><li>Database name = DB060 </li></ul><ul><li>Local database directory = /opt/hd/db/db2/dbdir/db060 </li></ul><ul><li>Database release level = 9.00 </li></ul><ul><li>Comment = </li></ul><ul><li>Directory entry type = Indirect </li></ul><ul><li>Catalog node number = 0 </li></ul>
    34. 34. Database Connection State <ul><li>> db2 &quot;get connection state&quot; </li></ul><ul><li>Database Connection State </li></ul><ul><li>Connection state = Connectable and Unconnected </li></ul><ul><li>Connection mode = </li></ul><ul><li>Local database alias = </li></ul><ul><li>Database name = </li></ul>
    35. 35. Connect to a Database <ul><li>INFORMIX </li></ul><ul><li>> dbaccess {database} {command.sql} </li></ul><ul><li>Gives error if the instance is not running </li></ul><ul><li>DB2 </li></ul><ul><li>> db2 connect to db060 </li></ul><ul><li>Database Connection Information </li></ul><ul><li>Database server = DB2/6000 7.2.6 </li></ul><ul><li>SQL authorization ID = IN60 </li></ul><ul><li>Local database alias = DB060 </li></ul>
    36. 36. Statistics for a table – DB2 <ul><li>DB2 statistics is runstats (see IBM documentation Command Reference for full details) </li></ul><ul><li>> runstats on table {schema}.{table} with distribution and detailed indexes all shrlevel change” </li></ul>
    37. 37. Statistics for table - Informix <ul><li>Update statistics commands (see documentation for full command ) using SQL file to run against the database </li></ul><ul><li>>dbaccess {database} file.sql </li></ul><ul><li>File.sql: </li></ul><ul><li>Update statistics {low, medium, high} for table {owner}.{table} [distributions only] </li></ul>
    38. 38. Current path of Instance <ul><li>Not similar to >echo $INFORMIXDIR </li></ul><ul><li>Since DB2 instance path does not show where the source code lies. </li></ul><ul><li>> db2path </li></ul><ul><li>calvin:/opt/hd/db/db2/instance/in11> db2path /opt/hd/db/db2/instance/in11/sqllib </li></ul>
    39. 39. Some parameters in the DBM <ul><li>Database Manager Configuration </li></ul><ul><li>Node type = Enterprise Server Edition with local and remote clients </li></ul><ul><li>Diagnostic error capture level (DIAGLEVEL) = 3 </li></ul><ul><li>Notify Level (NOTIFYLEVEL) = 2 </li></ul><ul><li>Diagnostic data directory path (DIAGPATH) = /opt/hd/db/db2/instance/in32/sqllib/db2dump </li></ul><ul><li>Default database path (DFTDBPATH) = /opt/hd/db/db2/instance/in32 </li></ul><ul><li>Max number of existing agents (MAXAGENTS) = 400 </li></ul><ul><li>TCP/IP Service name (SVCENAME) = in32 </li></ul><ul><li>No. of int. communication buffers(4KB) (FCM_NUM_BUFFERS) = 4096 </li></ul>
    40. 40. Backup a Database – DB2 <ul><li>Db2 “backup db {database} {online} {incremental} use {backup mgr} </li></ul><ul><li>Multipartition: </li></ul><ul><li>Db2_all “<<+0<db2 backup db {database} {online} {incremental} use {B/up mgr} </li></ul><ul><li>Example </li></ul><ul><li>Db2 “ backup db db060 online use adsm” </li></ul>
    41. 41. Backup a Database - Informix <ul><li>To a tape drive: </li></ul><ul><li>>ontape –s </li></ul><ul><li>(at prompt, enter level of archive) </li></ul><ul><li>Using onbar (i.e. to TSM): </li></ul><ul><li>>onbar –b –L 0 </li></ul>
    42. 42. Get list of past backups <ul><li>> db2 list history backup all for {database} </li></ul><ul><li>Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID </li></ul><ul><li>-- --- ------------------ ---- --- ------------ ------------ -------------- </li></ul><ul><li>B D 20050927020010001 N A S0000509.LOG S0000510.LOG </li></ul><ul><li>---------------------------------------------------------------------------- </li></ul><ul><li>Contains 7 tablespace(s): </li></ul><ul><li>00001 SYSCATSPACE </li></ul><ul><li>00002 INVDATA4K </li></ul><ul><li>00003 INVINDEX4K </li></ul><ul><li>00004 INVDATA8K </li></ul><ul><li>00005 INVINDEX8K </li></ul><ul><li>00006 INVDATA16K </li></ul><ul><li>00007 INVINDEX16K </li></ul><ul><li>---------------------------------------------------------------------------- </li></ul><ul><li>Comment: DB2 BACKUP DB010 ONLINE </li></ul><ul><li>Start Time: 20050927020010 </li></ul><ul><li>End Time: 20050927020043 </li></ul><ul><li>---------------------------------------------------------------------------- </li></ul><ul><li>00013 Location: adsm/libtsm.a </li></ul>
    43. 43. Get list of last backup - Informix <ul><li>>onstat –g arc </li></ul><ul><li>hobbes:/users/informix> onstat -g arc </li></ul><ul><li>Informix Dynamic Server Version 7.31.UD3 -- On-Line -- Up 3 days 09:05:32 -- 26024 Kbytes </li></ul><ul><li>num DBSpace Q Size Q Len Buffer partnum size scanner </li></ul><ul><li>Dbspaces - Archive Status </li></ul><ul><li>name number level date log log-position </li></ul><ul><li>r001 1 0 06/12/2006.01:00 2289 0x21018 </li></ul><ul><li>d001 2 0 06/12/2006.01:00 2289 0x21018 </li></ul><ul><li>l001 3 0 06/12/2006.01:00 2289 0x21018 </li></ul><ul><li># to see other backups, you need to look at a file such as ixbar </li></ul>
    44. 44. Check quality of the backup – DB2 <ul><li>Checksum: </li></ul><ul><li>Db2adutl verify full taken at {datetime} db {database} </li></ul><ul><li>Example: </li></ul><ul><li>Db2adutl verify full taken at 20040512171343 db db010 </li></ul>
    45. 45. Restore Database – DB2 <ul><li>Db2 “restore database {database} use {ex: tsm} taken at {date/time} </li></ul><ul><li>NOTE: This is the start time from the history output. </li></ul>
    46. 46. Example Restore – DB2 <ul><li>Get last good backup date/time: </li></ul><ul><li>>db2 list history backup all for db010 </li></ul><ul><li>Check attached users: </li></ul><ul><li>>db2 list applications </li></ul><ul><li>Force users off: </li></ul><ul><li>> db2 force applications all </li></ul><ul><li>Run restore with nohup: </li></ul><ul><li>>nohup db2 “restore database db010 use tsm taken 20040512171343” </li></ul><ul><li>Verify completed: </li></ul><ul><li>>db2 “connect to db010 ” </li></ul>
    47. 47. Restore Informix database <ul><li>>onbar –r [ dbspaces list] </li></ul><ul><li>-or- </li></ul><ul><li>>ontape -r </li></ul>
    48. 48. Run SQL Against a Table – DB2 <ul><li>db2 connect to {database} </li></ul><ul><li>db2 “select * from {table-name}” </li></ul><ul><li>Example: </li></ul><ul><li>>db2 “select substr(tabname,1,18) as table_name from syscat.tables where type=‘T’ order by 1” </li></ul><ul><li># gets system tables </li></ul>
    49. 49. External SQL File – DB2 <ul><li>Create a file that contains each SQL command separated by a “;” </li></ul><ul><li>calvin: /usr/app/bin> cat count.sql </li></ul><ul><li>select count(*) from syscat.tables where type='T'; </li></ul><ul><li>select count(*) from syscat.indexes; </li></ul><ul><li>Run an sql file: </li></ul><ul><li>>db2 –tvf {sql file} –z {output file} </li></ul><ul><li>Example: </li></ul><ul><li>>db2 –tvf count.sql –z count.out </li></ul>
    50. 50. External SQL file - Informix <ul><li>>cat file.sql </li></ul><ul><li>select count(*) from errorlog </li></ul><ul><li>>dbaccess {database} {file.sql} </li></ul><ul><li>hobbes:/users/informix> dbaccess db005 file.sql </li></ul><ul><li>Database selected. </li></ul><ul><li>(count(*)) </li></ul><ul><li>4063 </li></ul><ul><li>1 row(s) retrieved. </li></ul><ul><li>Database closed. </li></ul>
    51. 51. Tables space info – DB2 <ul><li>db2 “list tablespaces” </li></ul><ul><li>Tablespaces for Current Database </li></ul><ul><li>Tablespace ID = 0 </li></ul><ul><li>Name = SYSCATSPACE </li></ul><ul><li>Type = System managed space </li></ul><ul><li>Contents = Any data </li></ul><ul><li>State = 0x0000 </li></ul><ul><li>Detailed explanation: Normal </li></ul><ul><li>Tablespace ID = 1 </li></ul><ul><li>Name = TEMPSPACE1 </li></ul><ul><li>Type = System managed space </li></ul><ul><li>Contents = Temporary data </li></ul><ul><li>State = 0x0000 </li></ul><ul><li>Detailed explanation: Normal </li></ul><ul><li>Tablespace ID = 2 </li></ul><ul><li>Name = USERSPACE1 </li></ul><ul><li>Type = System managed space </li></ul><ul><li>Contents = Any data </li></ul><ul><li>State = 0x0000 </li></ul><ul><li>Detailed explanation: Normal </li></ul>
    52. 52. Tablespace info – DB2 <ul><li>User created tablespace: </li></ul><ul><li>Tablespace ID = 3 </li></ul><ul><li>Name = PR001TAAQB </li></ul><ul><li>Type = Database managed space </li></ul><ul><li>Contents = Any data </li></ul><ul><li>State = 0x0000 </li></ul><ul><li>Detailed explanation: </li></ul><ul><li>Normal </li></ul><ul><li>System managed space: automatic expansions up to the max size of the file system. </li></ul><ul><li>Database managed space: dba allocates additional space </li></ul>
    53. 53. Tablespace Detailed info – DB2 <ul><li>> db2 “list tablespaces show detail” | more </li></ul><ul><li>Tablespace ID = 3 </li></ul><ul><li>Name = PR001TAAQB </li></ul><ul><li>Type = Database managed space </li></ul><ul><li>Contents = Any data </li></ul><ul><li>State = 0x0000 </li></ul><ul><li>Detailed explanation: </li></ul><ul><li>Normal </li></ul><ul><li>Total pages = 100000 </li></ul><ul><li>Useable pages = 99968 </li></ul><ul><li>Used pages = 99968 </li></ul><ul><li>Free pages = 0 </li></ul><ul><li>High water mark (pages) = 99968 </li></ul><ul><li>Page size (bytes) = 4096 </li></ul><ul><li>Extent size (pages) = 32 </li></ul><ul><li>Prefetch size (pages) = 32 </li></ul><ul><li>Number of containers = 1 </li></ul><ul><li>##Includes used pages information and page size for additional allocations. </li></ul>
    54. 54. Tablespace info - Informix <ul><li>>onstat –d </li></ul><ul><li>hobbes: /home/kate> onstat -d </li></ul><ul><li>Informix Dynamic Server Version 7.31.UD3 -- On-Line -- Up 48 days 15:48:33 -- 26024 Kbytes </li></ul><ul><li>Dbspaces </li></ul><ul><li>address number flags fchunk nchunks flags owner name </li></ul><ul><li>d2215158 1 1 1 1 N informix root </li></ul><ul><li>d2215738 2 1 2 1 N informix data </li></ul><ul><li>d22157f8 3 1 3 1 N informix logs </li></ul><ul><li>d22158b8 4 2001 4 1 N T informix temp </li></ul><ul><li>4 active, 2047 maximum </li></ul><ul><li>Chunks </li></ul><ul><li>address chk/dbs offset size free bpages flags pathname </li></ul><ul><li>d2215218 1 1 0 5000 2713 PO- /usr/informix/data/in05root </li></ul><ul><li>d2215420 2 2 5000 30000 29195 PO- /usr/informix/data/in05data </li></ul><ul><li>d2215528 3 3 35000 25053 0 PO- /usr/informix/data/in05logs </li></ul><ul><li>d2215630 4 4 92400 10000 9947 PO- /usr/informix/data/in05temp </li></ul><ul><li>4 active, 2047 maximum </li></ul>
    55. 55. Add disk space – DB2 <ul><li>Expand the containers for a tablespace. </li></ul><ul><li>>alter tablespace {tbspacename} extend (all containers {expand amount}); </li></ul><ul><li>#Every container is expanded the same amount and data is balanced across all containers. Expand amount is in pages. Can take many minutes. </li></ul>
    56. 56. Add Disk Space - Informix <ul><li>>onspaces –a {spacename} –p {pathname} –o {offset} –s {size in kb NOT pages} </li></ul><ul><li>>onspaces –a data –p /usr/informix/data/in05data –o 120106 –s 10000 </li></ul><ul><li>#takes space 60053 to 65053 on the onstat –d command </li></ul><ul><li># NOTE: this is using raw disk </li></ul>
    57. 57. Get Stored Procedure SQL – DB2 <ul><li>Db2 “export to {filename} of del select text from syscat.procedures where procname=‘{ProcName}’” </li></ul><ul><li>Example </li></ul><ul><li>>db2 “export to filename.sql of del select text from syscat.procedures where procname=‘ADJUSTAMT” </li></ul><ul><li># creates procedure code in filename.sql </li></ul>
    58. 58. Stored Procedure SQL - Informix <ul><li>Dbschema –d db001 –f all </li></ul><ul><li>DBSCHEMA Schema Utility INFORMIX-SQL Version 7.31.UD3 </li></ul><ul><li>Copyright (C) Informix Software, Inc., 1984-1998 </li></ul><ul><li>Software Serial Number AAC#J799807 </li></ul><ul><li>create procedure &quot;informix&quot;.sqlnkforkeypfk45(i_pkCatalog varchar(18), i_pkSchema </li></ul><ul><li>varchar(18), </li></ul><ul><li>i_pkTableName varchar(18), </li></ul><ul><li>… </li></ul>
    59. 59. Instance Creation – DB2 <ul><li>You must have root access to create </li></ul><ul><li>You must have user ids created for each instance, where as in Informix you could always just use Informix </li></ul><ul><li>You may also create a fenced user id for the instance. This ID does not have system administration (sysadm) privileges </li></ul><ul><li>> db2icrt -u {instance fenced id} {instance} </li></ul>
    60. 60. Instance Creation – Informix <ul><li># must be informix to create </li></ul><ul><li>export ONCONFIG=in01 </li></ul><ul><li>export INFORMIXSERVER=in01 </li></ul><ul><li>export INFORMIXDIR=/opt/isv/informix </li></ul><ul><li>export PATH=$INFORMIXDIR/bin:$PATH </li></ul><ul><li>> vi $INFORMIXDIR/etc/in01 (set up configuration file) </li></ul><ul><li>oninit –i </li></ul>
    61. 61. Some Important System Tables – DB2 <ul><li>Prefix with owner/schema “syscat” </li></ul><ul><li>Syscat.Tables </li></ul><ul><li>Syscat.Indexes </li></ul><ul><li>Syscat.Dbauth </li></ul><ul><li>Syscat.Tabauth </li></ul><ul><li>Syscat.Dependancies </li></ul><ul><li>Syscat.Tablespaces </li></ul><ul><li>Syscat.tbspaceauth </li></ul>
    62. 62. Important system tables - Informix <ul><li>“ informix”.systables </li></ul><ul><li>“ informix”.sysindexes </li></ul><ul><li>“ informix”.syscolumns </li></ul><ul><li>Many others, just to a select * from “informix”.systables to see them all. </li></ul>
    63. 63. RTFM – Where to find the manuals <ul><li>INFORMIX: </li></ul><ul><li>www.iiug.org – has everything!! Content added daily. Check out the links on the right side to IBM. </li></ul><ul><li># direct link to online docs </li></ul><ul><li>http://www-306.ibm.com/software/data/informix/pubs/library/ </li></ul><ul><li>DB2: # link to v8 Unix docs </li></ul><ul><li>http://www-306.ibm.com /software/data/db2/udb/support/manualsv8.html </li></ul>
    64. 64. Performance Tuning <ul><li>Clearly, there are numerous sessions at this conference with suggestions for performance tuning. But, if there was only one thing I could teach you, before the end of this discussion, to improve performance on a system you’ve never seen before, what would it be? </li></ul>
    65. 65. Answer… <ul><li>Increase memory to database (i.e. add buffers). </li></ul>
    66. 66. Informix Performance Tuning for Beginners <ul><li>ADD BUFFERS: </li></ul><ul><li>vi onconfig </li></ul><ul><li># increase BUFFERS by 10000 at a time </li></ul><ul><li># bounce informix instance for them to take affect </li></ul><ul><li># Shared Memory Parameters </li></ul><ul><li>LOCKS 300000 # Maximum number of locks </li></ul><ul><li>BUFFERS 220000 # Maximum number of shared buffers </li></ul><ul><li>Bounce engine (or you can also add it dynamically) </li></ul>
    67. 67. DB2 Performance Tuning for Beginners <ul><li>ADD BUFFERS: </li></ul><ul><li>Db2 “select bpname, npages, pagesize from syscat.bufferpools” </li></ul><ul><li>Db2 “alter bufferpool ibmdefaultbp size 10000” </li></ul><ul><li>Will happen dynamically if possible, otherwise will give you error that you need to bounce instance. </li></ul><ul><li>> db2 select bpname, npages, pagesize from syscat.bufferpools </li></ul><ul><li>BPNAME NPAGES PAGESIZE </li></ul><ul><li>------------------------------------------------------------------------------ </li></ul><ul><li>IBMDEFAULTBP 10000 4096 </li></ul>
    68. 68. Monitoring Environment <ul><li>Informix – Check out all the onstat functions </li></ul><ul><li>Onstat -- # double dash displays all options. </li></ul><ul><li>DB2 – for 8.2 use db2pd as the instance owner </li></ul><ul><li>> su – in11 </li></ul><ul><li>> db2pd -help </li></ul>
    69. 69. Name one DB2 feature I would like to see in Informix… <ul><li>AUTOCONFIGURE!! </li></ul><ul><li>To use (example): </li></ul><ul><li>> db2 “connect to {database}” </li></ul><ul><li>> db2 “autoconfigure using mem_percent 70 TPM 1000 num_remote_apps 1000 APPLY NONE” </li></ul><ul><li>Has many parameters and it gives you a report of how the database should be tuned. </li></ul>
    70. 70. Name one Informix feature I would like to see in DB2… <ul><li>This is personal preference, but I LOVE the fact that when you set up HDR in Informix (HADR in DB2) you can read from the backup server and do queries! </li></ul><ul><li>The failover box becomes a useful way of reducing the reporting load from the production server. </li></ul>
    71. 71. To Advanced beyond Beginner Status <ul><li>Recommendation: Take a class if you need to work in a new language (sorry, this hour didn’t count!) </li></ul><ul><li>Warning: The beginning DB2 class shows everything through a GUI interface. </li></ul><ul><li>Oh, and by the way - the mainframe Z/OS DB2 does not even have the same system table names as the Unix version. </li></ul>
    72. 72. Why conferences are important..
    73. 73. Kate Tomchik <ul><li>The Home Depot, Lead DBA </li></ul><ul><li>International Informix Users Group </li></ul><ul><li>Board of Directors </li></ul><ul><li>[email_address] </li></ul>Session H08 Unix DBA Cross Training Informix & DB2
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×