Your SlideShare is downloading. ×
0
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Unix DB2 Navigation for an Informix DBA
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Unix DB2 Navigation for an Informix DBA

677

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
677
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Db2sysc is the main process. One exists for each DB2 instance running.
  • 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)
  • Transcript

    • 1. Unix DB2 Navigation for an Informix DBA Kate Tomchik Lead DBA / The Home Depot Informix User Forum 2005 Moving Forward With Informix Atlanta, Georgia December 8-9, 2005
    • 2. DB2 Navigation for an Informix DBA <ul><li>Informix Users Cheat Sheet </li></ul><ul><li>for Unix DB2 Support </li></ul>
    • 3. First rule of DBA support <ul><li>When user calls with a problem verify the database is up. </li></ul><ul><li>If not restart it. </li></ul><ul><li>If it is, get permission to bounce it. </li></ul>
    • 4. DB2 Instances running <ul><li>> db2ilist #-- not always set up </li></ul><ul><li>cpainp95:/opt/hd/db/db2/instance/adfi11> db2ilist </li></ul><ul><li>adis32 </li></ul><ul><li>adis33 </li></ul><ul><li>adfi11 </li></ul><ul><li>> Ps -ef | grep db2sysc | grep -v grep </li></ul><ul><li>cpainp95: /home/lkt01> ps -ef | grep db2sysc | grep -v grep </li></ul><ul><li>adfi11 876768 917730 0 Jul 27 - 0:09 db2sysc 0 </li></ul><ul><li>adis33 1056790 1392730 0 Jul 27 - 0:09 db2sysc 0 </li></ul><ul><li>adis32 1933360 2170886 0 Aug 12 - 0:01 db2sysc 0 </li></ul>
    • 5. Typical DB2 processes <ul><li>cpainp95: /home/lkt01> ps -fu adfi11 | grep db2 </li></ul><ul><li>adfi11 647364 876768 0 Jul 27 - 0:36 db2gds 0 </li></ul><ul><li>adfi11 786632 876768 0 Jul 27 - 0:04 db2ipccm 0 </li></ul><ul><li>adfi11 811222 647364 0 Aug 13 - 0:04 db2dlock (DAD014FI) 0 </li></ul><ul><li>adfi11 876768 917730 0 Jul 27 - 0:09 db2sysc 0 </li></ul><ul><li>adfi11 901346 876768 0 Jul 27 - 0:00 db2syslog 0 </li></ul><ul><li>adfi11 934120 647364 0 Jul 27 - 0:00 db2srvlst 0 </li></ul><ul><li>adfi11 983280 876768 0 Jul 27 - 0:00 db2tcpcm 0 </li></ul><ul><li>adfi11 999672 876768 0 Jul 27 - 0:00 db2resync 0 </li></ul><ul><li>adfi11 1016056 876768 0 Jul 27 - 0:00 db2spmrsy 0 </li></ul><ul><li>adfi11 1040638 647364 0 Jul 27 - 0:00 db2spmlw 0 </li></ul><ul><li>adfi11 1261798 647364 0 Aug 13 - 0:06 db2loggw (DAD014FI) 0 </li></ul><ul><li>adfi11 1327176 786632 0 Jul 27 - 2:42 db2agent (instance) 0 </li></ul><ul><li>adfi11 1491052 647364 0 Jul 27 - 0:02 db2cart 0 </li></ul><ul><li>adfi11 1556610 647364 0 Jul 27 - 1:19 db2agent (DAD014FI) 0 </li></ul><ul><li>adfi11 1564804 647364 0 Jul 27 - 0:03 db2agent (idle) 0 </li></ul><ul><li>adfi11 1753190 647364 0 Aug 13 - 0:00 db2pfchr 0 </li></ul><ul><li>adfi11 1884196 647364 0 Aug 13 - 0:00 db2event (DB2DETAILDEADLOCK) 0 </li></ul><ul><li>adfi11 2015258 647364 0 Aug 13 - 0:00 db2pfchr 0 </li></ul><ul><li>adfi11 2023660 647364 0 Aug 13 - 0:00 db2loggr (DAD014FI) 0 </li></ul><ul><li>adfi11 2433208 647364 0 Aug 13 - 0:00 db2pclnr 0 </li></ul>
    • 6. Start an Instance <ul><li>>oninit # --- in Informix </li></ul><ul><li>> db2start #--- run as id of instance </li></ul><ul><li>cpaiad28: /opt/hd/db/db2/> su – remm60 </li></ul><ul><li>cpaiad28: /opt/hd/db/db2/instance/remm60> 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>
    • 7. Start an Instance (con’t) <ul><li>cpaiad28: /opt/hd/db/db2/instance/remm60> ps -fu remm60 </li></ul><ul><li>UID PID PPID C STIME TTY TIME CMD </li></ul><ul><li>remm60 1335306 7127088 0 13:28:16 - 0:00 db2ipccm 0 </li></ul><ul><li>remm60 1687694 7192802 0 13:18:55 pts/0 0:00 -ksh </li></ul><ul><li>remm60 1695826 4866232 0 13:28:17 - 0:00 db2srvlst 0 </li></ul><ul><li>remm60 2252828 7127088 0 13:28:17 - 0:00 db2spmrm 0 </li></ul><ul><li>remm60 3645576 4866232 0 13:28:17 - 0:00 db2resyn 0 </li></ul><ul><li>remm60 4530428 1687694 1 13:28:24 pts/0 0:00 ps -fu remm60 </li></ul><ul><li>remm60 4603946 7127088 0 13:28:16 - 0:00 db2tcpcm 0 </li></ul><ul><li>remm60 4628634 7127088 0 13:28:16 - 0:00 db2tcpcm 0 </li></ul><ul><li>remm60 4866232 7127088 0 13:28:16 - 0:00 db2gds 0 </li></ul><ul><li>remm60 6955014 4866232 0 13:28:17 - 0:00 db2spmlw 0 </li></ul><ul><li>remm60 7127088 4997122 0 13:28:16 - 0:00 db2sysc 0 </li></ul>
    • 8. Stop an Instance <ul><li>> onmode -ky # --- in informix </li></ul><ul><li>> db2stop # --- run as userid of instance </li></ul><ul><li>cpaiad28: /opt/hd/db/db2/instance/remm60 </li></ul><ul><li>> db2stop </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 remm60 </li></ul><ul><li>UID PID PPID C STIME TTY TIME CMD </li></ul><ul><li>remm60 1687694 7192802 0 13:18:55 pts/0 0:00 -ksh </li></ul><ul><li>remm60 4538434 1687694 1 13:27:02 pts/0 0:00 ps –fu remm60 </li></ul>
    • 9. Hard Kill an Instance (bad way) <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>
    • 10. Db2_kill (less corruption risk) <ul><li>> db2_kill # db2 utility </li></ul><ul><li>cpaiad28: /opt/hd/db/db2/instance/remm60> db2_kill </li></ul><ul><li>cpaiad28: ipclean: Removing DB2 engine and client's IPC resources for remm60. </li></ul><ul><li>cpaiad28: db2nkill [] completed ok </li></ul>
    • 11. 2 nd Rule of DBA Support <ul><li>If one user is stopping a 100 users from getting to their tables, </li></ul><ul><li>Kill the Offending Process. </li></ul><ul><li>>db2 list applications show detail </li></ul><ul><li># identify bad process and get the Appl. Handle and Coordinator PID/Thread. </li></ul><ul><li>db2 force appliction {AH} </li></ul><ul><li># similar to onmode –z {PID} in Informix </li></ul>
    • 12. 3 rd Rule – Check the log files <ul><li>>{db2path} / db2dump / db2diag.log </li></ul><ul><li>cpainp95:/opt/hd/db/db2/instance/adfi11/sqllib/db2dump> ls -l </li></ul><ul><li>total 10352 </li></ul><ul><li>-rw-rw-rw- 1 adfi11 sysadm 4821 Jul 27 07:46 adfi11.nfy </li></ul><ul><li>-rw-rw-rw- 1 adfi11 sysadm 46803 Jul 27 12:04 db2diag.log </li></ul><ul><li>-rw-r----- 1 adfi11 sysadm 5242044 Jul 27 07:36 db2eventlog.000.crash </li></ul><ul><li>db2diag.log – main log of database activity </li></ul><ul><li>adfi11.nfy file contains notifications. </li></ul><ul><li>db2eventlog.000 files are similar to /tmp/af files since they are created during database errors but they are not readable. Send to IBM when opening a PMR. </li></ul>
    • 13. Adis32.nfy (v8 file) <ul><li>ADM7514W Database manager has stopped. </li></ul><ul><li>^^ </li></ul><ul><li>2004-04-02-18.57.12.883227 Instance:adis32 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>^^ </li></ul><ul><li>2005-11-02-13.12.15.570194 Instance:adis32 Node:000 </li></ul><ul><li>PID:2457760(db2agent (CQMASTR2) 0) TID:1 Appid:*LOCAL.adis32.0800F2181219 </li></ul><ul><li>database monitor sqm.evmgr::log_ev_err Probe:2 Database:DAD036IS </li></ul><ul><li>ADM2004E The Event Monitor &quot;DB2DETAILDEADLOCK&quot; was not activated because there </li></ul><ul><li>was not enough storage space in the database monitor heap. To remedy this </li></ul><ul><li>problem, increase the MON_HEAP_SZ DBM configuration parameter and restart the </li></ul><ul><li>instance. </li></ul>
    • 14. Db2diag.log <ul><li>ADM7513W Database manager has started. </li></ul><ul><li>2005-08-02-15.01.16.014367 Instance:adis32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DAD033IS) 0) TID:1 Appid:*LOCAL.adis32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:0 Database:DAD033IS </li></ul><ul><li>Starting a full database backup. </li></ul><ul><li>2005-08-02-15.01.53.519377 Instance:adis32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DAD033IS) 0) TID:1 Appid:*LOCAL.adis32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:128 Database:DAD033IS </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:adis32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DAD033IS) 0) TID:1 Appid:*LOCAL.adis32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:128 Database:DAD033IS </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:adis32 Node:000 </li></ul><ul><li>PID:2318574(db2agent (DAD033IS) 0) TID:1 Appid:*LOCAL.adis32.0003D2190114 </li></ul><ul><li>database utilities sqlubcka Probe:130 Database:DAD033IS </li></ul><ul><li>Backup Complete. </li></ul>
    • 15. When all else fails - Call Support <ul><li>IBM support calls create PMRs {Problem Management Record} </li></ul><ul><li>You will want already have the following: </li></ul><ul><li>Hardware type and operating system version >uname –a #ex AIX 5.1 </li></ul><ul><li>DB2 version </li></ul><ul><li>Configuration file, environment variables </li></ul><ul><li>Ability to send the log files via ftp to IBM. </li></ul>
    • 16. Version of DB2 <ul><li>> su - adfi11 # enter password </li></ul><ul><li>> db2level </li></ul><ul><li>cpainp95:/opt/hd/db/db2/instance/adfi11> db2level </li></ul><ul><li>DB21085I Instance &quot;adfi11&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>
    • 17. DB2 Environment Variables <ul><li>cpainp95:> env | grep DB2 </li></ul><ul><li>DB2INSTANCE=adfi11 </li></ul><ul><li>cpainp95:> 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>
    • 18. View the Configuration File <ul><li>Informix </li></ul><ul><li>>view $INFORMIXDIR/etc/onconfig </li></ul><ul><li>>view $INFORMIXDIR/etc/sqlhosts </li></ul><ul><li>DB2 </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>
    • 19. Current path <ul><li>similar to >echo $INFORMIXDIR </li></ul><ul><li>but each instance has a different location </li></ul><ul><li>> db2path </li></ul><ul><li>cpainp95:/opt/hd/db/db2/instance/adfi11> db2path </li></ul><ul><li>/opt/hd/db/db2/instance/adfi11/sqllib </li></ul>
    • 20. Advanced Beginning Functions <ul><li>Recommendation: Take a class if you really need to work in UDB DB2. </li></ul><ul><li>Warning: The beginning class shows everything through a GUI interface. </li></ul><ul><li>The following shows the basics using command line functions. </li></ul>
    • 21. 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 = DPR060TA </li></ul><ul><li>Database name = DPR060TA </li></ul><ul><li>Local database directory = /opt/hd/db/db2/dbdir/dpr060ta </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>
    • 22. 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>
    • 23. Connect to a Database <ul><li>Informix > dbaccess {database} {command.sql} </li></ul><ul><li>Gives error if the instance has not been started </li></ul><ul><li>> db2 connect to dpr060ta </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 = REMM60 </li></ul><ul><li>Local database alias = DPR060TA </li></ul>
    • 24. Instance creation <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>
    • 25. 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/adis32/sqllib/db2dump </li></ul><ul><li>Default database path (DFTDBPATH) = /opt/hd/db/db2/instance/adis32 </li></ul><ul><li>Max number of existing agents (MAXAGENTS) = 400 </li></ul><ul><li>TCP/IP Service name (SVCENAME) = adis32 </li></ul><ul><li>No. of int. communication buffers(4KB) (FCM_NUM_BUFFERS) = 4096 </li></ul>
    • 26. Make a Backup <ul><li>Db2 “backup db {database} {online} {incremental} use {adsm} </li></ul><ul><li>Multipartition: </li></ul><ul><li>Db2_all “<<+0<db2 backup db {database} {online} {incremental} use {adsm} </li></ul><ul><li>Example </li></ul><ul><li>Db2 “ backup db dpr060mm online use adsm” </li></ul>
    • 27. Check quality of the backup <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 dpr010sa </li></ul>
    • 28. 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 WCSDATA4K </li></ul><ul><li>00003 WCSINDEX4K </li></ul><ul><li>00004 WCSDATA8K </li></ul><ul><li>00005 WCSINDEX8K </li></ul><ul><li>00006 WCSDATA16K </li></ul><ul><li>00007 WCSINDEX16K </li></ul><ul><li>---------------------------------------------------------------------------- </li></ul><ul><li>Comment: DB2 BACKUP DPR010SA 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>
    • 29. Restore Database command <ul><li>Db2 “restore database {database} use {tsm} taken at {date/time} </li></ul><ul><li>NOTE: This is the start time from the history output. </li></ul>
    • 30. Example Restore <ul><li>Get last good backup date/time: </li></ul><ul><li>>db2 list history backup all for dpr010sa </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 as nohup: </li></ul><ul><li>>nohup db2 “restore database dpr010sa use tsm taken 20040512171343” </li></ul><ul><li>Verify completed: </li></ul><ul><li>>db2 “connect to dpr010sa” </li></ul>
    • 31. Run SQL Against a table <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>
    • 32. External SQL file for run <ul><li>Create a file that contains each SQL command separated by a “;” </li></ul><ul><li>cpaita28: /usr/ra/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>
    • 33. Some Important System Tables <ul><li>Prefix with owner/schema syscat </li></ul><ul><li>Tables </li></ul><ul><li>Indexes </li></ul><ul><li>Dbauth </li></ul><ul><li>Tabauth </li></ul><ul><li>Dependancies </li></ul><ul><li>Tablespaces </li></ul><ul><li>tbspaceauth </li></ul>
    • 34. Data space issues <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: </li></ul><ul><li>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: </li></ul><ul><li>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: </li></ul><ul><li>Normal </li></ul>
    • 35. Data space issues <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>
    • 36. Data space – Detailed information <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>
    • 37. Add disk space <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 blanced across all containers. Expand amount is in pages. Can take many minutes. </li></ul>
    • 38. Get Stored Procedure SQL <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=‘ADJUSTINV’” </li></ul><ul><li># creates procedure code in filename.sql </li></ul>
    • 39. Unix DB2 Navigation for an Informix DBA Kate Tomchik [email_address] [email_address] Informix User Forum 2005 Moving Forward With Informix Atlanta, Georgia December 8-9, 2005

    ×