Use DB2 UDB V8.2 for 32-bit and 64-bit Application Development (1)

Source: Internet
Author: User

Terms
Before discussing DB2's support for 32-bit and 64-bit, we will first view and understand some of the terms and important concepts involved in the context of this article. This is very important:

  • Platform:The basic technologies of computer hardware and operating systems define how a computer runs and what kind of software can run on it.
  • Hardware:Computer and its related architecture.
  • Operating System:Controls computer hardware and allows other applications and users to use computer software. An operating system consists of a kernel and a group of operating system libraries, in which the kernel deals directly with hardware, and those operating system libraries are necessary to build and run applications.
  • DB2 instance:A logical database server environment where the DB2 database is created.
  • Database client:A computer or software program that requests access to database objects and data from the database server, runs applications, or requests services based on applications.
  • Database Server:A computer or program that includes and manages databases and processes database data requests sent by clients.
  • 32-bit:The number of binary numbers that a computer can process in parallel), or memory addressing. For example, a 32-bit computer has a 32-bit data register and uses 32-bit to identify each address in the memory.
  • 64-bit:For more information, see 32-bit. A 64-bit computer has a 64-bit data register and uses 64-bit to identify each address in the memory.

Introduction
Are you planning to migrate your database client or server to the 64-bit platform, or you just want to build and deploy applications or routines suitable for 64-bit DB2 instances, so understanding DB2's support for 32-bit and 64-bit application development is very important. It is equally important to adopt some best practices to facilitate the deployment of applications and routines and ensure that their functions in the target environment are consistent with expectations.

This article is divided into three parts: first, we will introduce you to the concepts of 32-bit and 64-bit objects, and then help you understand the 32-bit and 64-bit DB2 configuration and feature support information, finally, it helps you develop and deploy a policy that suits 64-bit DB2 instances.

  • Part I: Overview of 32-bit and 64-bit objects
  • Part II: DB2 32-bit and 64-bit applications and routine support
  • Part III: develop and deploy portable 32-bit and 64-bit DB2 applications

Part I: Overview of 32-bit and 64-bit objects
It is important to fully understand the relevance of 32-bit and 64-bit objects in the computing environment, because some dependencies between them may affect various aspects, including the hardware to be purchased and the method to deploy applications.

32-bit and 64-bit hardware
32-bit computer hardware uses 32-bit to indicate the memory address and process commands and data. 64-bit hardware uses 64-bit to do the same thing. Generally, 32-bit operating systems run on 32-bit hardware, while 64-bit operating systems run on 64-bit hardware, however, it is also possible to run a 32-bit operating system on some 64-bit hardware.

32-bit and 64-bit operating systems
An operating system consists of a kernel and a group of operating system libraries. The kernel directly deals with hardware. The operating system either has a 32-bit kernel or a 64-bit kernel, or, in some cases, both kernels. Generally, the 32-bit operating system kernel can use 4 GB of actual memory, that is, the physical RAM shared by the operating system and running applications ), the 64-bit operating system kernel can use more actual memory. Of course, some 32-bit operating system kernels can use more than 4 GB of memory, but this is not as good as the 64-bit kernel. In some operating systems, a 64-bit kernel may be required to run 64-bit applications, because such applications cannot run when a 32-bit kernel is used. All UNIX®Only AIX®. On AIX, the situation is very special. You can use any 32-bit or 64-bit kernel to run 32-bit and 64-bit applications. However, to prevent scalability problems, it is best to use a 64-bit kernel when running a 32-bit application.

The operating system library is very important because you can build and run applications with these system libraries. To build a 32-bit application, you must link the 32-bit system library. Similarly, to build a 64-bit application, a 64-bit system library is required. However, in a specific operating system, even if a 64-bit system library is provided, it does not necessarily mean that the system can actually run 64-bit applications. For 32-bit Windows®The operating system is more common. on 32-bit Windows, although some 64-bit applications cannot run, they can be compiled and linked. This is also true for UNIX platforms, because in some cases, you can install a 64-bit operating system on 32-bit hardware, and in some cases, the 32-bit kernel cannot run 64-bit applications. In fact, a 32-bit operating system can be regarded as an operating system that can only run 32-bit applications. Although a 64-bit operating system can run 64-bit applications, a 64-bit hardware is required, the 64-bit operating system kernel may also be required.

32-bit and 64-bit applications
32-bit applications are compiled based on the memory address size of 32-bit 4 bytes. These applications can directly use up to 4 GB of virtual memory-that is, the potential memory available on a computer. Regardless of the actual memory RAM that can be shared between the operating system and other applications, this virtual memory limit always exists. On the other hand, 64-bit applications are compiled based on the 64-bit 8-byte memory. More than 4 GB of virtual memory can be used, which is not limited. The operating system usually imposes more virtual memory limits on applications. Therefore, although the application has a 32-bit addressing capability, however, theoretically, the maximum virtual memory for each application may be 1-2 GB.

When you compile an application on a 32-bit or 64-bit platform, the application is compiled to run on a specific platform by default. By using special compiler-specific compilation options and properly linking to a suitable 32-bit or 64-bit library, you can also create 64-bit applications on 32-bit operating systems with certain compilers, or 32-bit applications on 64-bit operating systems.

32-bit applications can run on both 32-bit and 64-bit operating systems, but 64-bit applications cannot run on many 32-bit operating systems.

Overview of DB2 32-bit and 64-bit objects
From the perspective of DB2, of course there are also 32-bit and 64-bit DB2 objects. The 32-bit and 64-bit DB2 instances are one example. You can create a 32-bit DB2 instance on a 32-bit or 64-bit operating system, but you can only create a 64-bit DB2 instance on a 64-bit operating system. Some mixed 32-bit and 64-bit operating systems, such as AIX Version 5.1, support these two types of DB2 instances. Multiple DB2 instances can exist on the same database server to serve different user requirements, test instances and generate instances), and do not have to have the same number of digits.

DB2 applications can create 32-bit or 64-bit objects in 32-bit and 64-bit DB2 instances with most compilers at the same time, but in order to obtain the necessary functions, the 32-bit or 64-bit DB2 application must be linked to the DB2 32-bit and 64-bit databases respectively. Both DB2 instances provide such libraries.

A 32-bit DB2 external routine is a DB2 external routine process that loads and runs a 32-bit external database at call time. User-defined functions ). When a 64-bit external routine is called, the 64-bit external library is loaded and run.

After a basic understanding of the relationship between 32-bit and 64-bit objects, it is easier to understand how to manage DB2 application development practices, this allows the system to support the development and deployment of 32-bit and 64-bit applications.

Part II: DB2 32-bit and 64-bit applications and routine support
For 32-bit and 64-bit cross-platform development, DB2 UDB is indeed a common database. No database, like DB2, provides so much support for developing and deploying applications on so many platforms. Speaking of the development support for 32-bit and 64-bit applications, DB2 is at the forefront. The following section describes the key 32-bit and 64-bit DB2 platforms and application development support.

Supported 32-bit and 64-bit DB2 UDB Products
The following DB2 Universal Database products on Linux, UNIX, and Windows platforms can be used on both 32-bit and 64-bit platforms:

Table 1. supported 32-bit and 64-bit DB2 Software

DB2 Products
DB2 UDB Express Edition
DB2 UDB Personal Edition
DB2 UDB Personal Developer's Edition
DB2 UDB Developer's Edition
DB2 UDB Workgroup Server Edition
DB2 UDB Workgroup Server Unlimited Edition
DB2 UDB Enterprise Server Edition

You can use Personal Developer's Edition or any other product to develop database applications, provided that the DB2 Application Development Client is installed on the Client.

To learn more

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.