Stack Exchange Network

Stack Exchange network consists of 175 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
25 views

db2 cross platform function/variable?

Is there a db2 function/procedure/variable that can be used to determine what platform a data source origins from? sysibm.sysdummy1 exists, so I assume that this is Db2, but some of the SQL does not ...
0
votes
1answer
15 views

How to stop a db2 instance properly?

I have a db2 instance, and I need to stop it properly, clean, without any db2stop force. I need this in order to restart it fast in a batch process. I am completly sure there are not connections or ...
0
votes
0answers
31 views

drop_cache effects on database

I have several machines with: databse: db2 10.5 OS: CentOS 6.9 on some of machines cached memory is high and i need to run this command to free some memory: echo 3 > /proc/sys/vm/drop_caches ...
0
votes
0answers
12 views

db2 update dbm cfg fails with error: SQL5133N. Specified value: “0”. Configuration parameter name: “fcm_buffer_size” [closed]

I am trying to load SSL certificate from java keystore to db2 dbm. I did below steps: Step 1: List certificates in truststore $ keytool -list -v -keystore db-truststore Enter keystore password: ...
-3
votes
0answers
18 views

DB2 Connect Using JKS file (SSL) [closed]

I have a DB2 data source which I am trying to connect from Unix Box. Application uses jks file for authentication. Can you please guide how to connect such data source using JDBC connection ? Any ...
0
votes
2answers
30 views

Is it worth duplicating a table for different types of an entity when one should be unique?

In my database, I have a CUSTOMER table. I'm migrating an OPPORTUNITIES table, which contains two different types of opportunity, each having identical columns (e.g. status, reason lost, probability ...
1
vote
1answer
40 views

Error on Datastage when I try to write on AS400

I'm having troubles to operate an ETL process on DataStage. I have the following error log: #TABLE#,0: ODBC function "SQLExecute" reported: SQLSTATE = HY000: Native Error Code = -332: Msg = [IBM(...
0
votes
1answer
27 views

Are iSeries AS/400 (DB2?), Lotus 1-2-3, and Excel date/time formats the same? [closed]

Are the formats for dates/times from AS/400, to Lotus 1-2-3 that carried over into excel...with the date being the number of days since 1900-1-1 when mistaking 1900 for a leap year as an integer, and ...
1
vote
0answers
34 views

IBM db2 FOR XML equivalent

I've been trying to Query an item with its sublist all in one go and one way is to use for xml and subquery. I've been using this strategy with sql server and works fine. The relationship is Order ...
0
votes
1answer
21 views

DB2 LUW V10.5 on Windows. How to Manually rotate the Diaglog using scripts

In DB2 LUW V10.5 on Windows, is there a way to manually rotate the diaglog log file? Currently, it is almost 1GB and it is difficult to open it to find info.The diagsize is set to 0 and I cannot ...
-1
votes
2answers
32 views

How to convert DB2 database to Microsoft SQL database [closed]

Is it possible to convert databases from DB2 at Linux to Microsoft SQL at windows ? and what is the correct steps ?
1
vote
2answers
48 views

How can I lock row for reading/updating in DB2?

I am trying to resolve a race condition in my application. I have a table that is used as a work queue and many threads and read/update it. The following query is executed from application. First it ...
0
votes
1answer
32 views

Duplicate entries - condition on second table with join

I have 2 tables (1. PLATE, 2. MOVEMENT). First table contains some duplicate plate numbers. Every plate number (Fields: PLATE_ID, PLATE_COUNTRY, PLATE_NUMBER) has an unique id, which exists in ...
0
votes
1answer
68 views

DB2 select from final table update gives SQL0199 error

Goal: I am trying to retrieve records that were affected by UPDATE query. Based on IBMs article I can use the following query: SELECT empno, salary FROM FINAL TABLE (UPDATE employee SET salary = ...
0
votes
1answer
154 views

DB2 - how to call a stored procedure that returns a result set in another user defined table function

I have a db2 stored procedure that takes in some parameters, gets some data from somewhere and then returns a result set through a cursor. Now I want to write a table function in db2, that will call ...
0
votes
2answers
51 views

What's default path for “db2move export” command's output

What's default path for "db2move export" command's output in Linux RedHat 7.2 and how to change it to specific folder?
0
votes
1answer
56 views

DB2 start tuning needs privilege

When I run "start tuning" by db2 data studio it gives me the below message. This still happens when I run it under user "db2inst", the default user which I configured when I installed db2 on RedHat 7....
0
votes
2answers
62 views

How can I create rows without an underlying table in IBM DB2 SQL?

In T-SQL, I can execute the following: SELECT * FROM (SELECT 1 AS n UNION ALL SELECT 2 AS n) AS t; In IBM DB2 SQL, this fails with: [IBM][System i Access ODBC Driver][DB2 for i5/OS]...
0
votes
2answers
59 views

Multiple queries in merge into statement

I have a scenario where i want to insert record if it doesn't exist in DB2. If it already exists update is_active column to 0 of the existing row and insert the new row with is_active as 1. I cannot ...
0
votes
1answer
44 views

Migrated data with Special Characters Counted as 2 Characters in DB2 Linux

We are currently migrating data from DB2 10.1 AIX to DB2 11.1 Linux. Since we are using some features like versioning/history tables and rowchangetimestamps, db2move is not an option for some tables. ...
-1
votes
1answer
35 views

Is the index created as soon as data is inserted into a table? [closed]

For example I have a table and I created an index on ID column which generates numbers every time I insert a row. If I only insert 5 rows does index tree start to be created or is there a threshold of ...
2
votes
1answer
47 views

DB2: Left Join Over-ridden by Where clause?

I have a query that uses a left join. There are some instances where no matching records will be present in the joined table but I still want all the records from table A that match to be returned. ...
1
vote
1answer
35 views

determine page size for index

I'm in the process of migrating a set of databases from code set ISO8859-1 to UTF-8, STRING_UNITS=CODEUNITS32. I suspect that quite a few indexes will no longer fit in there current tablespace page ...
-1
votes
1answer
36 views

DB2 reporting incorrect filesystem full error? [closed]

DB2 V10.5, RHEL 7.5 We had an issue when DB2 was stuck not being able to write log files to disk because of disk full error just that there was more than enough free disk space on the filesystem ...
0
votes
2answers
51 views

Monitor delete statements on a specific table on DB2 LUW

Background User is claiming that records are deleted from a specific table, but nobody knows why. They are not sure if it's an application error or done by a user. Question Is it possible to ...
0
votes
2answers
40 views

DB2 multiple rows with the same value

This is my first time posting in stackexchange, and I hope I did my due diligence for this question. I'm working on a problem that I just can't seem to wrap my head around. Consider this scenario of a ...
0
votes
0answers
40 views

Counting up date - DB2/SQL

A table is given with the columns customer, entry_date, exit_date. I need a query that shows me each customer and counts up the entry_date in 10 day intervals, but only up to the exit_date. The ...
0
votes
0answers
52 views

Is it possible to implement automation for Oracle and DB2 with Jenkins and or Ansible?

I'm curious if anyone has successfully used Jenkins and/or Ansible for automating routine tasks for Oracle and DB2 databases. From what I've looked up online options seem very limited. So far ...
1
vote
2answers
33 views

My application uses set schema and unqualified tables and I get confusing numbers from snapdyn_sql

More of a finding, than a question, I'll add an answer in a minute. The other day I stumbled upon an application that used several tables with the same name, but in different schemas. Example: ...
0
votes
1answer
33 views

Using a DB2 merge with conditionals for matches?

Within a PHP script I'm running a working merge but I need to add date conditionals to it, and my updates cause it to no longer work. The logic I'm looking for is this: If there's a match AND the ...
-1
votes
1answer
40 views

Root node creation in db2 xml

i am able to create the xml node in db2 but all the node creation i need under root node. below code i have written as: CREATE FUNCTION abc.sample(v_pf_wkstn_oid_sh smallint, ...
0
votes
1answer
160 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
91 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
33 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
54 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
189 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
195 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
29 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
33 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
1answer
123 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
vote
1answer
157 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
27 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
47 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
59 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
votes
1answer
154 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
339 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
67 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
180 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
506 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
105 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?