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.

learn more… | top users | synonyms

0
votes
0answers
18 views

How to archive DB2 data

The current system is going to become obsolete but we need to preserve the data as part of compliance for a few years. (P.S. The system is on a mainframe.) What are the various ways I can achieve the ...
2
votes
0answers
23 views

Options for copying data out of continuously updating tables

I work with a pretty large (O(10^1) TB) DB2 (LUW, v. 9.7) database. It's got data coming in on a continuous basis via Golden Gate replication from another DB2 database. It's used for business ...
2
votes
1answer
28 views

delete records in one table based on multiple column values in second table

I need to insert and delete records in table 1 based on the data in multiple columns in table 2 Example: Table1 and Table2 have identical columns = address, city, state, zip Table1 is the master ...
3
votes
1answer
40 views

How to use a variable date when running a db2 command in a shell script?

I need to use a date variable in a select, like bellow, but I'm getting this error: Expected tokens may include: "". SQLSTATE=42601 How can use these variables in a shell script? ...
1
vote
1answer
30 views

Database index on FK with only NULL values

We have in our database an index with table cardinality over 10.000 but full key cardinality only 1. The reason for this that all the values for the column are NULL, hence cardinality 1. Does this ...
1
vote
1answer
18 views

Create DB2 on networked drive but managing from Windows

I'm relatively new to DB world and DB2 is very new. Below is what I'm trying to achieve: Install DB2 express C and IBM data studio on windows (with Fixed IP) create/share/host DB2 on a ...
0
votes
2answers
16 views

Application == session == connection in DB2?

Can I consider as synonyms Applications, Sessions and Connections in DB2 LUW? In db2top, I see "Sessions". There is a command "db2 force applications", views and other stuff. And from the developer ...
1
vote
1answer
18 views

Named Parameter Markers in DB2 for z/OS

I have a query where I will be using the same value twice for one of the parameters. This query will be run under IBM Data Studio to see the results. Below is a sample query: SELECT * FROM ...
1
vote
1answer
65 views

How to resolve foreign key references across different databases (iSeries and SQL Server)

I've got a system that has a DB2 iSeries database. We are rewriting a portion of the system and implementing it using SQL Server and Entity Framework. Originally, I was lead to believe that there ...
1
vote
1answer
26 views

Why this statement invalid: `VALUES ( CURRENT PACKAGESET )`?

I'm on db2 luw 10.5. db2 special registers can be set with: SET CURRENT ... and retrieved with: VALUES CURRENT ... with the exception of CURRENT PACKAGESET. For some reason the following ...
0
votes
1answer
34 views

DB2 Trigger Error : An unexpected token “OR INSERT” was found following SQLCODE=-104, SQLSTATE=42601, DRIVER=3.68.61

I am getting an error while executing the following queries. As per the DB2 documentation, we can have both update and insert event in the same trigger, but when I am trying to do so I am getting an ...
2
votes
0answers
30 views

How to order by fields of joined table while selecting for update?

For selecting some rows of table Fwt_Chipkarte for update I use the following SQL statement (IBM DB2): SELECT o.Archiviert, o.Id, o.IdComm, o.Kartennummer, o.Konto, o.LetzteAenderung, ...
1
vote
1answer
13 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 ...
1
vote
1answer
53 views

Syntax error while creating DB2 Trigger

What is wrong in the below trigger syntax, I am getting this error An unexpected token "INT" was found following " DECLARE NULL_ROW_ID". Expected tokens may include: "END-OF-STATEMENT".. ...
1
vote
0answers
24 views

MQT automatic `set integrity off` when underlying table updated

Have a slow query. Need an MQT so the optimizer will rewrite the query and use my MQT instead. Problem: a manual full refresh is much much faster than using refresh immediate type or a staging table: ...
1
vote
0answers
47 views

DB2 multiple on delete triggers causing deadlock

When trying to run a delete query on the parent table I am getting locked. Following is the table structure and executing this " DELETE FROM PARENT WHERE PARENT_ID = 1; " would create a deadlock - ...
1
vote
0answers
28 views

Where is default data directory in DB2?

I have a problem: cannot backup DB2 8.1 with backup command line in Windows 2003. I think my HDD was failure (after read error showed by backup command). So, I want to copy the folder/ directory which ...
1
vote
0answers
116 views

How to create a Linked Server from SQL Server 2008 to DB2?

( This is an edit...the real post was really big ) I'm having problem with my SQL Server 2008 to DB2 linked server. I'm getting this error: TITLE: Microsoft SQL Server Management Studio The ...
1
vote
0answers
20 views

db2 Rollforward create active log in the active directory in v10.1

I have one master and one slave DB, they are not in HADR. for each 15 mins, the master archive log will be rsync to the slave DB and do the rollforward to end of logs in slave. But I find out in ...
0
votes
0answers
20 views

Are there any databases other than DB2 for z/OS that implement true data sharing?

Are there any database products for Linux/Unix/Windows that implement true independent member data sharing similar to what DB2 for z/OS implements? Specifically the individual members are each ...
1
vote
2answers
33 views

DB2 10.5 - When inserting, the database is trying to reuse index keys on GENERATE ALWAYS

I am trying to insert a row into a database table which has a GENERATED ALWAYS primary key column. The table has over 1000 rows, and the primary keys start at 1. When I try to do an insert, the error ...
1
vote
1answer
42 views

Driver properties for db2jcc in Squirrell and MON_GET_CONNECTION table function

I'm trying to set driver properties like: clientAccountingInformation clientApplicationInformation clientProgramId clientProgramName in Squirrell 3.6 (http://squirrel-sql.sourceforge.net/). See ...
1
vote
2answers
88 views

SELECT * FROM INFORMATION SCHEMA on V5R3M0

I have access to a client's V7R1 AS/400 and I can run queries like SELECT NAME FROM INFORMATION_SCEMA.TABLES and SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, ...
1
vote
1answer
65 views

AUTO_BACKUP not even trying to backup database

I've setup 2 identical linux servers with db2 10.5 . AUTO_BACKUP only works on one of them. Also, no health notifications come from that server at all, although postfix on localhost is running and a ...
0
votes
1answer
33 views

Procedure doesn't have compatible arguments

Getting an error while invoking my procedure named LOG_MSG_TEST(). Procedure Schema name is ADMINIST. My procedure has one INTEGER input parameter and one VARCHAR output parameter. I am calling ...
1
vote
2answers
107 views

REPLACE INTO SELECT from table

Is there a way in DB2 to replace the entire table with just selected rows from the same table ? Something like REPLACE into tableName select * from tableName where col1='a'; (I can export the ...
0
votes
1answer
38 views

Getting error while installing log4db2 utility

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0601N The name of the object to be ...
0
votes
1answer
34 views

limit keyword support in DB2 latest version

I could see limit keyword is supported in latest version v10.5.500.107 5 of db2 by default without setting MYS compatibility vector. My installation was DB2 Express-C. Is there any announcement for ...
0
votes
0answers
14 views

I am trying to install log4db2 utility in db2 for procedure logging but I am getting error mentioned below [duplicate]

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0601N The name of the object to be ...
1
vote
0answers
107 views

Return both Result set AND a warning from a stored procedure

In Data Studio when you call SYSPROC.ADMIN_CMD() directly and it returns a warning, the results panel shows both the warning and the result set: CALL SYSPROC.ADMIN_CMD('EXPORT TO ...
1
vote
1answer
34 views

Extract column definitions from an IXF file of unknown origin

Suppose someone exported the table PROPERTIES using the command: CALL SYSPROC.ADMIN_CMD( 'EXPORT TO /tmp/properties.ixf OF IXF MESSAGES ON SERVER select * from properties' ); Since then the ...
0
votes
1answer
17 views

Completion Counting only Once

Have an SQL query for DB2 that returns the timestamp of when an event completed. It completes at 2 different date/times, which is the result expected. That result completes at those 2 different times ...
2
votes
2answers
88 views

How can I know my database version?

I need to know what is my database version. I'm using DB2 V9.7 on linux 64 bits. I'm connected to a database and i need to know if it is 32 or 64 bits. Can someone help me?
2
votes
1answer
46 views

How do I modify a stored procedure in IBM DB2?

I have a DB2 database and I'm using Control Center. I've found a procedure in the 'Stored Procedures' folder, which I need to modify. In MS SQL Server and Oracle you can accomplish this right from the ...
1
vote
0answers
216 views

How do I cast a varchar to Bigint in DB2

I have a field which is varchar(25) and I need to create a join between that field and a field that is a bigint So I guess I need to convert the field into bigint aswell but it's giving me some ...
3
votes
1answer
118 views

DB2 CASE statement faster with parentheses around entire WHEN

Trying to optimize slow queries, someone on my team come across this. Having this in our stored proc: CASE WHEN MYCOL BETWEEN @STARTNUM AND @ENDNUM AND RECTYPE = 'RO' THEN 1 ELSE 0 ...
1
vote
1answer
33 views

Use of SET INTEGRITY for DETACH PARTITION

I have some partitioned tables with DB2 LUW 10 . We have one partition for each data.I am reviewing a DB2 stored procedure that runs daily detaching old data partition and creating a new partition ...
0
votes
0answers
67 views

Can't auto-start db2 with db2iauto

Followed guide Auto-starting instances . [root@oktest-stage-db-1 ~]# db2greg -getinstrec instancename=db2inst1 | grep -i startatboot StartAtBoot = 1 [root@oktest-stage-db-1 ~]# ...
1
vote
1answer
29 views

Where do I set the I/O size for DB2 9.7 LUW driver (AIX 6.1)?

I am looking to change the I/O size returned from the DB2 server for query results. (As per below instruction from SAP BODS 4.X performance optimization guide) Increase the size of each I/O from ...
0
votes
0answers
32 views

DB2 Fixpack 10 install missing folder!

Hello everyone that are reading this! I'm trying to perform a fixpack install into DB2 9.7 version database in a linux 64 bits server. i terminate my database, stop my instance. And when i try to ...
3
votes
0answers
45 views

DB2 - what happens when SQL archive log file reches its maximum value (S9999999.LOG)

we have DB2 in archive mode. archive log files are created and deleted from the disk. What will happen when archive log file reaches its maximum value for the name (S9999999.LOG) will it start to ...
1
vote
0answers
31 views

DB2 Setting up table access based on LDAP groups

I have a DB2 database installed and set up. My users can access any table that I grant SELECT to the PUBLIC group. However, it doesn't appear to acknowledge the groups the user is in in LDAP. The user ...
1
vote
2answers
45 views

What is the impact on a running database when OS date is changed and set to past

My SAP back end db is db2. Need to understand the impact on this running database (db2 under HPUX) if I change the OS date and set it to a past date please. Thanks.
1
vote
1answer
45 views

Is there any way to trace optimizer's work in DB2?

Just like the MEMO structure in SQL Server which is kind of a "paper trail" of steps the optimizer takes in optimizing the query, is there anything in DB2 through which I can get the information like, ...
2
votes
2answers
63 views

DB2 sorting by lowercase uppercase - problem

I'm struggling with DB2 - sorting by Polish letters with diacritics and uppercase/lowercase. When I created a database using: CREATE DATABASE P1DS8 AUTOMATIC STORAGE YES ON '/home/db2inst1' DBPATH ...
1
vote
1answer
206 views

db2pd: Database mydb not activated on partition 0

As a user with DBADM privileges I enter db2pd -db mydb -locks showdetail from the DB2 CLP. The command then fails with message Database mydb not activated on database partition 0. Option -locks ...
0
votes
2answers
247 views

List of open (uncommitted transactions) in DB2 LUW

How can I get list of open (uncommitted transactions) in DB2 LUW? Or just the oldest transaction id? Basically, I need to get the first change of the oldest open transaction. I found ...
1
vote
0answers
130 views

DB2 TSM Archivelog backups missing

New to DB2 on AIX currently running V9.7 Using TSM to backup the database with the command: db2 backup db (db name here) online use tsm include logs When I run the backup it finishes without ...
1
vote
0answers
74 views

Export entire Oracle schema to ASCII and import into DB2

I'm looking for a solution to export a number of schemas from Oracle to ASCII or other flat file format. The data then has to be read by DB2 import. Does anyone know the what oracle export commands ...
1
vote
1answer
226 views

DB2 ROLLFORWARD option “TO END OF LOGS” - does it read archive logs?

I read about ROLLFORWARD option on link http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001978.html?cp=SSEPGG_9.7.0%2F3-6-2-4-106 but I could not find ...