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.

274 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,916
  • 5
  • 34
  • 55
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 - Slava Ukraini
  • 23,842
  • 3
  • 34
  • 72
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
1 answer

What does 0 mean next to the db2sysc process?

On Db2 v11.5 on Linux if I execute a command to check if database instance is up and running: ps -e -o command | grep db2sysc the output is: db2sysc 0 What does the number 0 means? I am just asking because, maybe this could be useful to use in bash…
folow
  • 523
  • 1
  • 6
  • 25
3
votes
0 answers

Linked Server - Cannot create an instance of OLE DB provider "IBMDADB2.DB2COPY2" for linked server "MYDB2"

I would like to create Linked Server from SQL Server 2016 on Windows to Db2 v11.5.7 on Linux/x86. I created linked Server using Microsoft OLE DB Provider for DB2 and it works fine. Now I would like to create Lined Server using IBM Db2 provider and…
folow
  • 523
  • 1
  • 6
  • 25
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
  • 1
  • 10
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 - Slava Ukraini
  • 23,842
  • 3
  • 34
  • 72
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
  • 335
  • 1
  • 2
  • 16
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 - Slava Ukraini
  • 23,842
  • 3
  • 34
  • 72
1
2 3
18 19