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
1answer
25 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
30 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
10 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
11 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
46 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
58 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
32 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
26 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
46 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
13 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
52 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
18 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
31 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
64 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
90 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
67 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
24 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
25 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
66 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
114 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: ...
1
vote
1answer
153 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
171 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
135 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
29 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
55 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
155 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
41 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
83 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
35 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' ...
0
votes
1answer
824 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
49 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
141 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
35 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
182 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
83 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 ...
1
vote
2answers
92 views

Reasons for db2 foreign key error (-667) despite all rows appearing sane?

I have some csv formatted table dumps and loaded those into a new database with the tables defined by a DDL script from the source database (both acquired by somebody else so I cannot have a look at ...
1
vote
1answer
128 views

Remove single quotes from db2 column name

I have following query which i am trying to execute against db2 database server SELECT REPLACE('\'abc\'','\'','') FROM TN_DAY_PROCESS I am expecting the output like abc without single quotes from ...
1
vote
1answer
413 views

How do I compare two tables with the same column definitions in different schemas?

Any advice would be appreciated. I'm leading my projects initiative to upgrading our ETL software. This can result in data integrity differences. My testing plan is as follows: create an identical ...
2
votes
1answer
59 views

DB2 9.7, create or replace tablespace possible?

I am creating my tablespaces in the sql scripts that create the database schema. This causes a problem in continuous integration processes, where consecutive execution of the script is not possible ...
1
vote
1answer
82 views

Can we change DB config after db creation in DB2

Can we change below configuration of DB2 Database after DB is created. Database territory = US Database code page = 1208 ...
0
votes
1answer
31 views

SORT_SEQUENCE is wrong in as400 library indexes. Can this cause performance issues?

I have 4 AS400s running JDEdwards. Lately a performance issue occured as described here: AS400 Performace issue Although i am not an expert in AS400 , i tried to find out the cause. I think it came ...
1
vote
1answer
727 views

Run a Stored Procedure in DB2 (which has dynamic DDL) under the Definer rights

For our Datawarehouse applications, we want to perform ALTER TABLE ALTER CONSTRAINT <constname> NOT ENFORCED, before the load. Perform the load and then ALTER TABLE ALTER CONSTRAINT ...
0
votes
0answers
13 views

DB2 bidirectional replication of federated object?

Bidirectional replication of a federated object - is this possible on DB2? Example: replication of a table on the DB2 and another table on MySQL as federated object inside of DB2. Anyone ...
0
votes
0answers
51 views

DB2 manual asynchrounous real-time replication to NON-DB2 database

I have been given a Proof-of-Concept task to find out whether it is possible to set up manual (=no 3rd party tools allowed) asynchrounous real-time replication in DB2 that replicates all data changes ...
0
votes
0answers
34 views

MySQL manual asynchrounous real-time replication to NON-MySQL database

I have been given a Proof-of-Concept task to find out whether it is possible to set up manual (No 3rd party tools allowed) asynchronous real-time replication in MySQL that replicates all data changes ...
0
votes
0answers
274 views

Export to csv using db2 v10 for z/os

in db2-luw, I can create a csv using the export command. However, running the same command in z/os results in: SQL1325N The remote database environment does not support the command or one of ...