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

-4
votes
0answers
8 views

How to order by two columns in DB2?

I know how to order by one column: db2 "EXPORT TO out.csv OF DEL MODIFIED BY CHARDEL'' coldel^ decpt,select XXX,YYY,ZZZ from foo.bar order by ZZZ" But how do I order by two columns?
1
vote
0answers
15 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
22 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
31 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
34 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
35 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 ...
-1
votes
0answers
10 views

DB2 - Sql to get only the multiple records starting from 1 in row number function

Please help me in writing a sql script to get only the multiple records in row number function inclusive of rownumber 1 record. Example: ***Column 1 Column2 Row_number*** Apple orange 1 ...
2
votes
0answers
28 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
26 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
14 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
21 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
27 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
27 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
23 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
6 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
34 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
23 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
55 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
91 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
31 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
32 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
31 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
59 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
25 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 ...
-1
votes
0answers
15 views

What is difference between CM mode and NFM mode in DB2 V10.1

What is main difference between CM mode and NFM mode in DB2 V10.1. Please let me know features for NFM mode.
0
votes
1answer
24 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
36 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
66 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
64 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
49 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
104 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
72 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
84 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 ...
6
votes
2answers
434 views

Does DB2 order data by the primary key

I've recently had a discussion with a colleague who was pushing to remove order by clauses from a production query because the order by column was the same as the primary key. After a lengthy ...
1
vote
1answer
68 views

DB2 Express User ID Authority Error [closed]

I'm trying to create a sample database in first steps after installing db2 Express V10.5 I've looked at the answers provided below, but I'm not able to resolve my issue. How to grant rights for a user ...
1
vote
0answers
24 views

Recovery model of current database

I want to know how can I change the recovery model of my current database. I am having sysadm rights.Operating system is windows, Db2 10.5. can some one let me know the command please
1
vote
0answers
61 views

I can't divide 2 count(*) values without returning zero

The statement I'm using is for a KPI in Maximo and I currently have this statement: select (select count(*) from incident where incident.slanum = 'USERADMIN' and incident.actualfinish > ...
0
votes
2answers
95 views

DB2 9.5 - Shrink Tablespace

I'm trying to run the following: db2 alter tablespace TABLESPACE1 reduce I keep getting errors. As you can see, I have around 50% free pages. I'd like to shrink it in order to reclaim OS disk space. ...
1
vote
1answer
36 views

Schema copy from 9.5 V to 10.5

Using DB2 move utility db2move to copy schema and database from source to target server. The source server is Server1. The target server is Server2. Do I need to set up the TCP/IP port ...
1
vote
0answers
36 views

Delete Query throwing warning db2

I am trying to delete multiple records from view The view has Instead of Trigger defined .. The view has records consolidated from multiple tables. [db2inst1@testServer001 ~]$ db2 "delete from ...
1
vote
2answers
35 views

DB2: What's the fast way to drop a big partitioned table?

We got a partitioned table with 100000000+ rows, when I drop it it takes 10+ hours and finally failed. how to speed drop command up ?
1
vote
2answers
54 views

DB2 database -> does it continue to be platform-specific? (iSeries, LUW, z/OS)

Wikipedia says DB2 is no longer Platform-specific: Historically and unlike other database vendors, IBM produced a platform-specific DB2 product for each of its major operating systems. However, in ...
1
vote
0answers
81 views

How Do I Get DB2 NoSQL User-Defined Functions to Work

I am using NoSQL in DB2 10.5 FP4. I am creating and connecting to the database with the 'db2admin' administrator user ID on my Windows machine. I also used the 'db2 attach to DB2_01 as db2admin' ...
1
vote
0answers
242 views

How to Start DB2 10.5 HADR on the Standby Database

I am trying to set up HADR to run on my DB2 10.5 DB2 servers. I believe I have followed the steps correctly, but I'm getting the following error: [db2insh1@rslvm20 OneView]$ db2 restore database ...
1
vote
1answer
44 views

How Do I Grant Permissions to Replace a Function?

I am getting the following error message (when trying to enable NOSQL in DB2 10.5, although I don't think that's really the issue): Error code: -551 DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, ...
1
vote
0answers
92 views

db2_install do not have write permission on the directory or file

This is the error I encountered (I ran the db2_install and everything else as root,): DBI1288E The execution of the program /home/DB_SERVER/ibm/db2/v10.5 failed. This program failed because ...
1
vote
0answers
34 views

DB2 zOS increasing DSSIZE vs adding partition?

I'm trying to load data into a DB2 table. The tablespace has 3 partitions with about 60M,60M,70M rows. The 3rd partition is failing to load. It gives me a warning that loading this partition's dataset ...
2
votes
1answer
52 views

Has some command that lists the privileges of a user in db2?

I'm using db2 9.7 on linux and i want to list my privileges on database... Ex: SYSADM, SECADM, DBADM, etc. So, has some command in db2 that lists the privileges of a user in db2?
1
vote
1answer
55 views

How can i give SECADM to instance owner in DB2?

i'm using db2 9.7 on linux and created a user "db2fee1i" to be a instance owner. I restored a database, but even being SYSADM i only can connect to database. I need to give DATAACCESS to another user, ...
1
vote
1answer
82 views

How to determine when REORG with LONGLOBDATA is required (DB2)

REORGCHK only identifies when a reorg is required for space reclamation on normal (non-LOB) data. Is there a way of determining how many pages are wasted due to LONG and LOB data that has been ...