Questions tagged [db2]

DB2 is a family of database servers developed by IBM. Supported platforms for DB2 servers are z/OS (formerly OS/390), Linux, UNIX, and Windows (referred to collectively as DB2 for LUW), and IBM i (formerly OS/400 or i5/OS). Originally designed as a relational engine, IBM has expanded DB2's capabilities on some platforms to include native XML support and an RDF-compliant graph store. When posting DB2 questions, please specify the platform and version.

DB2 is a family of database servers developed by IBM. The supported platforms for DB2 servers are z/OS (formerly OS/390), Linux, UNIX, and Windows (referred to collectively as DB2 for LUW), and IBM i (formerly OS/400 or i5/OS). Originally designed as a relational engine, IBM has expanded DB2's capabilities on some platforms to include native XML database features and an RDF-compliant graph store. On the IBM i platform, DB2 for i is tightly integrated into the operating system in a variety of ways, including a unique file system layer that allows database tables to be treated as structured files and vice versa.

DB2 for LUW has different editions: Express-C, Express Edition, Workgroup Server Edition, Enterprise Server Edition and Advanced Enterprise Server Edition. Each of these editions has different engine capabilities and different limits on the amount of RAM and the number of CPU cores that DB2 can use. DB2 for LUW offers a smooth upgrade path for databases that were created in a lower edition of the product (e.g., going from Workgroup Server Edition to Enterprise Server Edition).

DB2 Express-C is a no-cost DB2 engine that runs on Linux and Windows and is authorized for production use and redistribution. As part of the DB2 10.5 release in June 2013, IBM extended the system resource limits for DB2 Express-C to allow the database engine to use up to 16GB RAM and two CPU cores and set a maximum size of 15 terabytes per database.

In October 2009, IBM introduced DB2 pureScale, a database cluster solution for AIX on System p, suitable for online transaction processing (OLTP) workloads. Linux x86_64 support for DB2 pureScale on IBM System x hardware was added in August 2010. IBM based the design of DB2 pureScale on the Parallel Sysplex implementation of DB2 data sharing on z/OS. DB2 pureScale provides a fault-tolerant, clustered database engine that uses low-latency RDMA messaging and GPFS shared storage to present the appearance of a single, monolithic database to the application layer.

To handle large data volumes and complex queries that are common to online analytical processing (OLAP), DB2 for LUW provides a shared-nothing clustering implementation known as the database partitioning feature (DPF), which uses hash key partitioning to evenly distribute a single copy of the database across multiple servers. Incoming queries are automatically multiplexed to access multiple partitions in parallel. DPF was introduced in 1994, as was at times rebranded as DB2 Parallel Edition, DB2 Extended Enterprise Edition, or InfoSphere Warehouse.

The 10.5 version includes the BLU acceleration that consists in storing the data in columnar format. It allows us to store data in rows or columns, and that improves analytics performance.

Free DB2 Books

12687 questions
2
votes
1 answer

include 0 in count sql

Suppose I have this table: |MY_TABLE| | ID_COL | | 1 | | 1 | | 2 | | 2 | Now I want to do a count query on this table that would include zero results. When I try to run my query: Select ID_COL,count(ID_COL) from MY_TABLE…
jaypax123
  • 188
  • 2
  • 14
2
votes
1 answer

three or more tables JOIN USING common key

Does this work for any RDBMS? CREATE TABLE TBLA (MYKEY CHAR (10 ), FLDA CHAR (10 )); CREATE TABLE TBLB (MYKEY CHAR (10 ), FLDB CHAR (10 )); CREATE TABLE TBLC (MYKEY CHAR (10 ), FLDC CHAR (10 )); Query: select mykey, flda,…
Charles
  • 21,637
  • 1
  • 20
  • 44
2
votes
4 answers

SQL - suppressing duplicate *adjacent* records

I need to run a Select statement (DB2 SQL) that does not pull adjacent row duplicates based on a certain field. In specific, I am trying to find out when data changes, which is made difficult because it might change back to its original value. That…
Trevel
  • 801
  • 1
  • 7
  • 13
2
votes
1 answer

JDBC via BPXBATCH - how to get TSO-user credentials?

I have a little java program that reads a db2 table via jdbc. This program is invoked via "tso bpxbatch myjavatool". I wonder if there is the possibility to "pass" the username/password of my TSO user to the JDBC driver? For example, if I connect to…
Klaus Schulz
  • 527
  • 1
  • 5
  • 20
2
votes
1 answer

License ERROR with DB2 driver on linux

Im trying to connect to a DB2 db. ive installed driver server package from IBM 10.5. When i try to connect to the db2 server im receiving that message: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a…
2
votes
2 answers

DB2 Stored Procedure IF statement

I am currently experimenting with stored procedures and I am try to implement a simple IF/ELSE statement. I am using DB2 and I am trying to select all records if the procedure parameter is null and if the parameter is not null, query the…
LiamWilson94
  • 458
  • 2
  • 7
  • 26
2
votes
1 answer

Select data from table with column name and description SQL Server

I have a legacy table with all column named in an old way, the names don't make sense to others, but the table description contains column description, how to can select all data from the table, and combine with the column description? UPDATED…
triston
  • 493
  • 1
  • 10
  • 24
2
votes
1 answer

how to get dump db2 database?

I have 3 questions : 1. How to get db2 dump database -with command like mysqldump- 2. If I want this dump to contain lookup tables is this possible to do that or I have to export lookup tables manually one by one ? 3. How I can use the output dump…
Flowra
  • 1,350
  • 2
  • 16
  • 19
2
votes
1 answer

OutputStream to the BLOB column of a DB2 database table

In a DB2 database, I have the following table: CREATE TABLE MyTestTable ( MYPATH VARCHAR(512) NOT NULL, MYDATA BLOB, CONSTRAINT MYTESTTABLE_PK PRIMARY KEY (MYPATH) ); Using Java, I wish to update an existing row in this table with…
Perihelion
  • 33
  • 1
  • 6
2
votes
3 answers

DB2 Transaction log is full. How to flush / clear it?

I’m working on a experiment regarding to a course I’m taking about tuning DB2. I’m using the EC2 from Amazon (aws) to conduct the experiment. My problem is, however, that I have to test a non-compression against row-compression in DB2 and to do that…
Emil Devantie Brockdorff
  • 4,724
  • 12
  • 59
  • 76
2
votes
1 answer

Recursive query in DB2 to get all items in the chain

I have to retrieve all clients linked via loans by giving only one as input. Example I have a table data as TABLEA LOAN_ID CLIENT_ID 1 7 1 8 2 7 4 8 4 9 4 10 5 9 5 11 13 …
daniel
  • 31
  • 1
  • 1
  • 4
2
votes
1 answer

db2 sql pattern matching

I have a table in db2 which has the following fields int xyz; string myId; string myName; Example dataset xyz | myid | myname -------------------------------- 1 | ABC.123.456 | ABC 2 | PRQS.12.34 | PQRS 3 | ZZZ.3.2.2 |…
Jitesh
  • 23
  • 1
  • 3
2
votes
3 answers

Keep First N number of rows and delete the rest

trying to write a sql which will keep first N number of rows of a table and delete the rest. I'm have comeup with this sql but the its saying I can't use the count here. Please help me to re write the sql. DELETE FROM ZZ_TEST_FINTABLE WHERE…
user3396478
  • 176
  • 2
  • 13
2
votes
6 answers

Should we drop stored procedures and run database calls from java programs

I am fighting to keep the use of stored procedures in our company. There are a few people who say they are bad and we should not use them. We are using DB2 on the i-series. Please help in my argument to keep stored procedures alive in my company.
Doug
  • 390
  • 8
  • 20
2
votes
1 answer

Can I create a dataset XSD without using the designer?

I want to be able to create the XSD file for my typed dataset without using the visual studio dataset designer. Is there a way to do this using for instance a command-line tool? There is some magic happening when a table is dragged from the server…