个人工具

UbuntuHelp:Servers/Ingres

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:26的版本 (New page: {{From|https://help.ubuntu.com/community/Servers/Ingres}} {{Languages|php5}} == Ingres Quickstart == How to build, install and set up an Ingres 2006 server in ubuntu. == Introduction ==...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


Ingres Quickstart

How to build, install and set up an Ingres 2006 server in ubuntu.

Introduction

Open source database solutions that provide enterprise-level functionality, services and support are revolutionizing today’s marketplace.

Features

Ingres is a complete relational solution, providing the following features:

  • A robust, high-performance relational database management system (RDBMS) on which you can build the best in mission-critical applications.
  • Support for the latest technology, such as multiple processors and 64-bit architecture, and standards such as XML and Unicode. The extensive list of supported platforms includes Linux for zSeries and S/390, UNIX, and Windows.
  • Easy to manage environment that requires far less maintenance than the competition. Ingres is hard to beat in the area of long-term cost of ownership.
  • The Ingres Management Architecture (IMA) tools provide the framework that allows you to create system management applications using standard SQL tools and access multiple installations across Ingres Net.
  • Ingres Web Deployment Option provides users with a secure and reliable foundation for Internet-based electronic commerce. Applications developed with Ingres Web Deployment Option can be used to provide full read/write access to enterprise-wide corporate data. Database-driven web sites provide much greater flexibility and can reflect changes in dynamic content as they happen.
  • Open connectivity lets you integrate the entire enterprise—from PCs to mainframes. Ingres Net, coupled with the Ingres ODBC and JDBC drivers, let you take advantage of the technologies that drive the business environment. Through ODBC, Ingres allows transparent access to enterprise data repositories. Applications developed through ODBC are independent of hardware, networking protocols, and operating systems. The Ingres ODBC driver uses the native API (application programming interface), effectively making ODBC a native language for Ingres. If you prefer, you can use the OpenAPI to provide access to all distributed databases and take advantage of an alternative to embedded SQL.
  • Integration of data from multiple sources on different platforms from a single application. The Enterprise Access products provide a single, standard interface for both relational and pre-relational databases. Real-time access is provided for a variety of client applications running on Windows, OpenVMS, UNIX, and Linux workstations, as well as through web browsers. Popular application development tools can utilize this technology, meaning that your options are unlimited. Databases supported include all popular UNIX or Microsoft Windows-based database management systems such as Oracle, Informix, Sybase, and Microsoft SQL Server. On the OS/390 platform, a separate product called EDBC gives the same level of access to Advantage CA-IDMS Database, Advantage Datacom Database, DB2, VSAM, CICS/VSAM, and IMS — so you can truly take your data from anywhere.
  • Ingres Distribution Option supports distributed databases across a wide variety of hardware, software, and networking architectures. Regardless of whether the data resides on desktops or mainframes, Ingres Distributed Option lets you treat all your enterprise data as a single, global Ingres database.
  • Ingres Replicator Option provides fault-tolerant data replication and guaranteed data integrity. Two-way replication allows your business to carry on when the network link is down. This process holds the data and completes the replication as soon as the network becomes available. Data is readily available to users at anytime or anywhere, and can be administered using the graphical user interface of Visual DBA.
  • The Ingres character-based tools including Embedded SQL and Vision are available for more traditional environments. Embedded SQL programming kits are available for C, COBOL, Fortran, and several other 3GLs.
  • Additional platform-specific, TP monitoring, and cluster support options, provide the integrity and reliability you need in a distributed environment by ensuring that transactions do not get lost or damaged.
  • The Ingres Cluster Solution on Linux provides support for Linux Cluster environments. Ingres exploits open source and third party software to provide extensions to the base operating system. This software includes cluster file systems such as Oracle Cluster File System (OCFS) and the Red Hat Global File System (GFS), and the OpenDLM Distributed Lock Manager (DLM) based on the AIX DLM released by IBM to the open source community. Linux Cluster support lets you achieve scalability and reliability on a low-cost clustering platform.

Building Ingres

Unfortunately, there is no Ingres pre-built package for Ubuntu. Therefore you should build Ingres from source.

Preparing to build

Building Ingres from source requires installation of a few tools with a specific versions.

# sudo apt-get install gcc-3.4 g++-3.4 make jam 
</code>

Also, you should make those tools your defaults, 

<pre>
# sudo rm /usr/bin/gcc
# sudo rm /usr/bin/g++
# sudo rm /usr/bin/cpp
# sudo rm /usr/bin/cc
# sudo ln -s /usr/bin/gcc-3.4 /usr/bin/gcc
# sudo ln -s /usr/bin/g++-3.4 /usr/bin/g++
# sudo ln -s /usr/bin/cpp-3.4 /usr/bin/cpp
# sudo ln -s /usr/bin/gcc-3.4 /usr/bin/cc
</code>

so when query the version of each one you will get 3.4.*, as:
<pre>
# gcc --version
gcc (GCC) 3.4.6 (Ubuntu 3.4.6-1ubuntu2)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# g++ --version
g++ (GCC) 3.4.6 (Ubuntu 3.4.6-1ubuntu2)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# cpp --version
cpp (GCC) 3.4.6 (Ubuntu 3.4.6-1ubuntu2)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</code>

Now you should create new user account in the system.
Add new user, the username is not important, but I will use 'ingres' for example.

<pre>
# adduser ingres
</code>

Add the created user to the kmem group:

<pre>
# useradd -g kmem ingres
</code>

Switch the user to ingres:
<pre>
# sudo -u ingres -s
# cd /home/ingres
</code>

Create a new folder 'ingres2006-src', and move there:
<pre>
# mkdir ingres2006-src
# cd ingres2006-src
</code>

Then, you should download the source of the Ingres 2006 from http://downloads.ingres.com/download/ingres2006-9.0.4-103-gpl-src.tgz :
<pre> 
# wget http://downloads.ingres.com/download/ingres2006-9.0.4-103-gpl-src.tgz
</code>

Extract the archive:
<pre>
# gunzip < ingres2006-9.0.4-103-gpl-src.tgz    | tar xvf - 
</code> 

Set ING_ROOT to the current folder:
<pre>
export ING_ROOT=`pwd`
</code>

=== Building Dependencies ===
In addition to the Ingres source code itself, you will need the Xerces 2.5 headers and library (which provide the XML link between Ingres and the Apache web server), and you will need the Kerberos network authentication protocol headers.

Also required for the build is a special version of pax (the Portable Archive Interchange program). Modifications have been made to this program to allow it to work with the Ingres checkpoint process. (Support has been added for the OCFS file system and for Linux files up to 8GB in length.  While the standard version of pax is adequate for creating the Ingres tar installation medium, it is not suitable for Ingres runtime operations.) All of these dependencies are included with the Ingres source package. 

==== Building pax ====
Building pax is so simple:

<pre>
# cd $ING_ROOT
# sh build.sh
</code>

==== Building xerces-c ====
To build Xerces, you need to modify one file in its source code.
Move to '$ING_ROOT/xerces-c-src_2_5_0/src/xercesc/util' folder, and create a patch file 'RefArrayOf.hpp.patch'
<pre>
# cd $ING_ROOT/xerces-c-src_2_5_0/src/xercesc/util
# vi RefArrayOf.hpp.patch
</code>

The patch file should contain this text:
<pre>
103a104 
> #include <xercesc/framework/MemoryManager.hpp>
</code>

Patch RefArrayOf.hpp:
<pre>
# patch RefArrayOf.hpp < RefArrayOf.hpp.patch
</code>

Build Xerces-c 

<pre>
# cd $ING_ROOT/xerces-c-src_2_5_0 
# export XERCESCROOT=`pwd` 
# cd $XERCESCROOT/src/xercesc 
# autoconf 
# runConfigure -plinux -cgcc-3.4 -xg++-3.4 -minmem -nsocket -tnative -rpthread 
# make
</code>

=== Building Ingres itself ===
You should move to $ING_ROOT, and then prepare the environment variable as:
<pre>
# cd $ING_ROOT
# source src/tools/port/jam/bldenv
</code>

Next, bootstrap the build.  This includes building mkjam and mkjams, which automate the creation of Jamfiles, and then invoking mkjams to set up the build tree:

<pre>
# cd $ING_SRC/tools/port/jam
# jam
# mkjams
# cd $ING_SRC
</code>

You are now ready to compile Ingres.  This is done with the following command:
<pre>
# jam
</code>
Because of the voluminous output of the build process and because you may want to examine the full output, it is wise to redirect the jam output to a file.  For example:
<pre>
# jam >& jam.out &
# tail -f jam.out
</code>

In my computer it took about 15 minutes to finish the compilation. In the end you should get no skipped or failed targets.

====  Auditing the build ====

Some warning messages are expected during the build process (for explanations of some of these, see the Ingres building FAQ at http://www.ingres.com/).

How can you tell, then, if the build was successful?  First, look at the final messages issued by jam.  Jam should report a (large) number of targets "updated", and should NOT report any targets as "failed" or "skipped".

You should also run two programs to check the status of the build process for Ingres itself and for its testing tools.  To be sure that the building of all Ingres components is successful, use the buildrel program's audit option:

<pre>
# buildrel -a
</code>

Note that the buildrel audit step is required, since buildrel (in addition to checking for missing files) adjusts the file permissions of some of the built files.  If the Ingres build is successful, buildrel will not report any missing files.
  
As a final auditing step, make sure that all the files needed for Ingres acceptance testing were correctly built:

<pre>
# tartools -a
</code>

If this command too reports no missing files, your build is complete!

==== Packaging Ingres ====

Ingres can be packaged for installation either as a standard tar ball or as a set of RPM packages.  There is no documentation how to build a .deb packages for ubuntu for now.

In ubuntu, you will be using the tar format. Therefor you must first assemble the Ingres components for packaging using the buildrel program.

First, set up a staging area for this assembly process.  Typically, you would want to name this staging directory based on the "build=" line in $ING_SRC/tools/port/conf/VERS.  For example, if the VERS file contains the line build=00 you would use the following commands:

<pre>
# mkdir -p $ING_ROOT/release/r00
# cd $ING_ROOT/release/r00
# export II_RELEASE_DIR=`pwd`
# buildrel
</code>

To create an installable Ingres tar ball, simply create a tar file that contains the components of this staging area:

<pre>
# tar cvf ../ingres.tar *
</code>

There is nothing magic about the name "ingres.tar".  For clarity (keeping track of product builds and the resulting tar files) you
could call this, for example, "r00.tar" or "ingres_r00.tar".
== Installing Ingres ==
TODO
== Further Reading ==

== References ==
1. The INSTALL file in the ingres source package.

2. A post from Michael Touloumtzis in http://groups.google.com/group/fa.ingres/browse_frm/thread/d6c232ec984d101c/28e793aa27600861?tvc=1#28e793aa27600861

3. Ingres® 2006 Getting Started (gs.pdf).

4. Ingres® 2006 for Linux Getting Started (gs-linux.pdf).

[[category:UbuntuHelp]]