#This information was found from the deep corners of random DB2 references #and proved to be very useful espcially for bulk loading of data. If you #are loading lots of data consider using the AUTOLOADER. #reading a schema from disk db2 -tf schemav2.txt #Importing/exporting in db2. http://www.cs.yorku.ca/~jarek/courses/3421/db2notes/import.html #importing data, this is expensive and creates a huge transactionlog #if you are not careful by turning off logging because it does an INSERT #for each row. import from file.del of del messages import.msg insert into table; #retrieve database configuration information db2 get database configuration for DBNAME #set config info for a field #make logfilsiz bigger when you get a message similar to "Transaction Log full" #when inserting a lot of data, or consider turning off the log facility db2 update database configuration for DBNAME using logfilsiz 40000 #drop application connections db2 force applications all db2 list applications #force transactions to be closed and written to disk. db2 commit #useful links http://webdocs.caspur.it/ibm/web/udb-6.1/db2dm/db2dm38.htm http://www7b.boulder.ibm.com/dmdd/library/techarticle/0202kline/0202kline.html #check to see if your tablespace is in the dreaded "Check Pending" state db2 "LIST TABLESPACES SHOW DETAIL" #the canonical way of loading lots of ascii data load from FILE of del modified by noheader messages /tmp/mesg.txt insert into TABLE nonrecoverable #resolving 'load pending' state http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci834320,00.html #remove check pending state set constraints for USER.TABLENAME immediate checked #skip constraint checking set constraints for USER.TABLENAME all immediate unchecked update database configuration for surveyor using DFT_DEGREE 2 list nodes list nodegroups show detail #get rid of load pending db2 "load from /dev/null of del terminate into srour.routeintervals" #determine which table is in the load pending or check pending state db2 "select status from syscat.tables" #disable transaction log generation, very useful for bulk loading. use #before any INSERT or UPDATE statements. resets after a COMMIT. db2 alter table times activate not logged initially #reset the db connections. db2 connect reset