This article assumes that the use of informix starts from scratch, and describes the detailed steps for maximizing the use of informix from scratch. Note: The content about vi editing in this article is placed between the equal signs of two rows. You need to edit and save the disk.
1. Download the informix-online Database Server LINUX Trial System
Address: http://www.intraware.com, register as a user of the informix trial system, and tell the correct email address, then intraware will send you an email, tell you the installation authorization name and password of the system on this site that will be downloaded later. Of course, the name and password of the authorized user will also appear on the screen during the download. You must copy the name carefully. Generally, the authorization name is different from your name)
After successful registration, go to the evlaute, evaluation, or trial download link page, login in to enter the download page, and select the informix product you want. This document uses linux as an example to download informix dynamic_server_2000bar, that is, informix_dynamic_server_2000_s_o_v9_21_uc2_for_linux.zip.
IIPrepare to install informix-online 2000/Decompress the downloaded file informix_dynamic_server_2000_s_o_v9_21_uc2_for_linux.zip, whether it is downloaded by win or linux)
In linux, log on to the system as the root user.
1: Create an informix User Name (adduser)
2: Create an informix group (groupadd)
3: Changing the attributes of the informix user's home directory
# Chown informix. informix/home/informix
If you use win for download:
1: If LINUX is not installed and started on the same machine, mount the hard disk partition where the downloaded file is located. For example, if I am d:
# Mkdir/mnt/win
# Mount-t vfat/dev/hda5/mnt/win
2: if LINUX is installed on another machine, only samba sharing is set. Copy the informix online 2000 system downloaded under Windows to/mnt/win in the directory of a LINUX machine)
3: If you downloaded it from linux, use the stored directory. In this example, it is still/mnt/win ).
Start 3
Go to the downloaded informix online directory
# Cd/mnt/win
Set the installation environment
# INFORMIXDIR =/home/informix
# Export INFORMIXDIR
Since the directory structure of the informix online 921 installation package rpm downloaded by interware is/opt/informix or/usr/informix, not necessarily/home/informix. The installation command is as follows:
# Rpm-ivh-relocate/opt/informix =/home/informix informix_dynamic_server_2000_s_o_v9_21_uc2_for_linux.rpm
During installation, you are required to enter your authorization number and password. We recommend that you do not install this package in the GUI environment. Generally, the installation may fail.
Start 4: Set the LINUX operating environment
# Cd/etc
# Vi hosts
========================================================== ========================================
# Add your NIC address, HOST name, and other computer addresses to access the machine as needed
========================================================== ========================================
# Vi services
========================================================== ========================================
Sqlexec 9999/tcp # Your informix Database Server service name will be sqlexec
========================================================== ========================================
# Cd/root set the ROOT User Startup environment)
# Ls-
# Vi. bash_profile
========================================================== ======================================
PATH = $ PATH: $ HOME/bin: $ HOME/etc:/home/informix/bin:/home/informix/etc
.......
INFORMIXDIR =/home/informix
INFORMIXSQLHOSTS =/home/informix/etc/sqlhosts
INFORMIXSERVER = demo_on # Name of the online server, which is different from the service name
TERM = 100 # display the menu of informix dbaccess
Export path ........ INFORMIXDIR INFORMIXSERVER INFORMIXSQLHOSTS TERM
========================================================== ========================================
Set the informix user environment
# Cd/home/informix
# Ls-
# Vi. bash_profile
========================================================== ========================================
PATH = $ PATH: $ HOME/bin: $ HOME/etc
.......
INFORMIXDIR = $ HOME
INFORMIXSQLHOSTS = $ HOME/etc/sqlhosts
INFORMIXSERVER = demo_on # Name of the online server, which is different from the service name
TERM = 100 # display the menu of informix dbaccess
Export path ........ INFORMIXDIR INFORMIXSERVER INFORMIXSQLHOSTS TERM
========================================================== ==========================================
Create an online service database. Assume that you want to create a data space file in/home/informix. Otherwise, enter/home/informix in the directory to be created ), obtain a name, such as root_chunk.
# Cd/home/informix (Data Space Directory)
# Cat/dev/null> root_chunk
# Chmod 660 root_chunk
Set other attributes
# Cd/home/informix
# Cd etc
# Cp sqlhosts. std sqlhosts
# Vi sqlhosts
========================================================== ==========================================
# Format: online server name protocol name HOST Name service name
Demo_on onsoctcp myhostname sqlexec
========================================================== ==========================================
# Cp onconfig. std onconfig
# Vi onconfig
========================================================== ==========================================
# Change all such as/opt/informix to/home/informix
................
ROOTPATH/home/informix/root_chunk
..................
ROOTSIZE 40000 (set the size of the data space as per your needs, in kilobytes, for example, 40 MB)
..................
DBSERVERNAME demo_on is the same as that in sqlhosts)
========================================================== ==========================================
OK, set it. Press ctrl + d to exit logout and use root to enter login.
Start informix online
At the first startup, You need to initialize informix online
# Oninit-I (in lower case, the parameter is used only for the first time). If there is anything, yes. Wait for half a minute.
# Ps-ef: the online server is started.
# Onmode-k shut down the online server,
# The oninit method directs the online server again in the normal way. No parameter is required.
Congratulations! Your informix online has been running well.
5. How to configure ODBC access to informix online in win
First download the informix connect for win (informix odbc driver) or client software package. I was copied to me by someone else. You can consult someone else or find a specific website. If it is not too slow, you can go to http://winhelp.163.net/win_nt95-informix-odbc.zip to download the example and write it in a small article. Install it on the Windows server. For example, set the directory to c: \ informix.
1 run informix Setnet32
In Enviroment, set:
INFORMIXDIR = c: \ directory where the ODBC/Connect client is installed
INFORMIXSERVER = demo_on (name of the online database server)
INFORMIXSQLHOSTS =/home/informix/etc/sqlhosts (same as sqlhosts on Linux)
Set in Server Information:
Informix Server = demo_on (online database Server name)
Host Name = myhostname (HOST Name of LINUX)
Protocol Name = onsoctcp
Service Name = sqlexec (Service Name)
Set in HOST Informix:
Current Host = myhostname (HOST name of LINUX)
User Name = informix (User Name in linux, which can be left blank here, required)
Password Option = password
Password = move the cursor to the header of the edit box and fill in more than six letters
2. Set windows to a file similar to/etc/services on linux.
On the Windows server, the services file is located in the win directory of your Windows Server, for example, c: \ win98.
In a DOS environment,
C: \ win98> Edit services
========================================================== ====================================
# Add the following lines
Sqlexec 9999/tcp
========================================================== ====================================
3. Set Informix ODBC.
Informix ODBC or Connect or Client generally provides two drivers, one for informix 9th Intersolve 3.10 32-bit informix 9) and the other for earlier versions (Informix 2.80 32 bit ).
Go to the control panel and open the ODBC setting box.
1) Add a Data Source for ODBC driver 9th, set the driver to Intersolve 3.10 32-bit informix 9, and define the Data Source Name. For example: informix9, define Data Source Description the Data Source Description is arbitrary. Define the name of the database to be accessed, for example, mydbs (the name of the database you created in Linux ), default User Name: the Default User Name is the username on informixLinux. You can enter it as needed. The Host Name is defined as myhostname (the machine Name of your Linux Database Server) define Database Service Name as demo_on (set in your Linux sqlhosts) Protocol to SET Protocol Type to onsoctcp
(2) Add a Data Source for the ODBC settings of previous versions. Select the driver as Informix 2.80 32-bit and define the Data Source Name.) For example: informix7, define Data Source Description the Data Source Description is arbitrary. Define the name of the database to be accessed, for example, mydbs (the name of the database you created in Linux ), the Default User Name is the username on informixLinux, which can be set as needed ),
Set Host Name to myhostname (the Name of the machine where your Linux database server is located) and database Service Name to demo_on (set in your Linux sqlhosts)
SET Protocol Type to onsoctcp
OK. Now you can try other programs that support ODBC to view the database content, such as sqlexplorer in delphi/cbuilder. The registration dialog box is displayed, you must enter the correct username and password on your Linux system that have the permission to access the informix online database, you can see the table, content, and process of mydbs in your database on win.