

Leveraging your Oracle 9i skills to learn DB2 UDB v8

Shows you how to use your current knowledge of Oracle 9i to quickly gain skills in DB2 UDB for Linux, UNIX, and Windows Version 8.

If you're a database specialist interested in growing your DB2® Universal DatabaseTM skills, there's a good chance...

that you've already developed database skills with another relational database product somewhere along the way. In an earlier developerWorks article I talked about how to leverage your MS SQL Server 2000 skills to learn DB2 UDB for Linux, UNIX® and Windows®. Is your background in Oracle rather than SQL Server? If so, read on. In this article, we will show you how to use your current knowledge of Oracle 9i to quickly gain skills in DB2 UDB for Linux, UNIX, and Windows Version 8.

In this article, we will use the term "Oracle" to refer to Oracle 9i Release 2 and "DB2 UDB" to refer to DB2 UDB for Linux, UNIX, and Windows Version 8.

Overview of System Structures

To start out, we need to understand the architecture used by Oracle and how it compares with DB2 UDB. Figure 1 shows the system structure of Oracle. Compare it with Figure 2, which shows the system structure of DB2 UDB. Refer back to these figures for understanding as you read the article.

Figure 1. Oracle system structure on Linux, UNIX, and Windows Version 9.2


Figure 2. DB2 UDB system structure on Linux, UNIX, and Windows Version 8


The concept of an instance is similar in both Oracle and DB2 UDB. In both cases an instance is a combination of background processes and shared memory. The major difference between the two is that in Oracle there can only be one database per instance, while in DB2 UDB multiple databases can share an instance.

Because there is a one-to-one correspondence between database and instance, in Oracle you create an instance implicitly by creating a database with the CREATE DATABASE command. Alternatively, to create an Oracle instance on your machine you can use the Database Configuration Assistant, or you can use the ORADIM utility, available with Oracle 9i with the NEW option. You must also provide certain information including a System Identifier (SID) or a service name, instance password, maximum number of users, startup mode, and so on. Similarly, to delete the instance the ORADIM utility can be used with the DELETE option. You would need to pass in either the SID or the service name. There is no default instance created with a fresh install of Oracle unless you create a new database during the installation process.

In DB2 UDB, after installing the product in the Windows platform, the instance "DB2" is created by default. In Linux and UNIX, the default instance name is called "db2inst1". To create another instance in the same machine, you simply execute the command db2icrt <instance name>.

Figure 3 shows the default DB2 UDB instance "DB2" (in Windows) and two other instances created with the db2icrt command from the DB2 UDB Control Center GUI.


Figure 3. DB2 UDB Control Center GUI showing DB2 UDB instances
Figure 3. DB2 UDB Control Center GUI showing DB2 UDB instances

To reference a given DB2 UDB instance from a command line interface, use the environment variable DB2INSTANCE. This variable lets you specify the current active instance to which all commands would apply. For example, if DB2INSTANCE is set to PROD, and then you issue the command create database MYDB1, you will create a database associated with instance PROD. If you wanted to create this database on instance DB2 instead, then you would first have to change the value of the DB2INSTANCE variable to DB2. This is similar to the ORACLE_SID (System Identifier) which is also used when users want to switch between instances.

Another easy way to identify the instance you want to work with is by using the DB2 UDB Control Center GUI as shown in Figure 3. To see an entry for the new instance in this tool, you may have to add the instance to the GUI by right clicking on Instances and choosing Add. To drop an instance in DB2 UDB, you can execute the command db2idrop <instance name>.

In summary, in Oracle the Database Configuration Assistant can be used to create, modify, start, stop and delete the instance, while in DB2 UDB the Control Center GUI can be used for a similar purpose. Also an Oracle instance can only have a one-to-one relationship with a database, while in DB2 UDB this is not the case. Multiple databases can exist and be concurrently used in a DB2 UDB instance.


In Oracle, a database can either be created manually using the CREATE DATABASE command or by using the Database Configuration Assistant. Creating the database manually requires that a series of steps be followed, including setting OS variables, preparing the parameter file, and creating a password file before the CREATE DATABASE command can be executed.

Metadata information is stored and managed by the Data Dictionary, which is composed of base tables, and corresponding views. The base tables are created automatically during database creation, and the views are constructed by running the catalog.sql and catproc.sql scripts.

The Oracle database is therefore seen as a collection of 3 file types:

  1. Data File: Contains actual data, physical implementation of the database. (Similar to Containers in DB2 UDB)
  2. Redo File: This is equivalent to Transaction Logs in DB2 UDB.
  3. Control File: Contains information to maintain and verify database integrity.

In DB2 UDB, an instance can contain several databases, as shown in Figure 2. Each database is a truly closed and independent unit. Each database has its own catalog table space, temporary table space, and user table space which are created by default upon successful database creation. DB2 UDB does contain a binary file known as the system database directory that contains entries of all the databases you can connect from your DB2 UDB machine. This directory is kept at the instance level.

When an instance is created, no databases are created by default. You need to explicitly create a database using the create database command. You can also create a database using the Control Center as shown in Figures 4 and 5.


Figure 4. Creating a DB2 UDB database using the Control Center GUI


Figure 5. Creating a DB2 UDB database using the Control Center GUI (continued)

In Figure 5, you can also see what happens when you click Show Command. All DB2 UDB Control Center GUI screens let you see the SQL statement or command that is actually executed in the background. These commands can be saved in scripts for execution at a later time, or can be copied and executed from the Command Line Processor (CLP) tool or Command Center GUI tool. These tools are equivalent to Oracle's SQL*Plus and iSQL *Plus respectively.

A DB2 UDB database can be dropped by using the 'DROP DATABASE' command or from the DB2 UDB Control Center GUI. In Oracle there is no such command; a database is deleted by deleting all the associated datafiles.

Databases within an instance normally don't interact with each other. However, if your application needs to interact with more than one database, this requirement can be supported by enabling federation support. See the resources section for an article about federation.

Containers, table spaces, bufferpools and pages

In Oracle, data is physically stored in files called Data Files. This is similar to DB2 UDB's containers where data is physically stored. Every Oracle database contains a table space named SYSTEM, which Oracle creates automatically when the database is created. Other table spaces for user, temporary and index data need to be created after the database has been created, and a user needs to be assigned to these table spaces before they can be used.

In DB2 UDB, a table space is the logical object used as a layer between logical tables and physical containers. When you create a table space, you can associate it with a specific buffer pool (database cache) as well as to specific containers. This gives you flexibility in managing performance. For example, if you have a "hot" table, you can define it in its own table space associated with its own buffer pool. This helps ensure the data for this table is continuously cached in memory.

In DB2 UDB three default table spaces are created automatically upon database creation when using default values for the CREATE DATABASE command. Table 1 describes the default DB2 UDB table spaces:

Table 1. DB2 UDB table spaces created by default when a database is created with default values

Table space Name Description
SYSCATSPACE Catalog table space containing metadata.
TEMPSPACE1 System temporary table space used to perform operations such as joins and sorts. The name of this table space can be changed.
USERSPACE1 This table space is optional and can be used to store user tables when a table space is not explicitly indicated at table creation time.

Because databases in DB2 UDB are independent units, table spaces are not shared across databases. Since they are only known within a database, two different databases can have table spaces of the same name. You can see this in Figure 2 where database MYDB1 has a table space named MYTBLS and database MYDB2 has a table space of the same name.

DB2 UDB table spaces can be classified as SMS (system-managed spaces) or DMS (database-managed spaces). SMS table spaces are managed by the operating system and can only be directories. They grow automatically as needed; thus SMS provides good performance with minimum administration. DMS table spaces are managed by DB2 UDB, and can be files or raw devices. This type of table space allows for best performance, but some administration is required. For example, you need to specify ahead of time the amount of space you want to allocate for the table space, because growth is not automatic.

Oracle does not have the SMS concept for its storage model but its data files are similar to DB2 UDB DMS table spaces. That is, you can increase a database size by either adding a datafile to the table space, by increasing the size of the data file, or by adding a new table space.

Table 2 below shows how Oracle databases or table spaces map to DB2 UDB databases or table spaces.

Table 2. How Oracle databases map to DB2 UDB databases and table spaces

Oracle database or table space DB2 UDB database or table space
SYSTEM is the table space that holds the catalog (Data Dictionary) information. SYSCATSPACE (catalog table space); as in Oracle, this information is kept only at the database level.
Data Dictionary (contains metadata in form of tables and views) and resides inside the SYSTEM table space. System Catalog Tables (identified by the SYSIBM schema) and system views (identified by the SYSCAT OR SYSSTAT schema) and reside inside the SYSCATSPACE table space
SCOTT database SAMPLE database
TEMP table space System Temporary table space (By default it is called tempspace1)
UNDO table space N/A
USER table space User table space. By default, USERSPACE1 is normally created after database creation

As indicated earlier, Oracle's data buffer concept is equivalent to DB2 UDB's bufferpool; however, DB2 UDB allows for multiple bufferpools to exist. There is no predefined number of bufferpools that you can create, and they can have any name.

The concept of an Oracle block is most similar to DB2 UDB's page. A DB2 UDB page can have a size of 4k, 8k, 16k or 32k. A table row must fit in only one page; it cannot span to other pages as in Oracle.

Object names

An Oracle object name takes the following form:


In DB2 UDB, objects also have a two-part structure:


As in Oracle, the DB2 UDB schema name is used to group objects logically. An important difference, however, is that in DB2 UDB, a schema name does not have to match to a user id. Any user with a privilege called IMPLICIT_SCHEMA can create an object using a non-existing schema. For example, suppose that "Peter" has IMPLICIT_SCHEMA privilege and executes this command:

    CREATE TABLE WORLD.TABLEA (lastname char(10))

In this case, the table WORLD.TABLEA is created, where WORLD is the newly created schema. If Peter had not explicitly indicated the schema, then the table PETER.TABLEA would have been created, because the connection ID is used by default.

In DB2 UDB you always connect to a database before issuing database specific commands; therefore, under this architecture, object names need not include the database name.

Tables, views, and indexes

Tables, views and indexes are basically the same in both Oracle and DB2 UDB.

DB2 UDB provides a utility called Design Advisor which can be used to recommend indexes for a particular query or workload. The Design Advisor can be invoked from the DB2 UDB Control Center or from the DB2 UDB CLP using the db2advis command. In DB2 UDB, indexes are directly tied to the table definition. For example, when using DMS table spaces you can specify in which table space the indexes can reside as follows:

CREATE TABLE mytable (col1 integer, col2 char(10)) in tbls1 index in tbls2

The above example shows that the data for the table will be stored in table space 'tbls1', while the index pages will be stored in table space 'tbls2'. This is in contrast to Oracle syntax where the CREATE INDEX statement provides an option to specify in which table space the index will reside.

Also, once an index has been created in DB2 UDB, you cannot alter any clause of the index definition. You would need to drop the index and create it again in order to implement changes.

As in Oracle, DB2 UDB tables, views and indexes in different databases can have the same names. Tables and views within the same database must have distinct names, but creating an index with the same name as either an existing table or view is allowed.

Stored Procedures, triggers and user-defined functions (UDFs)

There are many ways to create and access stored procedures, triggers and functions in an Oracle environment. PL/SQL, the object-oriented (OO) procedural extension of SQL, supports the manipulation of data (DML), flow control, declaration of variables and constants, procedures and function definitions and also OO data types such as nested tables and varray. Oracle also incorporates the JVM into its engine. Stored procedures, functions and triggers can be created, stored and executed as classes in the Oracle database using SQLJ. Oracle also supports JDBC drivers Type 1 through 4.

DB2 UDB stored procedures can be written in any language supported by the DB2 UDB precompilers, including Java, C, C++, REXX, Fortran, and COBOL. However, the recommended language to use is the SQL Procedural Language (SQL PL), which is fairly similar to Oracle's PL/SQL. A C compiler is needed to develop SQL PL stored procedures, as these are first translated into C. A C implementation of stored procedures may provide performance advantages because the code is compiled once (especially if run in unfenced mode); however, it also adds the requirement of having this compiler on the development system. In a future release of DB2 UDB, support for SQL PL stored procedures without the need of a C compiler is expected. DB2 UDB stored procedure development also supports SQLJ and Java using JDBC drivers type 1 through 4.

Development of triggers and functions can use inline SQL/PL which does not require a C compiler. A subset of SQL PL statements are supported in this way. The DB2 Development Center Tool can be used to easily create, build, debug and deploy DB2 UDB stored procedures and user-defined functions.

Configuration Files

Traditionally Oracle stores all session and system-related parameters in a text file, normally referred to as initSID.ora. However due to the non-persistent nature of this text file, starting from Oracle 9i, Oracle introduced Server Parameter File (SPFILE), which is a binary parameter file stored on the server. This persists across instance shutdown and startup. The initSID.ora file is still used, however, when an SPFILE is not available. Prior to the introduction of SPFILE, any ALTER SYSTEM and ALTER SESSION commands that affected parameters would only persist during that instance or that session. The DBA would have had to manually modify the initSID.ora text file whenever a rebound of a database instance was intended. Network access configurations are typically stored in listener.ora for listener and tnsnames.ora for client access.

With DB2 UDB, configuration parameters are also stored at the instance level, known as the database manager configuration file, and at the database level, known as the database configuration file. Most of these parameters can be changed dynamically, that is, there is no need to stop and restart the instance or force all connections before the change to the parameter value takes effect.

If you would like to manually change a specific database manager parameter from the CLP, use the command UPDATE DBM CFG USING <parameter name> <new value>.

If you would like to manually change a specific database parameter from the CLP, use the command UPDATE DB CFG FOR <database name> USING <parameter name> <new value>.

These commands would be the equivalent to Oracle's ALTER SYSTEM and ALTER SESSION. Alternatively, using the Control Center, you can review and change values for these parameters; if you right click on a given instance and choose Configure Parameters, you will see the window shown in Figure 6.


Figure 6. DB2 UDB Database Manager configuration parameters (instance level)

At the database level, right clicking on a given database, and choosing the Configure Parameters displays the window shown in Figure 7.


Figure 7. Database configuration parameters (database level)
Figure 7. Database configuration parameters (database level)

DB2 UDB provides many parameters you can use to configure your system; however, if you would like an easy way to configure the system automatically, use the autoconfigure command (or the Configuration Advisor GUI) which sets the database manager and database configuration parameters to optimal values based on some information you provide. Figure 8 shows the Configuration Advisor.


Figure 8. - DB2 UDB Configuration Advisor
Figure 8. - DB2 UDB Configuration Advisor

In addition to configuration files, DB2 UDB also uses DB2 Registry variables normally for platform-specific configurations. Note, the DB2 Registry variables have no relationship whatsoever to the Windows registry. Use the command db2set to review and change these variables.

Connectivity (network access) information is stored in the System database directory, local database directory and node directory. These are binary files and can only be modified with the CATALOG and UNCATALOG commands.

Memory architecture and background processes

Next we'll look at the memory architecture and background processes, and will compare and contrast the way they are used in Oracle and DB2 UDB.


Figure 9: Oracle Memory Architecture and Background Process
Figure 9: Oracle Memory Architecture and Background Process

The System Global Area (SGA) in Oracle is a group of shared memory areas that stores information for the instance. Examples include statement cache, redo log buffers, and data buffer cache. The Program Global Area (PGA) and the User Global Area (UGA) shared memory areas contain data and control information for server processes and user sessions.

Oracle supports multiple instances within the same machine but background processes are not shared. For example, three instances in one machine will require three set of background processes. Therefore it is generally recommended to have one database, one instance and multiple schemas within the same machine.


Figure 10: DB2 UDB Memory architecture and background processes
Figure 10: DB2 UDB Memory architecture and background processes

Both DB2 UDB and Oracle use shared memory areas, but DB2 UDB's memory architecture is implemented in a slightly different way than Oracle's. Since a DB2 UDB instance can contain more than one database, two levels of configuration exist. As we mentioned in the previous section, instance level configuration can be done in the DBM CFG file while the database level configuration is done in the DB CFG file. Configuration parameters at both levels can be adjusted to tune memory usage. The section below provides a bit more detail on DB2 UDB's memory structures and different background processes.

Unlike Oracle where memory is allocated to both the instance and the database upon startup, DB2 UDB allocates memory at different levels. This is primarily due to the fact that a DB2 UDB instance can contain multiple databases. There are three main memory structures in DB2 UDB:

  • Instance Shared Memory: This refers to the database manager global shared memory, which is allocated when the instance is started using the db2start command, and remains allocated until a db2stop command is issued to stop the instance.
  • Database Shared Memory: This refers to the database global memory, which is allocated when the database is activated or connected to for the first time. Memory allocated includes buffer pools, locklist, database heap, utility heap, package cache and catalog cache.
  • Application Shared Memory: This refers to the memory allocated when an application connects to a database and is used by agents that do the work requested by the connected clients. Each application connected to the database has memory allocated to it; therefore accurate configuration of the parameters affecting the application shared memory becomes crucial.

In DB2 UDB for Windows, server activities are conducted in the form of threads, while in Linux and UNIX environment these are implemented as background processes. DB2 UDB processes operate in the following levels:

  • Instance Level: These are processes that are initialized when an instance is started:
    1. DB2 Daemon Spawner (db2gds): Global daemon processor started for each instance. (only in UNIX)
    2. DB2 System Controller (db2sysc): Main DB2 process.
    3. DB2 Watchdog (db2wdog): Parent process for all other processes.
    4. DB2 Format Log (db2fmtlg): Similar to the ARCn process in Oracle, pre-allocates log files in the log path.
  • Database Level: These are processes that are initialized when a connection is made to a database.
    1. DB2 Log Reader (db2loggr): Similar to the subset of Oracle's PMON process. This process reads log files during rollback, restart recovery and roll forward.
    2. DB2 Log Writer (db2logw): Flushes log from log buffer to the transaction log files on disk. Equivalent to LGWR process in Oracle.
    3. DB2 Page Cleaner (db2pclnr): Equivalent to DBWR process in Oracle, this process cleans the buffer pool before pages from the disk are moved into the BP.
    4. DB2 Prefetcher (db2pfchr): Retrieves pages from disk and places into the buffer pool before it is needed.
    5. DB2 Deadlock Detector (db2dlock): Deadlock detector process.

  • Application Level: Each application connecting to the database would have its own share of application-level background processes associated with it. These are as follows:
    1. DB2 Communication Manager (db2ipccm): Inter-process communication process for each locally connected client.
    2. DB2 TCP Manager (db2tcpcm): TCP communication manager process for remote clients connecting using TCP/IP.
    3. DB2 Coordinating Agent (db2agent): Process that handles all requests on behalf of an application.
    4. DB2 Subagent (db2agnta): Idle subagent.
    5. Active Subagent (db2agntp): Active subagent used when SMP parallelism is enabled so that multiple processes are used for a single task.

For a comprehensive explanation of DB2 UDB's processes please refer to the article 'Everything You Wanted to Know about DB2 Universal Database Processes'.

Locking Mechanism

Locking in Oracle can be either manual or automatic. The Oracle Lock Manager can implicitly lock table data at the row level, or default locks can be overridden at transaction or session level using the following SQL statements:

Oracle supports a mechanism called Multi Version Read Consistency which is implemented by undo data in the undo segments.

DB2 UDB implements ANSI standard Isolation levels such as Uncommitted Read, Cursor stability, Read stability and Repeatable Read. A user will only see committed data unless the Uncommitted Read isolation level is used. Row locks are acquired implicitly according to the isolation level. Database objects that are lockable are table spaces, tables and rows, however, only tables and table spaces can be explicitly locked. The LOCK TABLE command can be used to lock a table instead of using the default row locking.

Unlike Oracle, in DB2 UDB, locks are stored in the memory and not in data pages. The LOCKLIST database configuration parameter can be used to configure the memory available for locks, while the MAXLOCKS configuration parameter defines the maximum amount of memory for a particular application's locks.


Both Oracle and DB2 UDB are secure databases with basic and advanced security features. In Oracle, there are 4 different user authentication methods, as follows:

  • Database: The database performs both identification and authentication of users.
  • External: The operating system or network service performs authentication
  • Global Authentication and Authorization: The user is authenticated globally by SSL
  • Proxy Authentication and Authorization: The middle-tier server performs authentication.

The authentication method is specified when creating the user using the CREATE USER command. There are several Data Dictionary views that contain information about these users.

In DB2 UDB, users do not exist within the database, but are rather managed by the operating system. No database login information is kept in any database table. Any operating system user can potentially use DB2 UDB; however, unless they have been granted a given DB2 UDB authority or privilege, there is not much they can do. Granting and revoking authorities and privileges can easily be handled through the Control Center GUI. You first may have to add a user or group to the Control Center from the available operating system users or groups.

Also in DB2 UDB the term "roles" is not used; instead, DB2 UDB uses the term "authorities", which are similar to Oracle's database roles, whereby privileges are granted to certain groups or users. The authorities supported with DB2 UDB are: SYSADM, SYSCTRL, SYSMAINT, DBADM and LOAD.

The SYSADM, SYSCTRL and SYSMAINT authorities cannot be granted using the GRANT SQL statement. These special authorities can only be set from the database manager configuration file.

DB2 UDB also uses the term "privilege" which is similar to Oracle's system and schema object privileges. There are database privileges (connect, createtab, and so on) and database object privileges (schema, table, view, and so on). Figure 11 shows DB2 UDB security information obtained from the Control Center GUI. Most of the tabs shown on the Change User window correspond to the privileges supported by DB2 UDB.


Figure 11. DB2 UDB Security
Figure 11. DB2 UDB Security

There are other aspects of database security beyond privileges and authorities. Briefly, here are some of the differences and similarities between Oracle and DB2 UDB:

User Authentication and Authorization

Oracle uses an encrypted password stored in the dictionary once a user is created. DB2 UDB supports passwords for user authentication and uses the underlying operating user for authentication. Both Oracle and DB2 UDB support LDAP (Oracle Internet Directory and IBM Directory Server). Both Oracle and DB2 UDB support single sign on (SSO). 

Data Encryption

Oracle supports data encryption where sensitive data such as credit card numbers and some highly sensitive business data can be encrypted. DB2 UDB allows data encryption at the column level.

Network Encryption

Oracle provides network encryption with its Oracle Advanced Security. Oracle uses DES, 3DES and RC4 industry standard encryptions. DB2 UDB by itself does not enforce network encryption. However network encryption can be achieved using add-on Tivoli SecureWay.

Audit Trail

Oracle allows you to audit trail users and objects. Log miner can also be used for investigating and analyzing suspicious queries. DB2 UDB provides a similar auditing facility. The db2audit utility can be used for this purpose.


We shall look at tools from different areas such as database creation and maintenance, network, administration GUI, performance tuning, data movement and backup-recovery tools. Figure 12 shows the DB2 UDB GUI tools.


Figure 12. DB2 UDB GUI Tools
Figure 12. DB2 UDB GUI Tools

Let's take a look at how similar tasks are performed in Oracle and DB2 UDB.

Database Creation and Maintenance

Oracle provides the Database Configuration Assistant (dbca) as the GUI tool to create databases. For database maintenance, Oracle provides the Oracle Enterprise Manager. DB2 UDB databases can be created and maintained from the DB2 UDB Control Center.


Oracle provides the Network Configuration Assistant (netca) for network configuration. Alternatively, you can use the Oracle Network Manager to configure service naming, listener, profile and Oracle name servers. DB2 UDB uses the CATALOG command to catalog nodes and databases. Cataloging can also be done using either the DB2 UDB command line or DB2 UDB Configuration Assistant GUI.


The Oracle Enterprise Manager provides a wide range of administrative capabilities for the day-to-day tasks of administrators. DB2 UDB Control Center provides similar functions as Oracle Enterprise Manager. Apart from the DB2 UDB Control Center, the DB2 UDB command line processor can also be used to issue DDL and DML statements. This utility is similar to the Oracle SQLPLUS utility. Figure 13 shows the DB2 UDB command line processor.


Figure 13. DB2 UDB Command Line Processor
Figure 13. DB2 UDB Command Line Processor

Commands can also be issued from the Command Center, shown in Figure 14.


Figure 14. Command Center GUI (GUI version of DB2 UDB Command Line Processor)

Performance Tuning

Oracle Enterprise Manager comes with Change Management pack, Tuning Pack, and Diagnostic Pack. DB2 UDB provides the Event Analyzer, Health Center, Indoubt Transaction Manager and Memory Visualizer as GUI tools for performance tuning tasks.

Data movement

Oracle provides SQL Loader (sqlldr) for loading data in delimited text format. Import (imp) and export (exp) can be used to perform logical import and export. DB2 UDB provides similar import, export and load utilities . For cross platform data movement, DB2 UDB provides the db2move utility.

Backup and Recovery

Oracle provides Recovery Manager as an option for hot backup. Backing up databases in DB2 UDB can be accomplished using the backup command or the DB2 UDB Control Center.


In this article we've introduced you to DB2 UDB for Linux, UNIX and Windows Version 8 by using your current knowledge of Oracle 9i Release 2 as leverage. We briefly described the DB2 UDB architecture, background processes, memory model, security, tools, and so on. There are many similarities between Oracle and DB2 UDB, and we have pointed out some of the differences so you can use your current knowledge to become successful with DB2 UDB. For more information on this topic, be sure to review the Oracle to DB2 UDB Conversion Guide Redbook. This is the most current and complete document describing how to migrate from Oracle to DB2 UDB. You will find many more details on the topics we have covered in this article.

Table 3 summarizes the differences and similarities between Oracle and DB2 UDB that we've discussed.

Table 3 - Summary of Oracle vs. DB2 UDB concepts

Oracle DB2 UDB Comment
Instance Instance A DB2 UDB instance can contain several databases
Database Database  
initSID.ora OR SPFILE DBM CFG andDB CFG DB2 UDB uses two levels of configuration:- Database Manager Configuration (DBM CFG) (at the instance level)- Database Configuration (DB CFG) (at the database level).Like in Oracle, many of these configuration parameters can be dynamically changed.
Table spaces Table spaces DB2 UDB supports SMS and DMS Table spaces. DMS Table spaces are similar to Oracle's.
Data Blocks Pages DB2 UDB supports these page sizes: 4k, 8k, 16k, 32k. A row must fit any of these page sizes. It cannot span to other pages like in Oracle's.
Extents Extents  
Data Files DMS Table space containers Containers for DMS table spaces can be raw devices or files.
Redo Log Files Transaction Log Files  
Data Buffers Buffer pools. DB2 UDB does not have a predefined set of bufferpools, but you can create as many as desired. A bufferpool of a given page size must be exist prior to creating a table space with the given page size.
SGA Database Manager and Database Shared memory  
Data Dictionary Catalog  
Library cache Package cache  
Large Pool Utility Heap  
Data Dictionary Cache Catalog cache  
SYSTEM table space SYSCATSPACE table space  



About the authors

Suita Gupta works as a DB2 UDB Technical Support representative for PartnerWorld® for Developers. Suita has DB2 certifications in both application development and administration. She focuses most of her time helping ISVs with DB2 Application Development related problems. If you would like to learn more about PartnerWorld for Developers, please visit

Allan Tham works as a DB2 Content Manager Technical Presales Support for Business Partners. Allan helps business partners solve a wide range of technical issues. Allan has DB2 Content Management certification for administration. Prior to joining IBM, Allan worked in an end user environment, where he was an Oracle DBA for 3 years.

Raul Chong is a database consultant from the IBM Toronto Laboratory and works primarily with IBM Business Partners. Raul has worked for six years in IBM, three of them in DB2 UDB Technical Support, and the other three as a consultant specializing in database application development and migrations from other RDBMSs to DB2 UDB.
This was last published in January 2004

Start the conversation

Send me notifications when other members comment.


Please create a username to comment.