Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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.

Filter by
Sorted by
Tagged with
1
vote
3answers
758 views

Using db2look to mimic a database?

I'm in the process of migrating some databases from iso8859-1 to utf-8. One of the databases contain 1000+ tables, loads of procedures, functions, triggers, constraints etc. I would like to automate ...
2
votes
2answers
2k views

DB2 cookbook by Graeme Birchall?

Not sure if this question is appropriate here but I believe that it is of some interest for the db2:ers of the site. Once upon a time the DB2 Cookbook by Graeme Birchall could be downloaded from: ...
0
votes
1answer
33 views

Unable to alter table - reason code is 10

I'm trying to run this: ALTER TABLE AMMLIBT.SAGRPPF ADD UNIQUE (ID) ADD CHECK ( IS_BUDGETABLE IN ( 0 , 1 )) ; Which gives me this: SQL State: 55019 Vendor Code: -7008 Message: [SQL7008] ...
0
votes
2answers
37 views

Archive old data in a large table in DB2

I have a very large non-partitioned table with ~4,500,000,000 records: ODS.LARGE_TABLE. The table has stored 3 months of data with ~50,000,000 rows per day, therefore resulting total of ~4,500,000,...
1
vote
1answer
312 views

DB2 zOS increasing DSSIZE vs adding partition?

I'm trying to load data into a DB2 table. The tablespace has 3 partitions with about 60M,60M,70M rows. The 3rd partition is failing to load. It gives me a warning that loading this partition's dataset ...
0
votes
1answer
18 views

DB2: how to export data file and own by db2inst1 via ADMIN_CMD

There is some requirement that I need to run the export command in Java via JDBC. Hence below is the command I execute CALL SYSPROC.ADMIN_CMD('EXPORT TO /tmp/header.csv OF DEL SELECT * FROM MYTABLE');...
-1
votes
2answers
32 views

db2 select statement from a table name where the table name is a variable [closed]

I need to select all the table row count from a db2 database. I have a query to select all the schema and table name: select rtrim(tabschema)||'.'||rtrim(tabname) as tableName from syscat.tables ...
1
vote
0answers
15 views

Support for JDBC 4.2?

As far as I can tell, the jcc driver shipped with 11.5 (https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads) still uses JDBC 4.1. Any rumours of, if a later fixpak will switch to ...
0
votes
1answer
24 views

How to ensure database is cataloged

I am planing to upgrade my database. I am referring to this website: https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.qb.upgrade.doc/doc/t0007193.html On the Before you begin ...
0
votes
2answers
29 views

Errors in DB2 8.0 db2diag.log

We have a very old PeopleSoft HR system running on DB2 8.x. Numerous times a day we get the following errors in the db2diag.log file. 2019-11-04-01.22.24.012784-300 E16054C794 LEVEL: Error (...
0
votes
0answers
34 views

DB2 iseries query without cache

Is it possibile to perform a query without using cached data? I need to test many similar queries and I need to compare process time. To make the measures comparable, I need to run each query without ...
1
vote
1answer
25 views

Any impact of upgrade db2 from V10.5 to V11.5?

Good day, Due to the DB2 v10.5 will end of support on next year April. I would like to change my application database version to v11.5. Before apply this to production, I do it in my local VM first....
0
votes
0answers
17 views

Commvault DB2 Agent Archive issue

We are facing issue with Archive deletion from the last 45 days. Scenario: We have installed the Commvault DB2 agent on a Unix server and we have provided the path during the installation as ...
0
votes
1answer
213 views

1 out of 3 Transactions in DB2 fail with SQL 998, State 58005, error code 8, sub code 2

We have a few back-end applications using an XA switch module connected to a DB2 (10.5). 2 or 3 transactions will pass until this shows up: I’ve found this document that talks about “Code 998, state ...
1
vote
1answer
28 views

Disable autocommit for DB2 connection in Oracle SQL Developer

I am connecting to the DB2 database using oracle SQL developer, but automatically it is committing, i checked in the advanced menu the auto commit feature is turned off. I am confused now, can someone ...
0
votes
1answer
28 views

Recursion only if a criteria is met

I'm using DB2 V7 and I have a two table PARTLIST and PARTTYPE as follow : CREATE TABLE PARTLIST (PART VARCHAR(16), SUBPART VARCHAR(16), QUANTITY INT, ...
-1
votes
1answer
25 views

Product part Query (BOM) [closed]

I'm using DB2 V7 and i have a product table like below : select * from product; Product |Component|Quantity |Line number| --------+---------+---------+------------ Product1|Part1 |1 |1 ...
0
votes
1answer
157 views

DB2 importing/replacing fields from a file that contains XML [closed]

In two tables I have a column called table1.column_xml and table2.column_xml_2 defined as CLOB(1000000). The fields in the column contain XML formatted information like below column_xml ...
0
votes
1answer
38 views

db2 expired password but cannot reset

Has anybody encountered this problem with a db2 server? I'm running a development database and connecting to the database gives me a password expired error. Trying to reset it will give me an invalid ...
-3
votes
1answer
29 views

Create a trigger that will prevent any one from updating personal information of others [closed]

I'm trying to create a trigger in DB2 that will prevent any one from updating any personal information that does not belong to them I.E. FIRST_NAME, LAST_NAME, EMAIL , PHONE_NUMBER columns. I'm trying ...
0
votes
1answer
367 views

Query DB2 without using Openquery

Is there a way to query a DB2 Linked Server without using Openquery? IE, is it possible to query DB2 through a linked server by doing something like the following? select * from [db2_linked_server].[...
0
votes
1answer
20 views

Switching context between two instances from one account

I have a server with two instances running on it (a dev environment) where we use one login to access either instance. I wanted to be able to switch context from one instance to the other without ...
0
votes
2answers
34 views

How to change default db2 database admin username to something else in Linux?

I have a DB2 database version 11.1 on Linux - rhel 7.7 in my test environment. I need help on how to change the default db2 admin username to something else, ie. db2inst1 to dbroot. And the new db2 ...
0
votes
1answer
16 views

What's a way/ways to return Identity element (that is auto-generated) in a table from a stored procedure?

I have tables in my db with auto generated primary keys that I want to get a hold of when inserting new rows from my Java calling code. I'm trying to create stored procedures that handle the insertion ...
4
votes
3answers
14k views

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 | ...
0
votes
1answer
121 views

Connection Error while connecting SQL Developer with DB2

I am trying to connect Oracle SQL Developer with DB2 Database. I have added db2jcc4.jar, db2jcc.jar and db2jcc_license_cu.jar Libraries in "Third Party JDBC Driver" DB2 tabs appears Entered Username ...
0
votes
1answer
30 views

Conditional Join in DB2

2 tables are given Table T_PRICE P_Price P_Type P_Route 15 red long 10 long 5 small Table T_ROUTE R_Type R_Route blue long red ...
1
vote
2answers
56 views

Differences between EDU and thread

In DB2, there is this command that shows active EDUs (engine dispatchable units): db2pd -edus There are two fields in the respective output: EDU ID and TID. According to this db2pd page from the ...
1
vote
1answer
534 views

How to retain backups if automatic backup is enabled

Is there a way to retain the backups or configure the interval when they are deleted? According the manuals it's not possible: "If backup to disk is selected, the automatic backup feature will ...
0
votes
2answers
45 views

How to journal tables in SQL?

Say I have a C# script that creates 50 tables in MYLIB. Currently, after running the script, I have to go into System i Navigator and manually attach the MYLIB/USRJRN to each of the tables' ...
0
votes
1answer
1k 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
31 views

Pending changes from a finished job

I'm getting the following error: Uncommitted changes pending for file MYTABLE in library MYLIB. CPF325E Cause . . . . . : Uncommitted changes are pending for file MYTABLE in library ...
0
votes
1answer
38 views

How to access Multiple DB2 Relational Databases In A Single Query

I need a solution for below: There are Two DB2 instances with two authorization ID on the same server and can be access using same user User1. Example: To access Inst1DB, I use the following ...
1
vote
1answer
113 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
2answers
117 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 ...
2
votes
1answer
1k 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 ...
2
votes
2answers
1k views

DB2: Database alias already exists when cataloging

SQL1005N The database alias "XYZ" already exists in either the local database directory or system database directory I am an accidental DB2 LUW on linux administrator; primary background in MSSQL ...
0
votes
4answers
3k 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 ? What I mean is to export all the tables in a schema without specifying table names. Maybe ...
0
votes
1answer
3k 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, ...
0
votes
1answer
36 views

adding 2nd catalog for linked server to DB2

I am unable to figure out how to add multiple catalogs for a DB2 linked server. I have an initial Linked server setup and working properly, but I am struggling to figure out how to add multiple ...
1
vote
2answers
64 views

DB2 Load Utility Primary Key vs. Unique Index

In short, does the Primary Key double as a Unique Index? Some background: I am trying to load a bunch of data into two tables using the DB2 Load utility loading in IXF file types. The data is ...
0
votes
1answer
428 views

DB2 big strange problem - database is returned to CIRCULAR mode but archive logs keep coming to old archive location

my DB2 database (v 9.7) is in Circular mode. Current Logging Type:Circular (USEREXIT) = OFF (LOGRETAIN) = OFF (LOGARCHMETH1) = OFF (LOGARCHMETH2) = OFF (LOGPRIMARY) = 10 (LOGSECOND) = 10 Path to log ...
0
votes
2answers
33 views

How to I get a list of non subscribed users from this database?

I have 2 tables. 1) subscription_types | type | 'type1' 'type2' 2) subscriptions | user | sub_type | subscribed | 'U1' 'type1' 'Y' 'U1' 'type2' 'Y' 'U2' 'type1' 'Y' ...
1
vote
2answers
132 views

Db2 REORGCHK returns the SQL2310N (Error “-668”) message

I have a Db2 database on my Linux laptop. The database is not heavily loaded. I access it from time to time for the development purposes. I removed a column: db2 "alter table SCHEMA.TABLE drop ...
2
votes
1answer
132 views

Check if encrpytion key is valid in DB2

I have a DB2 table where one of the columns is encrypted using the two parameter variant of ENCRYPT (so the password is supplied in the SQL itself). Unfortunately due to an ETL issue the column got ...
0
votes
2answers
319 views

CHARINDEX equivalent in DB2

I am trying to select the domain from the column where I have email addresses. For example, I have a table email_table and a column email with email addresses as below. johndoe@gmail.com jhefid@...
2
votes
2answers
230 views

Why do SQL Server uniqueidentifier values look different when converted to Db2?

I am currently trying to convert a SQL Server database to DB2. I am using the Data Conversion Workbench (DCW) for IBM Data Studio. The issue I have is that DCW can not seem to correctly extract data ...
1
vote
1answer
92 views

DB2 SUM of MAX values, single table

I have looked through many of the questions asked and answered but can't seem to find my answer, even kludging the provided answers into my queries - most usually fail, the remainder provide garbage ...
0
votes
1answer
22 views

DB2 Audit Policy not producing EXECUTE data

I'm trying to set up an Audit facility on a DB2 AWSE V10.5 FP5 database running on Red Hat Linux Server 6.8. The definition for the policy is : ALTER AUDIT POLICY Failures CATEGORIES ...
-1
votes
2answers
43 views

Get longest strings in DB2 column

I'm trying to get the longest strings in a given DB2 table. I know the max length of the columns from the schema, but I want to generate a report showing the longest actual values. For example, if ...