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
-1
votes
1answer
15 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 ...
0
votes
0answers
9 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 ...
0
votes
1answer
25 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 ...
1
vote
1answer
31 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 ...
0
votes
1answer
24 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 ...
1
vote
1answer
40 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, ...
0
votes
0answers
24 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 ...
1
vote
0answers
25 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. ...
0
votes
0answers
11 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 ...
0
votes
0answers
29 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 ...
1
vote
2answers
56 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 ...
0
votes
1answer
65 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 ...
0
votes
0answers
17 views

DB2 Databases vs Schemas [duplicate]

Suppose I have a DB2 database instance that manages a single database with 2 Schemas, say A and B What would be the benefits (if any) of having the instance instead manage 2 databases with one ...
0
votes
2answers
82 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....
0
votes
0answers
30 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 &...
0
votes
1answer
130 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 ...
1
vote
2answers
22 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 ?
1
vote
0answers
29 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 ...
0
votes
1answer
203 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 ...
0
votes
1answer
57 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 ...
0
votes
0answers
43 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 ...
0
votes
0answers
77 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 ...
0
votes
0answers
38 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 ...
0
votes
2answers
163 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 ...
-3
votes
1answer
80 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 ...
3
votes
2answers
229 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 ...
0
votes
1answer
194 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 "...
1
vote
1answer
71 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?...
0
votes
0answers
98 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 ...
2
votes
2answers
129 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 ...
0
votes
0answers
81 views

How to add generated timestamp on existing table

on Db2 v11.1 fixpack 5 on Linux I have table with automatically generated timestamp: create table admin.tab ( id int, datetime timestamp not null generated always for each row on update as row change ...
0
votes
0answers
56 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 ...
0
votes
0answers
88 views

Not able to create a stored procedure for a table insert in DB2 UDB 10.5 [duplicate]

I want to create a very simple stored procedure that will only take several IN parameters and insert them into a table. To learn how to do it, I went to CREATE PROCEDURE (SQL) statement From that I ...
0
votes
1answer
195 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 ...
0
votes
1answer
30 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 ...
0
votes
1answer
58 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 (...) ...
1
vote
1answer
197 views

DB2 BOOLEAN type, EXISTS predicate and nullability strange behavior

I'm using DB2 LUW v11.1.4.5, It seems that EXISTS predicate, when FALSE returns NULL (is it documented ?) In the following query on X is null is true, all the rest acts like FALSE is a synonym for ...
1
vote
1answer
367 views

How to set or grant SELECTINAUTH for a schema in DB2 11.5

I'm running DB2 11.5 and want to grant select, insert, update or delete rights for all tables in a specific schema. SELECTINAUTH etc. seems to be perfect for this. When I'm looking to the SYSCAT....
0
votes
1answer
84 views

last_value ignore null in left join with additional dimension?

This is just a silly example that I started to think about, but can't seem to come up with an elegant solution for. Assuming a Calendar table (I'll use Db2 syntax): create table calendar ( dt date not ...
0
votes
0answers
43 views

Change in plan after moving from ibm1252 to utf8

DB2 v11.5.0.0, RHEL7. I spent the last couple of days trying to figure out why a particular query runs so much slower on a UTF8 database, compared with an IBM-1252 database. The UTF8 db is generated ...
0
votes
1answer
50 views

Not able to change the AUTO_DEL_REC_OBJ value to ON

I changed the value of AUTO_DEL_REC_OBJ to on as below in UAT and prod environment; in UAT it's done but in prod its current value is still showing OFF. What did I do wrong? In UAT: db2 update db cfg ...
0
votes
1answer
32 views

date variable manipulation

I'm working on DB2 stored procedure, which will be called by the Korn Shell (.ksh). My DB2 version is 11.5 and it is running on AIX. I was stuck in TIMESTAMP to DATE conversion. Below is my ...
1
vote
1answer
198 views

grant procedure

A batch process run by user U drops and creates a work table T. Simplified setup: rights for user U db2 grant dataaccess on database to user U db2 grant all on table T to user U db2 transfer ...
0
votes
2answers
67 views

The leading zeroes before decimal point is missing in string formatting of decimal data in XML in db2 11.1

When generating XML that includes decimal values in Db2 11.1, the leading zero right before the decimal point isremoved. In the following query, the decimal value .00000000000000 is published even ...
0
votes
1answer
62 views

clp appends bytes to output

I am migrating a number of databases to UTF-8, and just discovered phenomena that I was not aware of. When selecting data out to the terminal, additional bytes are added to the output. Example: ~]$ x=...
0
votes
1answer
195 views

For SSL renewal procedure in Db2 LUW , DO i need to create CSR request for each instance residing in same server?

I am trying to renew my SSL certs . Stuck here if we need to have create a Certificate Signing Request for each instance residing on the same server and send it to CA who will provide us the ...
1
vote
1answer
190 views

how to alter sequence in db2 stored procedure by another user

I am using DB2 LUW Version 10.5.0.5 on Linux (x86_64) I have written a procedure to alter a sequence to restart with a certain number. The procedure takes the sequence name and the number to restart ...
0
votes
1answer
63 views

does xml element exist, regardless of value?

EDIT: I demonstrated my ignorance by confusing attribute with element, I updated my question. Sorry. To clarify, I'm looking for the existence of the element code in: <conditionmessage:code>...
3
votes
2answers
499 views

New bufferpool not being used

As part of a migration, I created a new bufferpool - say BP8K - size 8K, and a tablespace using that bp, and a table in that tablespace, that is loaded with data. However, I get a: SQL1218N There ...
0
votes
1answer
47 views

Db2 LUW tens of millions of rows

We have a table with tens of millions of time series rows. We index by three foreign keys to relations. Let's hypothetically say medical observation row to doctor, acl, and person. Main thing being a ...