Questions tagged [db2-luw]

For questions about IBM Db2 for Linux, UNIX, and Windows. Please also add the generic [db2] tag.

Questions regarding all versions and features of Db2 for Linux, UNIX, and Windows.

197 questions
18
votes
2 answers

Why doesn't DELETE + REORG free diskspace (DB2)?

In DB2 I have a table containing large binary data. Now i purged the whole table and ran runstats, reorg, runstats, but the amount of disk space taken does not change. What could be wrong here? The table resides in its own tablespace which I created…
6
votes
2 answers

Cannot connect to DB2 database after restoring an offline backup

This is for DB2 9.7 Enterprise Server Edition on AIX. I had a full, offline backup taken of several databases within our instance in a performance environment. I wanted to restore these databases to our integration environment. I ran the command db2…
Chris Aldrich
  • 4,846
  • 5
  • 29
  • 54
5
votes
3 answers

Split comma separated entries to rows

I have a table like this: | ID | OtherID | Data +--------+-----------+--------------------------- | 5059 | 73831 | 5103,5107 | 5059 | 73941 | 5103,5104,5107 | 5059 | 73974 | 5103,5106,5107,5108 And the result should return…
Yuri Marques
  • 51
  • 1
  • 1
  • 2
5
votes
1 answer

What is the meaning of `(ORDER BY x RANGE BETWEEN n PRECEDING...)` if x is a date?

In another thread: https://stackoverflow.com/questions/37759659/db2-query-to-find-average-sale-for-each-item-1-year-previous the OP wanted a sliding average for the last 365 days. Using ROWS BETWEEN ... would be fine if it where guaranteed that…
Lennart
  • 20,804
  • 2
  • 26
  • 61
4
votes
1 answer

How do you generate the DDL that created a DB2 LUW database?

There are various options for db2look you can use to see the DDL for just about every object in the database except the command that created the database itself. Is there any way with db2look, or perhaps with some other system command, where you…
4
votes
2 answers

Do I need to RUNSTATS after a REORG in DB2?

The REORG documentation says: BUILD Builds indexes. Updates index statistics. But I have always heard REORG/RUNSTATS as if they should be paired. Can anyone verify that "Updates index statistics" achieves the same thing as RUNSTATS?
Lucas
  • 369
  • 2
  • 5
  • 15
3
votes
1 answer

DB2 9.7, create or replace tablespace possible?

I am creating my tablespaces in the sql scripts that create the database schema. This causes a problem in continuous integration processes, where consecutive execution of the script is not possible because it always tries to create a new instance of…
user1340582
  • 193
  • 4
3
votes
1 answer

DB2: The transaction log for the database is full, But there is no 'First active log file'

First, I wish to say that I have very little experience with DB2. However, I've been tasked with tracking down the problem and solution to this problem. This is a DB2 database, and our testers are saying that they get: The transaction log for the…
user25849
  • 133
  • 1
  • 1
  • 5
3
votes
2 answers

Display line number where error occurred in DB2 stored procedure

I have added an EXIT handler in my procedure that captures the SQLSTATE and SQLCODE, and even found a way to get the procedure name, but I also need to know where the error occurred. Suggestions greatly appreciated. declare EXIT handler for…
Jake v1
  • 73
  • 8
3
votes
2 answers

New bufferpool not being used

As part of a migration, I created a new bufferpool - say BP8K - size 8K, and a tablespace using that bp, and a table in that tablespace, that is loaded with data. However, I get a: SQL1218N There are no pages currently available in bufferpool…
Lennart
  • 20,804
  • 2
  • 26
  • 61
3
votes
3 answers

In DB2 LUW, When should I use a 4K, 8K, or 16K tablespace rather than just creating a 32K tablespace and being done with it?

We're using DB2 LUW 10.5 & 11.1 on Windows & Linux systems, in case it's relevant to he answers. Question: Is there a time where it would be correct to use 4K rather than 32K? If so, why? (Does it perform better when it can be used?) Or, is it just…
Joe Hayes
  • 315
  • 1
  • 2
  • 14
3
votes
1 answer

DB2 Tablespace in state Restore pending

I have the problem that in my DB2 database (SLES, Db2 v10.5) my User Temp Tablespaces are all in state Restore pending, Storage must be defined, Storage may be defined. When I set off the following command db2 list tablespace I get the following…
Thomas Graf
  • 31
  • 1
  • 2
3
votes
1 answer

What might be the reason for licence compliance violation?

Much to my surprise we got a licence compliance violation for our DB2 Workgroup Server Edition installation regarding: ~]$ db2licm -g tmp.txt ~]$ cat tmp.txt License Compliance Report DB2 Workgroup Server Edition Violation Materialized…
Lennart
  • 20,804
  • 2
  • 26
  • 61
3
votes
1 answer

Java version shipped with DB2 v11?

I can't seem to find any information of which Java version that will be used in the soon to be released DB2 V11.1. Does anyone else know?
Lennart
  • 20,804
  • 2
  • 26
  • 61
3
votes
1 answer

non-optimal use of index

I'm somewhat puzzled by the scenario below. The table involved (relevant parts) is defined as: CREATE TABLE Nya. UPSEC_COURSE ( UPSEC_COURSE_ID CHAR(11) NOT NULL, CORE_UPSEC_SUBJECT SMALLINT NOT NULL WITH DEFAULT 0, …
Lennart
  • 20,804
  • 2
  • 26
  • 61
1
2 3
13 14