Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 61684

The IBM DB2 Enterprise Server Edition is a relational model database server developed by IBM. It primarily runs on Unix (namely AIX), Linux, IBM i (formerly OS/400), z/OS and Windows servers.

1
vote
The SAMPLE database is usually created with the db2sampl command (documented here for DB2 LUW 10.5). You can tell db2sampl to create another SAMPLE database under a different name with the -name …
answered Oct 13 '15 by Dave Jones
1
vote
implicitly started in DB2). I assume there's a bit more to that DETACH statement but that it's omitted for brevity. The SET INTEGRITY statement (I'd strongly recommend reading that page, especially the Notes …
answered Apr 17 '15 by Dave Jones
2
votes
remove it. This will work on DB2 for LUW and I think it'll work on DB2 for z/OS but that'll depend on whether they've finally added support for VALUES or not; if they haven't just use SELECT foo FROM SYSIBM.SYSDUMMY1 in the base case instead). …
answered Nov 20 '15 by Dave Jones
1
vote
maximum size specified. For more information on the particular error you can use the "db2 ?" facility. In this case, the error page is particularly verbose (there are many sub-categories) so here's a … sample of the output: $ db2 ? sql0289 [109/109] SQL0289N Unable to allocate new pages in table space …
answered Sep 2 '16 by Dave Jones
1
vote
Whilst the audit policy created by CREATE AUDIT POLICY is database-wide, it is applied to individual objects or roles by the AUDIT statement. For example, to audit statement executions (successful or …
answered Dec 14 '16 by Dave Jones
2
votes
The DB2 for LUW reference does have a section under high availability entitled "Scenario: Changing the system clock" which goes through the implication of moving the system clock forwards or … function's creation (this is listed in the chapter linked above) Mostly important, if you are using point-in-time recovery (archived logging in DB2 parlance) you will be unable to restore transactions …
answered Mar 24 '15 by Dave Jones
3
votes
As Tom V's answer notes, db2level is the simplest means of learning the version of a DB2 instance, but there are a couple of issues with it: firstly that one must have shell access to the server, and … secondly, one must be careful that the appropriate db2profile environment is sourced when running db2level (it's entirely possible, even common in my experience, to have multiple versions of DB2
answered Apr 24 '15 by Dave Jones
3
votes
statement, then set it back to the default (5) and run EXPLAIN again. If you get different plans with the other optimization levels, this may provide a clue as to the paths DB2 is taking in optimizing your …
answered Mar 24 '15 by Dave Jones
2
votes
The APPID in the diagnostic log entry contains the IP address and port, albeit encoded in a weird manner (see note 11). The APPID is formatted address.port.timestamp. When the connection is local the …
answered Sep 5 '17 by Dave Jones
2
votes
Another way of doing this is a FOR loop only executing DROP statements for objects that exist. It's frankly overkill for a single object but it's useful when dealing with schema loads of things. For e …
answered Sep 1 '17 by Dave Jones
1
vote
Several years ago I did put together a package of db2utils which included a procedure called DROP_SCHEMA. This was written before ADMIN_DROP_SCHEMA became available in DB2, and uses a fairly crude … SELECT DDL FROM TABLE(X_DROP_LIST(ASCHEMA)) ORDER BY CREATE_TIME DESC DO EXECUTE IMMEDIATE D.DDL; END FOR; END This is simple, but crude especially in light of DB2's …
answered Nov 24 '16 by Dave Jones
3
votes
for DROP WRAPPER). However, ATTACH, CATALOG, and UNCATALOG are entirely different beasts. They don't operate on a DB2 database, rather they affect a DB2 instance. I'm not aware of a method of executing …
answered Dec 29 '16 by Dave Jones
1
vote
more recent backups are more valuable than aged backups, which is generally the case). In DB2, there are several database-level configuration parameters which dictate when automatic backups are retained …
answered Dec 8 '16 by Dave Jones
1
vote
I'm no expert on DB2 for iSeries (my only experience with it is helping others online!), so this may be entirely wrong... I think support for the standard INFORMATION_SCHEMA was only added recently … . As in DB2 for LUW (which I'm rather more familiar with), INFORMATION_SCHEMA is probably just a relatively thin set of views over the "real" system catalog which on DB2 for iSeries used to be in the …
answered May 29 '15 by Dave Jones
2
votes
considered proprietary by IBM (it is technically source from DB2 itself after all). Anyway, if you look through the view source (you'll want to re-format it first with some SQL lint-like tool!) you'll … undocumented, and a bit of a pain to work with (however in things like DB2 for z/OS which lacked SYSCAT last time I worked with it, they're the only tables you've got). The views not starting with SYS in the …
answered Feb 22 '17 by Dave Jones