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

2
votes
2answers
189 views

Join 3 tables and return only distinct values for max datetime

I've been trying to do this the whole 2 weeks but seems like to no avail. 3 tables involved here. but am expecting the result would be distinct case no. for the same date & user. otherwise, it ...
1
vote
0answers
14 views

Auditing AS 400 DB2 library user access

As part of the testing to check for authorized users having access to applications and libraries on AS 400 systems, I need help to figure out a list of users having access to applications hosted on ...
1
vote
0answers
25 views

Optimization suggestions for db2 materialized view

I have a view for db2 9.7 which has consolidated o/p from few tables. The view is built and it is working fine I want optimization suggestions on the view SQL CREATE VIEW XYZZ AS SELECT ...
1
vote
1answer
29 views

Not getting CLI Trace log DB2

Currently I am working on fixing an issue with the Java-DB2 connection leak. For which I require the CLI Trace logs. In my db2cli.ini I have added the below parameters, but still I am not getting the ...
1
vote
1answer
13 views

“Approximately equal” between Sync and Async operations for PageCleaners

The documentation of num_iocleaners says: The parameter can be reduced if both of the following conditions are true: pool_data_writes is approximately equal to pool_async_data_writes ...
0
votes
1answer
70 views

DB2 - how to safely blow away database on linux?

I'm using (I believe) 10.1.2, on CentOS 6.5 (for sure). The underlying problem I have is that the database upgrade package prepared in house isn't working for me, in at least the sense that the ...
5
votes
1answer
140 views

DB2 developers can't create table in own schema but SQL and Oracle devs can. Justified?

As a developer new to DB2, I was surprised when I discovered that I could not create my own tables in the development database environment. So, I posed a question to the db2 DBA. I don’t want to be ...
1
vote
1answer
28 views

db2 removal of Generate always Expression on Timestamp data type

I have a column UPDATE_TIME with an expression TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP How to remove the Generated always for timestamps? I tried ...
1
vote
1answer
27 views

DB2 importing/replacing fields from a file that contains XML

In two tables I have a column called table1.column_xml and table2.column_xml_2 defined as CLOB(1000000). The fields in the column contain XML formatted information like below column_xml ...
-1
votes
1answer
51 views

How we can make database resumable in perl script

I have a Perl code which connects with database and scan data from different different table. I face a problem if I lose my connection: it roll back all the transaction. How could I make the Perl ...
0
votes
0answers
20 views

DB2 LUW 9.5 ignoring indexes

I am seeing something in DB2 that I've never seen before. DB2_VERSION: 09.05.5 AIX VERSION: 7.1.0.0 I've got a query that is properly indexed. In fact, it’s heavily indexed. However, when I get the ...
2
votes
1answer
36 views

How to apply a regex on a column fetched from DB

I am using IBM DB2. So, I am retrieving a column named SSN from a table. I have to apply the following regex on that column: ([1-57-8][0-9]{2} |0([1-9][0-9] |[0-9][1-9]) |6([0-57-9][0-9] ...
-2
votes
1answer
40 views

Need help with putting conditions on a column in a result set [duplicate]

I am using IBM DB2. So, I have a SQL query in which I am retrieving a person's SSN from a table. I want to put conditions on that SSN column of the result set, conditions like : 1) It should start ...
0
votes
1answer
28 views

In DB2 LUW 9.5, is there any way to change the collating sequence without recreating the db?

The documentation says "no" :-) I'm looking for some heady old DBA to whisper dark secrets about cludgy hacks that I'll get fired for sure for using ;-)
0
votes
0answers
16 views

DB2 Trigger for EVENT and ARCHIVE TABLE

I have a requirement on DB2. There is a two Table EVENT and ARCHIVE. Both table has ROW_ID and STATUS field. Case 1: When Update STATUS Zero to One at EVENT table that row will insert at ARCHIVE ...
0
votes
1answer
59 views

How do tablespaces differ in DB2 from databases in MySQL or SQL Server? [closed]

In DB2, it seems there is a strong separation between what a database is and what a tablespace is. Where as in MySQL and MS SQL Server tablespace and database seemed to be used synonymously. What are ...
2
votes
0answers
101 views

Split comma separated entries to rows

I have a Table like this: | ID | OtherID | Data +--------+-----------+--------------------------- | 5059 | 73831 | 5103,5107 | 5059 | 73941 | 5103,5104,5107 | 5059 | 73974 | ...
0
votes
2answers
58 views

Does anyone use modules in DB2 LUW?

Our environment is currently DB2 9.7 Fix Pack 4 on AIX. I am in the processing of designing and coding some SQL PL stored procedures responsible for archiving data into an archive schema and then ...
1
vote
0answers
30 views

who are the group people in db2 and who are the users db2luw

I am new to DB2, I want to learn basics in db2luw. Like Who will create group, and under this group who are the users, and what group people do, and what users will do Thanks in advance Raghava
1
vote
1answer
68 views

Db2 high availability Instance configuration db2haicu fails

Hi I Configured db2 HADR between two servers and the servers are running in HADR Primary and Standby are syncing up I tried to configure the instance configuration utility db2haicu on both the ...
1
vote
1answer
18 views

System parameter in catalog tcpip node

What is the purpose of the "system" parameter when cataloging tcpip nodes? >>-CATALOG--+-------+--+-TCPIP NODE--+--nodename----------------> '-ADMIN-' +-TCPIP4 NODE-+ ...
0
votes
1answer
169 views

configure client ibm_db2 for php

I am installing a RHEL server with nginx and php that can connect to a db2 database, download and install the "IBM Data Server Client" package, also install the pecl library through: pecl install ...
1
vote
1answer
21 views

The query result changes in remote and local database

The below table is created in local database and remote databases. CREATE TABLE EMPLOYEE1 ( EMP_ID INTEGER, EMP_NAME VARCHAR(10), EMP_DEPT VARCHAR(10) ); Insert the below rows in tables created in ...
1
vote
1answer
39 views

Removing apostrophe in result set

create view ENTRP_SERVS.V_IRS_BULK as Select Atr.Ssn_Tx ,Names.First_Na ,Names.Middle_Na ,Names.Last_Na ,Reff.Ref_Cd_Desc_Tx Suffix_Na ,MBR.PRSN_MBRSH_ID, T_PRSN_MBRSH_TAX.FILTER_TYPE_CD From ...
-1
votes
3answers
80 views

Retrieve recently inserted 5 rows [closed]

I want to fetch recently inserted 5 rows from my table. I want to know the sql query for the same. My table is: table xyz ( id integer generated always as identity (start with 1 increment by 1), ...
1
vote
1answer
139 views

DB2 LOAD: Poor performance while loading table with large BLOBs

I need help regarding LOAD-command with BLOBs. I notice very poor performance while loading a table which contains large BLOBs. While tracing the OS, I only have about 15MB/sec I/O-speed. But in ...
2
votes
0answers
104 views

How to avoid hardcoding a database link name in a package body

I have a PL/SQL package that copies data from a remote DB2 database using a database link. To keep the package configuration-independent I wrapped the remote table in a view. But a single field in a ...
1
vote
1answer
30 views

Equivalent SQL Server's Backup COPY ONLY in DB2

In, DB2 when you have a recovery strategie, you have a Full backup, then some deltas or incrementals in between. They are creating based on the previous full (first delta, or any incre. ...
0
votes
1answer
30 views

Raster files into DB2

Team, We have been loading shapefiles into DB2 using db2se import utilities. I have been trying to find help to load Raster files and i wasnt able to find any help on this. it would be really ...
1
vote
1answer
106 views

Running queries directly on DB2 databases

Just have a general query, if it is really fine or safe to run long select queries on RDBMS production Databases specifically DB2? If NO, what are the major risks and issues in executing select ...
0
votes
1answer
242 views

SQL2542N - No match for a database image file was found based on the source database alias

I'm trying to restore a DB from a Linux system to a Windows. I'm working with DB2 9.7.7. I want to create a new DB with the restored DB. The DB file has this name: ...
2
votes
1answer
420 views

Create new Read Only user on DB2 on the whole database

I am an oracle/sql server DBA having limited knowledge in IBM DB2. We have DB2 9.7 fp4 running on AIX 6. I would like to create a new user and grant him READ only privilege on a particular database. ...
0
votes
1answer
382 views

DB2 Linked Server on SQL Server 2012 - Grant Access to Users

I have a linked server on SQL Server 2012 Instance to point to a DB2 database and I have Sys Admin access to that Instance. I am unable to test connection to that DB2OLEDB database as I get below ...
1
vote
0answers
223 views

SYSPROC.ADMIN_MOVE_TABLE procedure error

Iam using DB2 V9.7. The question is regarding SYSPROC.ADMIN_MOVE_TABLE. I tried to move a table between tablespaces, and its throwing an error. db2 "CALL SYSPROC.ADMIN_MOVE_TABLE ...
0
votes
0answers
11 views

SYSPROC.ADMIN_MOVE_TABLE procedure error [duplicate]

Iam using DB2 V9.7. The question is regarding SYSPROC.ADMIN_MOVE_TABLE. I tried to move a table between tablespaces, and its throwing an error. db2 "CALL SYSPROC.ADMIN_MOVE_TABLE ...
0
votes
1answer
31 views

Column not found in dbase file

When I try to import a shapefile using db2se, I specify the input columns to be loaded in the syntax as the COLUMN NAME db2se import_shape <dbname> -userId <username> -pw <password> ...
0
votes
0answers
95 views

MATERIALIZED QUERY TABLE on DB2 Z/os V10

I have return MQT on DB2 LUW and it is working fine and if the same is Executed on DB2 on Z/OS V10 . IT fail's with below error . Can some one help in on the problem. ERROR : "THE FULLSELECT ...
0
votes
2answers
340 views

create a stored procedure if it doesnt exist using a ddl in db2

My requirements are, I want to create a ddl script which will check if a stored procedure exists on DB, if yes then drop it and recreate it. What I tried is, IF EXISTS (select procname into ...
1
vote
1answer
49 views

Spatial Loader DB2 giving error while importing shape file

While I am trying to import a shapefile using db2se import_shape file utility, db2se import_shape <dbname> -userId <userid> -pw <password> -fileName ...
2
votes
1answer
262 views

DB2 Query Error SQL0204N Even With The Schema Defined

I'm using Python to access tables in DB2 10.1.0 I have a login account named foobar and a schema with the same name. I have a table named users under the schema. When I'm logged in as foobar, I can ...
1
vote
1answer
58 views

Merging a Select query into a view

I am using DB2. So, I have a view which is working fine. It is : Select Atr.Ssn_Tx ,Names.First_Na ,Names.Middle_Na ,Names.Last_Na ,Reff.Ref_Cd_Desc_Tx Suffix_Na ,MBR.PRSN_MBRSH_ID From ...
0
votes
0answers
39 views

Need to implement some logic in DB2

I need to implement the below logic in DB2. Please help how to do so as I am new to DB. LOGIC: 1.Find the last year using LastYear = Current Year - 2 years 2.Check if LastYear equals value in ...
2
votes
1answer
41 views

Adding a column to the view which shows the date in format YYYYMM

In the following view, I want to add a column (not alter the view) named say "ABC" which shows the date in format YYYYMM (no date, only year and month). How can I do that? I am using db2. create view ...
0
votes
1answer
31 views

About creating a View With additional coumns (that are not in the table)

I have this view with following definition. create view VIEW_IRS1 as Select MBR.PRSN_MBRSH_ID , Atr.Ssn_Tx , Names.First_Na , Names.Middle_Na , Names.Last_Na , Reff.Ref_Cd_Desc_Tx Suffix_Na ,'FALSE' ...
1
vote
1answer
2k views

DB2 SQL: How to select all days in a date range even if no data exists for some days

I am really really new to the whole programming world. I have found this previously. However I need rolling dates and into a SQL i am not aware what it is. Example of the SQL im using: Select ...
1
vote
1answer
65 views

Way to ensure just one connection to a DB2 database

Let's suppose a database with a bad security design, say everyone access to the database with a user with DBADM or SYSADM authority, and also, there could be only username for everyone (i.e. ...
1
vote
1answer
230 views

IBM DB2 9.7 and latest 10 version compatibility

At some point projects need to move from IBM DB/2 9.7 to some 10 version. Are there any significant compatibility issues that should be taken into account? We ofcourse use tables in schemas, but then ...
0
votes
1answer
44 views

Apply DB2 logs from production to DR

Is it possible to Apply DB2 9.5 logs files from Production site to DR site? Or do I have to do Backup/Restore and rollforward ...? I copied log files from production site to DR and issued the ...
2
votes
0answers
355 views

Adding group rights in db2 for a stored procedure

I have a list of user accounts on AIX server, where the db2 database resides in. The user accounts all belong to a specific group which I can confirm from aix shell. User accounts work in DB2. ...
1
vote
2answers
112 views

DB2 removing white spaces in field values

In a table I have a column called column_xml defined as CLOB(1000000). The fields in the column contain XML formatted information. My problem is that there are lots of white spaces in these fields ...