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
1answer
6 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 ...
-1
votes
0answers
18 views

After Update Trigger - create record each time an account is updated [on hold]

I need help creating an AFTER UPDATE trigger to add an ‘UP’ record to the Log every time an account is updated (money deposited or withdrawn). My code is getting errors: CREATE TRIGGER ...
-1
votes
0answers
21 views

identify when and what is the last sql command in DB2 [closed]

I would like to know the time of the last sql command issued to DB2 server. I will use this information in Roll Forward operation.
0
votes
1answer
14 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 ...
1
vote
2answers
32 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?
1
vote
0answers
14 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
28 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 ...
2
votes
1answer
54 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
0answers
10 views

PHP and cleansing DB2 data for dynamic Queries [migrated]

I'm relatively new to DB2 for IBMi and am wondering the methods of how to properly cleanse data for a dynamically generated query in PHP. For example if writing a PHP class which handles all ...
1
vote
1answer
19 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
17 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
16 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
22 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
30 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
18 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
36 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
35 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
40 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
77 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
117 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
58 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
46 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
72 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 ...
1
vote
1answer
67 views

DB2 ROLLFORWARD ERROR when doing “TO A POINT IN TIME” option

I do restore command of backup image which was made 03.03.2015 at 19:20: db2 restore database maxdb71 from "/data/archiveBackup" taken at 20150303192002 without prompting; Then I try to do the ...
1
vote
1answer
82 views

DB2 - question regarding RESTORE OFFLINE backup and Archive Logs

I configured last night DB2 to be in Archive Mode. I created required offline backup at 23:00 last night. First online backup will be created at Friday night. Archive logs now keep coming to the ...
2
votes
0answers
30 views

How to reinstall a legacy DB2 Server 7.x for Linux?

We have to move our legacy database dump to a new Linux installation. I know DB2 7.x is out of support for over a decade, but is there a way to obtain a DB2 7.x Server installation media for Linux? ...
0
votes
1answer
32 views

Multiple records and determine if a combination if values exist and write this to a new column

I'm struggling with a problem. An order can have multiple lines and accordingly a type (F=Footwear/N=Non-FTW,Mixed=Both) I need to determine if the order consists of which type and create a new ...
1
vote
0answers
59 views

accessing DB2 database connection by squirrel sql client

I am Ramashankar actually I am using Ubuntu OS . When I try to connect with DB2 database through Squirrel sql client it shows the connection is successful but no database table shows after connecting ...
0
votes
1answer
37 views

DB2 PURGE (old Online Backups and Archive logs) - some of the archive logs are not removed

DB is in Archive Mode. We are creating full Online Backups every night at 23:00. We set automatic removal of old online backups and archive logs. AUTO_DEL_REC_OBJ ON NUM_DB_BACKUPS 2 ...
0
votes
1answer
34 views

DB2 Transaction Logs - can they be COPY-PASTE on another Disaster Recovery Server?

We have Server1 with Online Backup1, Archive Logs 1,2,3 for example and Transaction Logs from 1 to 10. We are interested in next scenario: If Server1 fails completely and we want to move everything ...
2
votes
1answer
38 views

DB2 - Why new multiple C000000x subfolders are created in Archive Log folder?

After switching to Archive mode (from Circular mode to keeping archive logs on the disk) we had C0000000 folder where archive logs were copied. Now I noticed that folders C0000001, C0000002, C0000003 ...
1
vote
1answer
38 views

DB2 Indexes are taking very large size on disk space

I have huge table in DB with estimated size 7 GB (I saw that using DB2CC and did the action Estimate Size for that Table). In estimate size dialog I noticed that two of my indexes for that table ...
1
vote
0answers
8 views

DB2 Change Journal Receiver Size

We are running DB2 on our iSeries, and there is a journal + journal receiver created. The current size of the journal receiver is 200MB (found using the DSPJRNRCVA command). Is there a way to change ...
1
vote
1answer
121 views

ONLINE BACKUP is not performed from the CRON Job on LINUX server (manually it works)

I made a script which executes successfully online backup when it is run manually by the instance owner. Script is the following (two lines originally). #!/bin/bash /opt/ibm/db2/V9.7/bin/db2 ...
0
votes
1answer
51 views

DB2 - What is the difference between online backup and AUTO_DB_BACKUP?

We would like to perform online backup. I see that there is one parameter AUTO_DB_BACKUP. I read this article on IBM link for AUTO_DB_BACKUP ...
0
votes
2answers
268 views

DB2 ARCHIVE mode - Can all archive logs be deleted after doing the FULL OFFLINE backup?

I am interested in one thing, if I understood correctly. DB2 is in Archive mode (online backups are made and archive logs keep coming which is OK). If I made offline full backup today and I know I ...
1
vote
1answer
132 views

DB2 TRUNCATE command - DROP STORAGE option

I performed action TRUNCATE TABLE TABLENAME IMMEDIATE; but I did not used DROP STORAGE option. I read that it is default option if it is not put. It was not so big table regarding table space but I am ...
0
votes
1answer
38 views

Sql Rank for records contain multiple combinations

I am trying to filter the records which contains multiple combinations and removing the records which contains a single combination. Database DB2 Query Used: select * from (select ...
2
votes
1answer
57 views

How to change the owner of a Stored Procedure in DB2?

Let's say that I have a procedure called schema.proc1. How do I change the owner of it? I'm using db2 express-c 10.5 I've tried the following command running as the olduser, transfer ownership of ...
1
vote
1answer
32 views

How to include a where clause in a query from another column

I have two tables: pointer_table(col_name varchar, col_val varchar, wh_clause varchar) value_table(col_1 varchar, col_2 varchar, value varchar) col_name in pointer_table denotes the column in ...
0
votes
1answer
74 views

DB2 big strange problem - database is returned to CIRCULAR mode but archive logs keep coming to old archive location

my DB2 database (v 9.7) is in Circular mode. Current Logging Type:Circular (USEREXIT) = OFF (LOGRETAIN) = OFF (LOGARCHMETH1) = OFF (LOGARCHMETH2) = OFF (LOGPRIMARY) = 10 (LOGSECOND) = 10 Path to log ...
1
vote
0answers
53 views

Backup and restore db2 between instances and diferent owners

I have two instances of db2 express-c. On one of those instances I have a database onto which I created a schema with tables and stored procedures and other stuff. I've created a backup of that DB ...
0
votes
1answer
26 views

Does DB2 support host based access control?

Coming from MySQL I was wondering whether DB2 has something similar to MySQL's user@host access rights concept.
0
votes
1answer
56 views

DB2 does not start

I have installed DB2 Express-C 10.5 on my Debian 7 system, with this command: ./db2_install -f sysreq The -f option was necessary because DB2 failed to get info about my system. But now I cannot ...
1
vote
1answer
277 views

Remove all records with duplicates in db2. (Not just the duplicate records)

How can I remove all the records with duplicates in db2. I have looked at various answers but they only remove the duplicates leaving one record from that set in the table. This is what I found ...
1
vote
2answers
68 views

Best approach to maintain a single set of DDLs and DMLs for multiple database type

In our application, we support multiple types of databases namely Oracle, IBM DB2 (both UDB and ZOS), postgresql and So on. Currently we are maintaining separate DDLs and DMLs for each of these ...
1
vote
1answer
92 views

Which size is correct?

I have to estimate the size of a DB2 DB; I used several methods and the problem is I get huge differences. In order to simplify the problem, I'll focus on a unique table. Use of the following SQL ...
2
votes
1answer
213 views

How to ignore sql errors in stored procedure ? (Not handle)

I have a list of records I want to process and the cursor iterates through them from a table. The procedure just exits when it hits an insert statement and it fails. Is there a way I can ignore the ...
1
vote
0answers
133 views

DB2 connection rejected with JDBC and ODBC

Good day to all, Currently I have 4 as400 servers, with db2 installed, is the production server and development server with its two replicas. The development java team uses IBM Toolbox for Java and ...
1
vote
1answer
212 views

Can't connect to the DB2 database on localhost, using DBeaver 3.1.1

Solved: I was connecting to the wrong port, according to /etc/services | grep db2 I have a DB2 Express C v.10.5 database running on localhost, but simply I can't connect to it. Translation of the ...