Questions tagged [db2]

Db2 is a family of relational database management servers developed by IBM. It runs on multiple platforms, including Unix (namely AIX), Linux, IBM i (formerly OS/400), z/OS and Windows.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

How make Db2 database transaction log full fully robust?

Db2 v11.5.7.0 on Linux and for some reason few times per year database hits the transaction log full error. My current solution was to increase logsecond, logprimary or logfilsiz and now I hit to ...
user avatar
  • 57
0 votes
2 answers
19 views

Column data masking security problem

In Db2 v11.5.7 on Linux I have simple table: create table admin.patient_data ( patientid int not null primary key, patient_name varchar(10), illness varchar(15), doctor_name varchar(10) ); insert ...
user avatar
  • 57
0 votes
0 answers
19 views

CSV Resultset for IN clause

I am working on writing a SQL query to get data from 2 tables with inner join and need some help. Here is the scenario. I have 2 tables say A and B. table A Name Value 1 Red 2 Green 3 Blue 4 ...
user avatar
  • 1
0 votes
1 answer
18 views

SQL DB2: I need to filter results based on query results

I would need to get the id's for given input employee_id's and given input date: condition: I need to query for employee's who are enrolled on the given date or less then given date in the input. ...
user avatar
0 votes
1 answer
28 views

db2 - how to get list of all of the Db2 instances on computer

I have several Linux servers and on them may be one or more Db2 instances. Db2 instances can be from different Db2 versions. For security audit I need to write some simple bash script to check for ...
user avatar
  • 57
0 votes
1 answer
24 views

db2 - What is purpose of db2ln and its file system symbolic links?

On Linux/x86-64 I have Db2 v11.1 installed. When I tried to install Db2 v11.5 alongside existing Db2 installation I got error "DBI1004W /usr/lib/libdb2.so detected". I checked and I see ...
user avatar
  • 57
0 votes
0 answers
41 views

How do I configure DB2 on Windows with SSL so that I can connect via ODBC?

DB2 11.5 running on Windows Server 2016 Standard SQL Server 14.0.3430.2 I'm able to set up ODBC with some DB2 databases, but when the DB2 database is secured with an SSL certificate, which they call ...
user avatar
0 votes
1 answer
27 views

db2 - Downgrade of upgraded instance and database?

So far I have always "upgraded" database using clean install (new Linux install etc) inside virtual machine. But now I have requirement to upgrade Db2/Linux from Db2 v11.1 to Db2 v11.5 ...
user avatar
  • 57
0 votes
1 answer
50 views

Can NOT establish connection from db2 client to db2 server v11.5

I installed Db2 v11.5.7.0 on Linux/x86_64 inside my virtual PC using VirtualBox on Windows 10. I created database with name TEST1 I connected to database using Unix socket: db2 connect to TEST1 and ...
user avatar
  • 57
0 votes
1 answer
41 views

Converting Query from DB2 to PostgreSQL, Now takes hours to run

I have a project for converting some web pages from using DB2 to the same data/tables/etc within PostgreSQL. I'm running into an issue where a query that would normally run in less than a second for ...
user avatar
0 votes
1 answer
39 views

db2 applying licensing file produces two licenses

I installed Db2 from fixpack v11.5.7.0 using db2_install command. I have downloaded "IBM Db2 Advanced Edition - VPC Option V11.5.6 - Activation (CC9WHML)" file from IBM Passport Advantage. I ...
user avatar
  • 57
0 votes
1 answer
37 views

IBM DB2 database backup speed

I have a IBM DB2 database on LUW that is around 5TB. Currently the backup of 5TB takes around 24 hours. I am thinking of creating a mountpoint called /dbbackup and that mount point is a LVM powered by ...
user avatar
-3 votes
1 answer
43 views

Migration from Sybase to IBM-DB2 or Oracle?

We are planning to modernize our robust power builder /sybase application , that has around 500+ stored procedures,300+ tables. PB application produces 300+ reports,nothing but datawindows which has ...
user avatar
0 votes
2 answers
69 views

How to get IP addresses of applications that have consumed most CPU in last 10 minutes in Db2/Linux?

Db2 v11.1 on Linux I would like to get top 5 SQL statements that consumed the most CPU in last 10 minutes and there corresponding IP addresses. I queried "package cache" table function and I ...
user avatar
  • 57
0 votes
1 answer
74 views

docker exec --user db2inst1, unable to find user db2inst1: no matching entries in passwd file

I'm playing around with docker and db2 but I'm getting into trouble when I try to execute commands as user db2inst1 into a running container. I start the container as (it is 1 line but I split it up ...
user avatar
  • 21.1k
0 votes
0 answers
34 views

DB2 transparent table aliases for routing

We have a situation where multiple development teams are working concurrently across a dev/uat/prod set of environments. We don't have the resources to maintain dev and uat such that they reflect up-...
user avatar
0 votes
1 answer
37 views

Reorg SYSIBM tables to reduce extents (XT) - change priqty & secQTY

I have a new DB2 V12 database on z/OS 2.4 z13, with hundreds of programs to rebind, such as: sysibm.syspackage, sys.columns, sys.tables, etc. These will grow, hence the need to reorganize the ...
user avatar
0 votes
0 answers
44 views

Using User defined types in DB2 and using the type in a function

I am migrating my database from ORACLE to DB2, While doing the migrations I have come across a situation related to User defined types. As I have been working with DB2 recently, I have been through ...
user avatar
  • 1
0 votes
0 answers
28 views

why does external java function terminate recursive cte?

I made a peculiar observation regarding external functions written in java which I hope someone can shed a light on. I tried it with several functions, but I'll use one of them as an example here: ...
user avatar
  • 21.1k
0 votes
0 answers
33 views

DB2 Community edition on higher core count server

If I run DB2 community edition on a higher core count server will IBM want to charge me for more cores or will the software simply use only 4 cores and 16gb of memory?
user avatar
1 vote
0 answers
29 views

Critical event in PDLOGMSGS_LAST24HOURS

On Db2 v11.1 Enterprise on Linux I have checked "Critical Severity" problems using SQL: SELECT TIMESTAMP, MSG FROM SYSIBMADM.PDLOGMSGS_LAST24HOURS WHERE MSGSEVERITY = 'C' ORDER BY TIMESTAMP ...
user avatar
  • 57
0 votes
0 answers
37 views

Criteria for when a function call can be reused?

I must admit I have not given it much thought previously, but I always assumed that a NOT DETERMINISTIC function would not be reused between function calls, Example: CREATE OR REPLACE FUNCTION TEST1() ...
user avatar
  • 21.1k
0 votes
0 answers
111 views

Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED"). SQLSTATE=08001

I am running into this error when trying to access Db2 through my code, as well as the cloud console. I am using Db2 hosted on IBM Cloud. Security processing failed with reason "19" ("...
user avatar
0 votes
1 answer
38 views

How return dynamic SQL value in procedure

I have a procedure that takes in parameters, and makes a dynamic statement based on those. The statement always returns a numeric value. How do I return that value, or pass it to the variable? For ...
user avatar
  • 1,735
0 votes
0 answers
49 views

db2 How to get the application user from delete events

We use temporal tables to store the history of all changes to specific tables in the db. But we also need the user who made the changes. While on db2 side the user is the application, the application ...
user avatar
  • 1,735
0 votes
2 answers
98 views

Add days to date (char column with decimal) in DB2

I have a table named INVOICE_ET which has column of below definition INVDATE CHARACTER 10 result of select INVDATE from INVOICE_ET is as below INVDATE 2021-07-31 In another table INVOICE_DY, I have ...
user avatar
-1 votes
1 answer
68 views

How to assign minimal privileges for create view

In Db2 v11.1 on Linux we have a request to create a new user with access only to the "create view" privilege. What are minimal permissions I have to set in order for the user to be able ...
user avatar
  • 57
0 votes
1 answer
133 views

Saving results from db2 FINAL TABLE

We have a scenario where we need to add multiple rows to different tables, get the generated primary key ID's, then create more inserts with FK's referring those previously generated ID's, etc. On SQL ...
user avatar
  • 1,735
1 vote
1 answer
36 views

Meaning of "Total work" for build indexes during load

I don't think I ever reflected about it, but I'm currently loading a table from a cursor and list utilities show: Phase Number = 3 Description = BUILD Total Work ...
user avatar
  • 21.1k
0 votes
1 answer
30 views

Downside of adding partitions for the future?

I'm considering moving some of our large log-table to range partitioning for ease of archiving them. They are rarely used for queries, other than support and related stuff. Say my oldest data is from ...
user avatar
  • 21.1k
1 vote
1 answer
265 views

How to get SQL statement in Db2 database for application that is holding lock on table?

I am trying to get SQL statement that is holding the lock on table. Sample: Create table: create table admin.tab (id int not null primary key, col1 int); Insert data: insert into admin.tab values (1, ...
user avatar
  • 57
0 votes
0 answers
35 views

Auomatically detect if database needs rebinding after restore?

In our deploy chain, we restore backups from our master environment and migrate the data models according to whatever branch is deployed to the target environment. Occasionally the db2level for the ...
user avatar
  • 21.1k
0 votes
1 answer
62 views

How to Delete Multiple Rows With Multiple SELECT Statements In WHERE Clause in DB2

In the given inventory table below: SKU COST DATE YYMMDD 202114000 0 210109 202114000 12 210228 202115000 50 210108 202115000 30 210109 202116000 54 210103 202116000 60 210301 202116000 100 ...
user avatar
  • 1
1 vote
0 answers
46 views

Steps to relocate the primary hadr database to a new server?

Currently we have several databases with a HADR configuration where the primary databases are on a Linux Server "A", with the standby all on Linux Server "B". DB2 version is 9.7. ...
user avatar
0 votes
0 answers
125 views

Copying a single database from DB2 10.5 to DB2 11.5

What is the easiest way to copy a single database (has no large objects) from DB2 10.5 Express-C instance to DB2 11.5 Community Edition instance? I tried this method but obviously db2 restore database ...
user avatar
  • 111
0 votes
1 answer
206 views

Meaning of LFL and XHDR in Db2

I have seen the following messages in Db2diag.log but I do not know what they are. I cannot find any documentation about LFL or XHDR. I know it is related to HADR and log archiving, but what exactly? ...
user avatar
  • 579
29 votes
3 answers
5k views

Why is the default page size for databases so small?

In PostgreSQL and SQL Server, the default page size is 8 KB, in MySQL is 16 KB and in IBM DB2 and Oracle it is only 4 KB. Why are these page sizes so small? Is there a historical or memory usage ...
user avatar
1 vote
2 answers
129 views

DB2 Linux authentication fails

I have DB2 Express-C v10.5 instance configured to authenticate against LDAP. The LDAP sever is going to be shutdown and I should configure the same DB2 instance to use Linux authentication. I copied ...
user avatar
  • 111
0 votes
1 answer
139 views

Creating a dynamic db2 reorg script with in-built delay for concurrency

So I'm new to db2, and some of the syntax and other execution restrictions give me trouble. My DB is using DB2 v11.1.2.2. I've created a reorg script which calls the REORGCHK_TB_STATS and ...
user avatar
  • 1,735
0 votes
2 answers
186 views

Cross Database Queries using IBM Data Studio

I'm currently using IBM Data Studio 4.1 to run queries against DB2 LUW database(s). My understanding is that I can do cross database queries by prefixing the database(s) names. For example, database....
user avatar
0 votes
3 answers
890 views

Concat a string to a variable to use as a column name in a query

I have a procedure where I query table a and create variables like this SELECT TRCODE , COLA , COLB , COLC , COLD INTO TRANSACTION_TYPE , HOURS , RATE , FACTOR , APPROPRIATION FROM PR . PREXEC WHERE ...
user avatar
  • 99
0 votes
0 answers
40 views

Checkopenport - DB2 / shell script sample

at DB2 startup we will check, whether the db2 port is in use. In the client DB2 setup we have only one instance / server. the port is always 50020 - for all servers. our idea - netstat -tunlp | grep &...
user avatar
0 votes
1 answer
836 views

Using same table in a UNION multiple times

I am given a query that is using the same table with same columns and filters multiple times and the only thing is changing is the Type which is given manually. I am thinking there must be a better ...
user avatar
  • 103
1 vote
2 answers
25 views

What steps we need to perform from DB end in case of storage migration?

What are the impacts / steps from DB2 DB side before VMware SvMotion Storage migration ?
user avatar
  • 11
0 votes
1 answer
398 views

How do I get DBeaver to do a DB2 UPDATE via Cursor

The following query works when run from the console via db2 command. But fails when running via DBeaver. BEGIN NOT ATOMIC FOR R AS C CURSOR WITH HOLD FOR SELECT ROW_NUMBER() OVER() AS INDEX, ID ...
user avatar
  • 35
1 vote
0 answers
72 views

Error trying a JSON_VALUE example in DB2 11.1.4.4

I'am having a similar problem as described in this question. Error trying a manual's example in DB2 11.1.4.4 DB2 Version: DB2 LUW 11.1.4.4 When running the following sample from the DB2 LUW 11.1 ...
user avatar
0 votes
0 answers
60 views

SQL30080N error points to two documents SC31-6160 and (SC31-6156

If I face this problem: SQL1476N with sqlerror "-30080", then I check this other error: db2 ? sql30080 SQL30080N A communication error "<reason-code>" occurred sending or ...
user avatar
  • 579
0 votes
1 answer
464 views

How to identify row change timestamp columns in Db2 Table

I need to copy some Db2 tables programmatically (java 11 using the standard Db2 jdbc driver). The tables in question lie on a Db2 for z/OS database (v12) and on a Db2 LUW database (v11.1). The target ...
user avatar
0 votes
1 answer
43 views

DB2 for i equivalent of MSSQL's Show Query Execution Plan

I'm a DB2 newcomer and I'm hoping that DB2 for i has an equivalent to MS SQL's Show Query Execution path. If so, what's it called, how do I access it, and what permissions do I need to use it? Thank ...
user avatar
  • 101
0 votes
1 answer
149 views

Granting select on syscat.schemata - DB2

I was wondering if it is safe to grant select rights to syscat.schemata to users on a DB2 database? What could go "wrong"? Some tool like DataGrip and DBeaver cannot load connection schemas ...
user avatar
  • 143

1
2 3 4 5
16