No need to create a trigger:-
C:\Program Files\SQLLIB\BIN>db2 create sequence test_seq start with 1 maxvalue 2
nocycle
DB20000I The SQL command completed successfully.
C:\Program Files\SQLLIB\BIN>db2 values (nextval for test_seq)
1
-----------
1
1 record(s) selected...
Just 1 small change for us non-Americans:-
SELECT SUBSTR('JAN-FEB-MAR-APR-MAY-JUN-JUL-AUG-SEP-OCT-NOV-DEC-',MONTH(CURRENT_DATE)*4-3,4) CONCAT(SUBSTR(CHAR(YEAR(CURRENT_DATE)),3,2)) FROM SYSIBM.SYSDUMMY1
Truusvlugindewind, To clarify:-
jcale4 asked how he could speed up the handling of a column containing 2000+ characters. He then goes on to enquire if CLOBs would help improve performance. My reply didn't address the 2nd CLOB question. You can store up to 32768 characters in a varchar column of...
Getting back to the original questions. You can find out if a table is locked either by typing:-
"db2 get snapshot for locks on <database>" which will show you all of the locks on the database
or
1. You could do a select on the table you suspect is locked.
If your select hangs then:-
2...
You only need to reorg tables if there has been a lot of update/delete activity associated with it. i.e. if you've just loaded new tables, you shouldn't need to. You do need to run "runstats", however. This provides the DB2 optimiser with knowledge about each table, so that it can pick the best...
You could increase the prefetchsize associated with the tablespace which contains the table with the large varchar columns in them. Also check the bufferpool is big enough to hold the pre-fetched data.
Presumably you're trying to look at the ddl for a table on a remote database. Each server i.e. physical machine which has DB2 on it has a DB2 Administration Server. This allows remote Administration Clients to discover what instances and databases are on the server and to interact with them.
I...
Not so far, but I agree it needs it. At the moment, the isolation levels are:-
1. Repeatable read (locks every row read in the cursor)
2. Read Stability (locks every row selected in the cursor)
3. Cursor Stability (locks the current row selected in the cursor)
4. Uncommitted Read (Doesn't lock...
Timerons are pretty much useless imho. If you want to performance a piece of sql, do this:-
1. Do a "runstats" on all the tables in the sql.
2. Run dynamic explain and look for:-
a) Table scans
b) Nested loop joins to tables with a lot of rows in them
c) Inefficient indexes e.g. where...
Memo fields could be converted to clobs or varchars dependent on their length. Easiest way to import Gigabytes worth of data would be to export it to csv or del format and then load or import it in to db2. It should be possible to generate clob-style files for the memo fields for db2 to read.
You're right it's in /etc/services. The normal port number is 50000. Just look for something like db2_db2inst1 or whatever you've called your instance. You'll need to stop and re-start db2 for it to take effect. You can use netstat to check it's listening on the correct port.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.