Questions tagged [db2-luw]

For questions about IBM Db2 for Linux, UNIX, and Windows. Please also add the generic [db2] tag.

Filter by
Sorted by
Tagged with
0 votes
1 answer
21 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
18 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
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
26 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
49 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
34 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
36 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
0 votes
2 answers
68 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
72 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
  • 21k
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
  • 21k
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
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
-1 votes
1 answer
66 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
0 answers
11 views

azure cli - Metrics (hostname, CPU, sockets..) for server with DB2 instances

for license purposes I need a table / list with Metrics like hostname, OS, CPU, sockets, cores ..) for virtual or dedicated azure server with DB2 instances. I started with the cli az vm list -d ...
user avatar
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
  • 21k
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
  • 21k
1 vote
1 answer
257 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
  • 21k
1 vote
0 answers
45 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
25 views

Migrate Db2 blob data to Mariadb

We plan to move a data set from Db2 to MariaDB. Can anybody suggest an approach on how to migrate the BLOB column data exported from db2? Initially, I managed to import it into the MariaDB database ...
user avatar
0 votes
0 answers
121 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
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
184 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
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
830 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
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
1 answer
460 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
148 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
0 votes
0 answers
59 views

Meaning of sqlstate in activity monitor table?

I'm investigating phenomena for a transaction and created an activity monitor. db2 "create event monitor act_stmt for activities write to table manualstart" db2 "set event monitor ...
user avatar
  • 21k
0 votes
0 answers
122 views

How to restrict CPU consumption of CPU intensive applicaiton with Db2 Workload Manager?

in Db2 v11.1 on Linux I would like to have control over applications that consumes too much CPU resources. For every application that consumes too much CPU for more then 3 seconds I want to lower CPU ...
user avatar
  • 57
0 votes
0 answers
42 views

Boost STMM in Db2 by mimicking values of previous execution

Let’s say I have two kinds of workloads / processes that execute at different times (i.e. daily workload, nightly workload). And, the STMM is activated. The database is not alone in the instance, and ...
user avatar
  • 579
0 votes
2 answers
237 views

How to move database from Db2/Linux/System-z to Db2/Linux/Intel

our company has decided to migrate database: from source Db2 Enterprise Server Edition v11.1 fixpack 5 on Linux/System-z (this is still Linux/Unix/Windows type of database despite running on System-z ...
user avatar
  • 57
-3 votes
1 answer
151 views

DB2 replace emoji in text string

I trying to find a way to replace emojis within a text string, I want to be able to set a pattern of (a-z) and (0-9). if the string has other characters that don't match that pattern, i want to ...
user avatar
3 votes
2 answers
425 views

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 ...
user avatar
  • 73
0 votes
1 answer
343 views

local administrator does not have permissions to create database in db2

I have a fresh standard installation of DB2 11.5 on Windows server 2016. According to documentation, i need the to have SYSADM or SYSCTRL to create a new Database. The documentation for "...
user avatar
1 vote
1 answer
120 views

DB2 equivalent of Oracle DBMS_LOB.SUBSTR etc

I have to migrate an Oracle stored procedure to DB2 LUW 10.5. It uses DBMS_LOB.SUBSTR() function on a BLOB parameter that receives an array of bytes from the client code. What is its equivalent in DB2?...
user avatar
0 votes
0 answers
202 views

Confused by boolean

After reading Casting between data types I wanted to create a table with a column that could store boolean values: create table t(a smallint default 0) insert into t(a) values (default) select cast(a ...
user avatar
2 votes
2 answers
181 views

Get current table name trigger was fired on

My system: Db2 11.1 on Linux. 1.Create some table: create table admin.tab (a int not null primary key, b int) @ 2.Create audit table: create table admin.audit (table_name varchar(2000), datetime ...
user avatar
  • 57
0 votes
0 answers
80 views

What C# type is the correct representation for DB2 UDB boolean?

The project that I work on uses IBM.Data.DB2 nuget package for its data layer. I need to call into utl_mail.send_attach_varchar2 stored procedure on the DB2 side. It has a boolean parameter att_inline ...
user avatar
0 votes
1 answer
302 views

How can I add a user and specify a password for a in IBM Data Studio? [duplicate]

In Data Studio I can connect to a sever/database, go down to Users And Groups, right-click on Users and add a new one. But the program never asks me for a password. How can I specify it? Also, no ...
user avatar
0 votes
1 answer
35 views

How can I list all the tablespaces without getting into each instance?

I got around 98 instances in a single AIX server. I need to list all the tablespaces, their path and usage. Is there a way I can do that without getting into each instance, connecting into the ...
user avatar
  • 1
0 votes
1 answer
67 views

Benefits of reorging a new table with loaded data?

Given the following scenario: DB1: EXPORT TO T.IXF OF IXF ... modified by codepage=... SELECT * FROM T; DB2: CREATE TABLE T (...) COMPRESS YES ADAPTIVE ORGANIZE BY ROW; CREATE INDEX ... ON T (...) ...
user avatar
  • 21k

1
2 3 4 5