Questions tagged [db2-luw]

DB2 for Linux, UNIX, and Windows.

Filter by
Sorted by
Tagged with
0
votes
1answer
26 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
25 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 ...
1
vote
2answers
37 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 ...
0
votes
1answer
16 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 ...
0
votes
1answer
30 views

Insert values with leading zeros

How do I insert values with leading zeros in it? Example. db2 "insert into db2inst1.asd_currency (currency_code, currency_name, currency_decimal_count, currency_code_desc) values ('007', 'afghani'...
2
votes
3answers
94 views

In DB2 LUW, When should I use a 4K, 8K, or 16K tablespace rather than just creating a 32K tablespace and being done with it?

We're using DB2 LUW 10.5 & 11.1 on Windows & Linux systems, in case it's relevant to he answers. Question: Is there a time where it would be correct to use 4K rather than 32K? If so, why? (...
0
votes
1answer
46 views

Error trying a manual's example in DB2 11.1.4.4

When trying this example from the DB2 11.1 manual: VALUES (JSON_VALUE('{"id":"987"}', 'strict $.id' RETURNING INTEGER)); I get this error: SQL0171N The statement was not processed because the ...
0
votes
2answers
38 views

Is it possible to compress CLOB columns in DB2 10.5

I have a table with a CLOB(1M). If I enable compression (compression yes adaptive) on the the table the CLOB is not compressed. Is there a way to make this work in DB2 10.5?
0
votes
1answer
34 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
37 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
36 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
1answer
32 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 ...
0
votes
1answer
585 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
1answer
82 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
vote
1answer
37 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
44 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
79 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 ...
1
vote
2answers
35 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
136 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
34 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
64 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
vote
1answer
34 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
194 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
0answers
81 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
70 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
245 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
488 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
88 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
215 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
721 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
58 views

DB2 GLOBAL VARIABLES Refresh for datapool managed sessionis

I've recently discovered the feature of defining global variables for DB2. I wanted to utilize it. My use case is to create a variable containing the value for Previous Banking day. CREATE VARIABLE ...
2
votes
1answer
931 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 ...
0
votes
1answer
136 views

What is the purpose of the “territory” configuration parameter?

This is the command that I use to create a new Db2 database in my project: db2 create db <DATABASE_NAME> using codeset 1251 territory ru Unfortunately, there is no documentation left and I ...
0
votes
0answers
92 views

external authentication of database users in Db2

For a future project, I am looking into authenticating Db2 database users via LDAP and PAM. However, it seems that LDAP server is deprecated in RedHat: https://access.redhat.com/documentation/en-us/...
0
votes
1answer
181 views

ibm_db on HADR primary database?

Yesterday I discovered a peculiar thing, it looks like a bug but I'll post it here in case someone seen it before. Testscript: #!/usr/bin/python import sys import getopt import re import os import ...
2
votes
1answer
3k views

How to avoid SQLCODE=-968, SQLSTATE=57011 “The file system is full” error with merge statement [closed]

When doing the following merge (tempchoices is a temporary table created with DECLARE GLOBAL TEMPORARY TABLE tempchoices LIKE CHOICES NOT LOGGED IN importtemp ON COMMIT PRESERVE ROWS) all my diskspace ...
2
votes
2answers
383 views

DB2 on Windows: Fix encoding in db2cmd and for JDBC

I'm running a DB2 v10.5 FP 7 on a Windows Server 2013 and there is a problem with the encoding setup: The windows is set to use German(Switzerland) as region setting and input language. chcp: Active ...
0
votes
1answer
345 views

python ibm_db driver and decimal values?

It appears as if decimal values are treated as strings by ibm_db. Small example: Python 2.7.14 (default, Mar 14 2018, 13:36:31) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux2 ]$ cat aa.py #!/...
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 ...
1
vote
1answer
39 views

Definition of ROWS_READ?

This may seems like a stupid question, but I cant seem to find a good answer for it. I have a pretty good intuitive understanding of what ROWS_READ in for example sysibmadm.snapdyn_sql means, and ...
1
vote
2answers
148 views

Retrieving auto-generated keys for an INSERT statement

What is the best way to retrieve an auto-generated keys after an INSERT statement ? After searching online for DB2 I found this https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm....
0
votes
1answer
58 views

Long delay before redirected restore “starts”

On several occasions, I noticed that it takes a long time before anything "happens" during a redirected restore. There are no entries in db2diag.log and list utilities show detailshows: Completed ...
2
votes
0answers
267 views

UOW Waiting IBM DB2 memory usage

We have been encountering lately frequent hanging of our database server. Initial thoughts is its running out of memory. Based on logs, just before this happens, the stmm would reallocate memory. ...
0
votes
0answers
223 views

How to activate REST services on Db2 Developer Edition

I am trying to activate the Db2 REST services on my local IBM DB2 Developer-C Edition (Community). Using the Data Server Manager, I wasn't able to figure out how to configure and run sample job ...
0
votes
1answer
225 views

DB2 Alter column type and index state RBDP vs. “needs a rebuild”

I'm new to DB2 and databases overall. I'm building a script to alter several column data types in several tables of which some are part of indexes and some not. So after ALTER-statements I assumed I ...
0
votes
1answer
150 views

In stored procedure %Rowtype is not working while deploying

CREATE OR REPLACE PROCEDURE CAS.ROWTYPECHECK ( P_APPLICATION_REC TAPPLICATION%ROWTYPE ) IS BEGIN INSERT INTO "CAS"."VAPPLICATION" VALUES P_APPLICATION_REC; END; But I'm getting one error while ...
1
vote
1answer
220 views

Optimization profile and explain mode?

The other day I noticed something strange that perhaps someone have an explanation for. The problem I was facing was a query that due to a skewed distribution of data generated a poor plan when a ...
1
vote
1answer
837 views

How to add multiple rows to a table that contains only a generated always identity column?

This more of a Q/A question, perhaps someone is facing the same problem, so I'll ask a question and then answer it. Say that we have a table defined as: CREATE TABLE T (x BIGINT NOT NULL GENERATED ...
1
vote
1answer
98 views

How to identify the origin of a invalid connection with sql1060

I am getting a message similar to the next one: 2007-08-08-09.28.41.745208-240 I10292373A694 LEVEL: Error PID : 1720384 TID : 1 PROC : db2agent (DPADB) 0 INSTANCE: XXXXX NODE : 000 DB : DPADB ...
0
votes
2answers
952 views

DB2 drop trigger if exists?

In MySQL, if I have schema myschema and a trigger named mytriggername I can drop a trigger like follows DROP TRIGGER IF EXISTS myschema.mytriggername Anyway, I can't find on DB2 docs for the DROP ...