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
17
votes
7 answers

How can I find all indexes available on a table in DB2

How to find all indexes available on table in db2?
Rumik
  • 181
  • 1
  • 1
  • 3
17
votes
3 answers

How to call a stored procedure in IBM System i Access for Windows GUI Tool

I would like to test a DB2 stored procedure running on an AS400 system. I have the IBM System i Access for Windows installed and can run SQL commands against the DB2 database. My question is: What is the syntax to execute a stored procedure that…
Ken Burkhardt
  • 3,528
  • 6
  • 33
  • 45
17
votes
10 answers

DB2 SQL Convert Decimal to Character with Padded Zeros

How can I convert my DECIMAL(11) field from 12345678 to a character value of 00012345678?
macunte
  • 463
  • 2
  • 8
  • 18
17
votes
5 answers

Sharing a Java synchronized block across a cluster, or using a global lock?

I have some code that I want to only allow access to by one thread. I know how to accomplish this using either synchronized blocks or methods, but will this work in a clustered environment? The target environment is WebSphere 6.0, with 2 nodes in…
pkaeding
  • 36,513
  • 30
  • 103
  • 141
16
votes
6 answers

DB2 Drop table if exists equivalent

I need to drop a DB2 table if it exists, or drop and ignore errors.
Roman Iuvshin
  • 1,872
  • 10
  • 24
  • 40
16
votes
6 answers

DB2 400 drop column

I want to drop a column called id which is an auto incrementing PK. The SQL: alter table "CO88GT"."XGLCTL" drop column id cascade; And I get: Error: [SQL0952] Processing of the SQL statement ended. Reason code 10. SQLState: 57014 ErrorCode:…
Quaternion
  • 10,380
  • 6
  • 51
  • 102
16
votes
2 answers

SQL concatenate rows into one field (DB2)

I need to extract some data from my DB2 database. I have keywords in one table and each keyword is a separate row. In the extract I want to have all keywords for all IDs in one string separated by a comma. So, to explain: I have such data ID …
Karolina
  • 185
  • 1
  • 2
  • 9
16
votes
1 answer

Configure SQuirreL for DB2

How to configure SQuirreL for DB2 access. In SQuirreL I do see two DB2 drivers. But they are both marked with an red X. I checked with Start Page but did not find an easy solution :/
Thorsten Niehues
  • 13,712
  • 22
  • 78
  • 113
16
votes
1 answer

Connect to IBM DB2 with .Net using only .dll reference

I would like to connect to a DB2 database, specifically an iSeries version, using .Net and C# by referencing a .dll and NOT installing any software on the server. Currently we use the IBM.Data.DB2.iSeries.dll, which is installed as part of iSeries…
Blake Mills
  • 824
  • 2
  • 9
  • 15
16
votes
12 answers

How to split a string value based on a delimiter in DB2

How do you split a string value in DB2? For example, given the value: CHG-FFH. I want to split on the dash (-), which would result in two values: CHG FFH. I tried using split function but it is not a function in DB2. Any help will be…
sTg
  • 4,313
  • 16
  • 68
  • 115
16
votes
2 answers

How to combine date and time into a timestamp in db2?

In a db2 database I have a DATE column and a TIME column, how can you combine these into a single TIMESTAMP?
xan
  • 7,440
  • 8
  • 43
  • 65
16
votes
5 answers

Comparing DB2 dates

I have a DB2 DATE type field in a DB2 table. I want to select data by a date filter. For example: SELECT * FROM table WHERE registrationdate > '2002-10-01'; From the above query, I get records with registrationdate starting from '1943-10-01',…
yons88
  • 439
  • 2
  • 5
  • 20
15
votes
9 answers

Connect DB2 with Java

How can I connect DB2 with Java in Eclipse? What are some step-by-step instructions? How can I add the classpath in Eclipse? Code snippet: import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.DriverManager; import…
ramya
  • 928
  • 5
  • 14
  • 30
15
votes
4 answers

Different NuGet package based on operating system

I have a test project in dotnet 2.1 that needs to work across multiple platforms (specifically, windows and linux-based systems) as well as access DB2 databases. IBM provides separate NuGet packages for different operating…
Muttonchop
  • 353
  • 4
  • 22
15
votes
1 answer

pad varchar numbers with 0s in db2

Is there a way to pad 0s before numbers stored as VARCHAR in DB2? Like this: some_column result ----------- ------ 12 ==> 00012 123 ==> 00123 6454 ==> 06454
DateTime
  • 151
  • 1
  • 1
  • 3