Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [db2]

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.

0
votes
1answer
27 views

SQL Server - Query Over Linked Server to IBM DB2 throws an error

We have a partner that uses a IBM DB2 iAccess database, which we connect to using a linked server on our SQL Server. It's been working great for a long time, but over the weekend they upgraded their ...
0
votes
1answer
57 views

How to Restrict INSERT operations on table for DB2?

I have a table OAUTH20_TOKEN_CACHE for which I have restricted INSERT operations by running below command. db2 REVOKE INSERT ON HVD121.OAUTH20_TOKEN_CACHE FROM USER HVD121 This could be seen ...
0
votes
1answer
24 views

OS killed some of databse demons

I have 2 HP servers with CntOS 6 as OS and DB2 10.5 as Database. there 2 servers are HADR. standby server suddenly rebooted and when i checked log it said that OS had killed 4 db2 demons. IBM....
2
votes
0answers
38 views

Can we prevent creation of directory NODE0000 during db2 rollforward db <db_name> end of logs with overflow log path option?

I am using command rollforward db ABCD to end of logs overflow log path ('/db2backup/logs') to apply DB2 archived logs to my staging database. My staging database is in rollforward pending state. ...
-1
votes
2answers
81 views

DB2 Join with case when statement or union [closed]

How can I use a case statement in a join? Given: 3 Tables Dealer DEALER_NO CUST_ID 001 100 002 200 003 300 Table: Customer CUSTOMER_NO NAME CUSTOMER_MAIL 100 JOHN ...
1
vote
1answer
94 views

Select subquery CHECK constraint DB2

I have 2 tables: TVSHOW and ACTOR. I want to reject records if the inserted actor in TVSHOW does not exist in the ACTOR table using DB2. db2 "ALTER TABLE TVSHOW ADD CONSTRAINT check_actor CHECK (...
0
votes
1answer
26 views

IBM DB2 Timetravel logging based on some criteria

I have been searching for the condition, where, lets say when we enable time travel to a certain table in DB2 , but don't want to capture all the updates done, but only the updates that's done by ...
1
vote
1answer
27 views

History Question: DB2 Nomenclature

I realize this is a little random, but DB2 (circa V8) had a feature to define tables from the CREATE VIEW syntax. Basically, the view was saved to disk to save the cost of recreating the dataset each ...
0
votes
0answers
37 views

log rotate error in /var/log/messeges

i have a server with CentOS 6 as Os and DB2(10.5.0.5) database. i saw that our monitoring agents get connection but they dont close it. then i checked /var/log/messeges and saw this error: Nov 18 ...
0
votes
1answer
39 views

Data Migration: Unload/load of GENERATED ALWAYS TIMESTAMP

While migrating data from one Db2 database to another we need to retain the ROW CHANGE TIMESTAMP of the migrating data in the target table CFFOLIO.FOLIO We have a ROW CHANGE TIMESTAMP attribute in ...
-1
votes
0answers
25 views

xquery select on attributes

There is a table A with date column named logdate and xml column named tag which has xml value like this: <process id="1540193803286" startTime="2018-10-24 10:01:26.467" > <user> <...
1
vote
1answer
60 views

Cannot drop primary key or add primary key

This db2 query: alter table mylib.mytable add primary key(field1, field2, field3) returns [SQL0624] Table MYTABLE in MYLIB already has a primary key'. However alter table mylib.mytable drop ...
0
votes
1answer
22 views

DB2 Workfile scan

We just migrate from LUW to zos and we're finding that in z/os the accesspath explains show new node named WFSCAN (Workfile scan) and this rises when there is a join, group by or any kind of sort. ...
0
votes
0answers
32 views

Db2 and java11?

Any rumors on when Db2 (LUW) will officially support Java 11? As of now, the officially supported version is 8: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.qb.server....
0
votes
2answers
49 views

DB2 huge IREF and lots of scans

I received a task from one of my colleagues to check why he always receives high CPU load alerts. I don't have too much experience with databases and I need some clarifications. I created a script to ...
1
vote
0answers
41 views

Best Practice „Db2 authentication via external Directory Service“ [closed]

I try to determine the best way for us to connect out Db2 environment (Linux only) to an external directory service like OpenLDAP or MS Active Directory. As far as I know there are basically two ...
-1
votes
1answer
63 views

DB2 rollforward fails

I get the following error when I try to do a point in time recovery [inst20@localhost ~]$ db2 rollforward database sample2 to 2018-09-01-15.16.00 and stop SQL4970N Rollforward recovery stopped ...
0
votes
1answer
147 views

WCS8 Solr Preprocess failed : Error SQLCODE=-601, SQLSTATE=42710, SQLERRMC=WCSSTGAP.XI_CATENTRY_PRICE_0

Our Solr Pro-process is failing with below error: [2018/08/28 14:31:36:104 CDT] 00000001 W com.ibm.commerce.foundation.dataimport.preprocess.AbstractDataPreProcessor:createDBTable(Connection, ...
1
vote
1answer
43 views

DB2 10.5 stored Procedure question

I'm having an issue with a stored procedure in DB2 LUW 10.5 using Data Studio 4.1.3 when trying to call more then one statement at a time. I've narrowed the problem down to the way semi-colon's (;) ...
0
votes
1answer
107 views

Db2 LDAP security plugin error

I'm playing around with the LDAP security plugin. I noticed that after a certain amount of grants I get an error that the ldap server can't be reached: SQL30082N Security processing failed with ...
0
votes
3answers
207 views

Cloning a Db2 database within a single instance

I need to create an exact copy of a Db2 database (V11.1+) on the same server within the same instance. (This is a development server that does not run production databases.) This is how I do it now. ...
0
votes
1answer
56 views

IBM DB2 Data Studio Web Console Installer [closed]

I would really like to test the Web Console for Data Studio to see if it will do what we need. However, I absolutely cannot find an installer/download for it. Can anyone help?
0
votes
1answer
671 views

Insert into DB2 table a result from temp table

Is there a way to insert a temp table results to DB2 table, for example: WITH TEMP1 AS ( SELECT CUSTOMER_ID FROM T_CUSTOMER WHERE CUSTOMER_ID BETWEEN 100 TO 300 ), TEMP2 AS ( SELECT CUTOMER_ID, ...
1
vote
1answer
203 views

DB2: Why does translate function also replace spaces?

I would like to remove control characters (HEX \x00 until \x7F) from a DB2 data base field. For this I tried to apply the following translate-function: TRANSLATE(field, 'X', x'...
0
votes
1answer
22 views

DB2 GLOBAL VARIABLES Refresh for datapool managed sessionis

I've recently discovered the feature of defining global variables for DB2. I wanted to utilize it. My use case is to create a variable containing the value for Previous Banking day. CREATE VARIABLE ...
2
votes
1answer
365 views

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 ...
3
votes
2answers
614 views

Check Java Driver version in clients from Db2 server

I have a Db2 database that is being used by many applications in different servers. I want to check from the Db2 server if the Java driver used in the different client applications is up-to-date. Is ...
0
votes
1answer
50 views

What is the purpose of the “territory” configuration parameter?

This is the command that I use to create a new Db2 database in my project: db2 create db <DATABASE_NAME> using codeset 1251 territory ru Unfortunately, there is no documentation left and I ...
0
votes
0answers
40 views

external authentication of database users in Db2

For a future project, I am looking into authenticating Db2 database users via LDAP and PAM. However, it seems that LDAP server is deprecated in RedHat: https://access.redhat.com/documentation/en-us/...
0
votes
1answer
75 views

ibm_db on HADR primary database?

Yesterday I discovered a peculiar thing, it looks like a bug but I'll post it here in case someone seen it before. Testscript: #!/usr/bin/python import sys import getopt import re import os import ...
3
votes
1answer
54 views

Finding rows that are not duplicate

I have two DB2 tables. Table 1, called EmployeeFile EmployeeFile has the following columns: EMP_ID, FNAME, LNAME, DOB The data looks like this: EMP_ID, FNAME, LNAME, DOB - GB2342, John, Smith,...
2
votes
1answer
857 views

How to avoid SQLCODE=-968, SQLSTATE=57011 “The file system is full” error with merge statement [closed]

When doing the following merge (tempchoices is a temporary table created with DECLARE GLOBAL TEMPORARY TABLE tempchoices LIKE CHOICES NOT LOGGED IN importtemp ON COMMIT PRESERVE ROWS) all my diskspace ...
2
votes
2answers
201 views

DB2 on Windows: Fix encoding in db2cmd and for JDBC

I'm running a DB2 v10.5 FP 7 on a Windows Server 2013 and there is a problem with the encoding setup: The windows is set to use German(Switzerland) as region setting and input language. chcp: Active ...
-1
votes
1answer
31 views

Can scripting be done on DB2 Connect instance?

I need to get the number of connections passing through connect server for 1 week. Can we write a script to get the details? Can we only pull the data manually? Is there any way to script it? I am ...
1
vote
0answers
47 views

Database Behavior while executing UPDATE and INSERTs on the same table

My gear: Pentaho BI Server 8.0 AS400 V7 My scenario: I have two processes that sometimes run at same time in the same table. This table has about 600M rows, so, an update can take long time to ...
1
vote
0answers
141 views

Db2 developer community edition installation hung [closed]

Db2 developer community edition installation hung. Problem Description : Cannot install IBM Db2 developer community edition in Windows 10 Environment : Windows 10 English Edition Hyper-V enabled ...
0
votes
1answer
202 views

python ibm_db driver and decimal values?

It appears as if decimal values are treated as strings by ibm_db. Small example: Python 2.7.14 (default, Mar 14 2018, 13:36:31) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux2 ]$ cat aa.py #!/...
0
votes
1answer
1k views

Update using select in DB2

I have 2 tables Table A address_id email 12341 aba@mail.com 12342 abb@mail.com 12343 abc@mail.com 12344 abd@mail.com 12345 abe@mail.com 12346 abf@mail.com 12347 ...
0
votes
3answers
1k views

How to systematically export all tables from a DB2 database schema to csv

Is there a way using a DB2 database to systematically export all tables from a schema to separate csv files ?
1
vote
1answer
33 views

Definition of ROWS_READ?

This may seems like a stupid question, but I cant seem to find a good answer for it. I have a pretty good intuitive understanding of what ROWS_READ in for example sysibmadm.snapdyn_sql means, and ...
1
vote
2answers
84 views

Retrieving auto-generated keys for an INSERT statement

What is the best way to retrieve an auto-generated keys after an INSERT statement ? After searching online for DB2 I found this https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm....
1
vote
1answer
84 views

Will TRUNCATE stop the increase of the DB2 database size?

we are periodically doing the TRUNCATE of some large tables in database. After that in order to release disk space we are doing the command: alter tablespace MAXDATA reduce max and everything works ...
1
vote
1answer
2k views

DB2 - Inserting a timestamp operation result in a timestamp field [closed]

I got a some javascript Dojo code assembling a query from JSON variables and I have been trying to insert a timestamp in it. This is my test table (schema.mdummy): k and v are varchars n is an ...
0
votes
0answers
83 views

Error after DB2 Express 11.1 install

After installing DB2-Express 11.1 on Centos 6 I am running into some problems with some commands. In particular, if I try to look at my autoconfigure settings I get receive an error that binding/...
0
votes
1answer
32 views

Long delay before redirected restore “starts”

On several occasions, I noticed that it takes a long time before anything "happens" during a redirected restore. There are no entries in db2diag.log and list utilities show detailshows: Completed ...
1
vote
0answers
161 views

How can I count affected rows by an insert and a merge statement

I have little experience with DB2. I have been trying to find out how to get the number of affected rows (after insert and merge statements) and/or a success message to give back to my HTTP Post ...
1
vote
0answers
190 views

UOW Waiting IBM DB2 memory usage

We have been encountering lately frequent hanging of our database server. Initial thoughts is its running out of memory. Based on logs, just before this happens, the stmm would reallocate memory. ...
0
votes
1answer
39 views

Count total number of nested one to many relationships

Tables: Users, Costs, Payments Users can have many costs. Costs can have many payments I want to get information about the user AND count of all payments that they made This query returns result ...
3
votes
1answer
283 views

Query A if there is no B

I have a table with columns ID, TYPE, DATE, ... and I need all data sets with TYPE <> 'A' (case 1) and the data sets with TYPE = A if there is no TYPE = B with the same ID (case 2). The first ...
0
votes
1answer
139 views

OLAP window functions in DB2

I am using DB2 z/OS 11.1.5. According to this reference, OLAP functions such as first_value should be supported at least in DB2 9.7. However, when trying to execute the query declare global ...