Getting Started With IDS: (Informix On Campus Lecture Series)
Getting Started With IDS: (Informix On Campus Lecture Series)
Contents
Introduction to IDS
IDS – Installation and Setup
Client – Installation and Setup
Java and IDS
Informix with PHP, Ruby and Rails, and .NET
IDS Administration Basics
References
Introduction to IDS
What is IDS?
– Informix Dynamic Server
– An online transaction processing (OLTP) relational database
management system (RDBMS)
– Focused on:
• Performance/Scalability
• Ease of use/management
• Business continuity
• Security
• Adaptability to business applications design
• Support leading-edge development APIs
– Key industries
• Telco, Government, Retail, and Banking
Introduction to IDS
Classics – Cobol
IDS Strengths
Agile
High Performance, highly scalable OLTP
– From 1 CPU to 80 or more CPUs on an SMP box
– Used on Wall St. for high volume market data
IDS Architecture
Column-level
Encryption
I/O Processing
AIO*, ADM, Crypto
Custom
LIO, MISC VPs*
VPs*
PIO VPs
VPs Java UDRs
Java
Disks VPs*
Shared Memory
Buffer Pool, Locks,
Sessions, etc
Local Client
Extension
Processes
Communications
CPU
VPs Remote Client Processes
NET
VPs*
SQL execution
Installing IDS
– Extract (Windows) or untar (UNIX) the compressed file
– On UNIX and Linux
• ./ids_install -gui
– On Windows
• Click on launch.exe or setup.exe
– On MacOS – launch the self-extracting .dmg file
– Administrator or superuser privileges required for installation
– Welcome screen: Click on “INSTALL PRODUCTS”
(Note: The following screenshots are from IDS V11.50.TC3 in Windows XP.)
Creating a database
– To create a known demo database “stores”
dbaccessdemo7 stores –log –dbspace my_dbspace
– To create your own database use dbaccess and a valid SQL
statement (a command-line/screen mode client program
distributed with the server)
dbaccess - -
create database db1 in my_dbspace with log;
Ctrl + c to exit dbaccess
– dbaccess can also be used to execute a SQL script (test.sql)
dbaccess –e – test.sql
– The “-e” echoes the command to standard output
– The “-” says do not open any database, but connect to the
default server
– To enter in screen mode just type dbaccess (without any
arguments or options)
15 © 2010 IBM Corporation
Information Management – Informix
Adding space
– Logical spaces called dbspaces to store database info
– Dbspace = one or more chunks
– Chunk = physical storage like a file or a disk device
– Default in Windows:
rootdbs - C:\IFMXDATA\ol_svr_custom\rootdbs_dat.000 – 200MB
ol_svr_custom - C:\IFMXDATA\ol_svr_custom\ol_svr_custom_dat.000 – 200MB
sbspace - C:\IFMXDATA\ol_svr_custom\sbspace_dat.000 – 200MB
– To add a dbspace called my_dbspace:
• Create the file C:\IFMXDATA\ol_svr_custom\my_dbspace
• Allocate the file to IDS
onspaces –c –d my_dbspace –p C:\IFMXDATA\ol_svr_custom\my_dbspace –o 0 –s 102400
– In UNIX-type systems, the chunk file should be owned by user informix, group
informix with permissions 660
Two options
– Informix Client-SDK
• Specific to IDS
• Does not support open-source Ruby and Rails drivers
– IBM Data Server Client
• Works with IDS and DB2
• Not available on MacOS
• Does not support complex types, opaque types, interval type, and
boolean is seen as smallint
• Supports all drivers discussed in this presentation
• Switching to Informix Client-SDK involves minimal changes
Setup
– Assume Data Server driver in $JDBC_HOME and Informix JDBC
driver in $INFORMIXDIR/jdbc
– Add drivers to CLASSPATH environment variable
• Unix:
CLASSPATH=$JDBC_HOME/db2_db2driver_for_jdbc_sqlj/db2jcc.jar:
$INFORMIXDIR/jdbc/lib/ifxjdbc.jar:.
• Windows:
set CLASSPATH=%JDBC_HOME%\db2_db2driver_for_jdbc_sqlj\db2jcc.jar:
%INFORMIXDIR%\jdbc\lib\ifxjdbc.jar;.
Using the drivers
– Examples programs are included with the drivers
– Look for the ‘demo’ directory underneath the Client-SDK
installation directory or individual driver installation directory
– Refer to the book “Getting Started with IDS” by Jacques Roy
PDO_INFORMIX driver
– Stand-alone installation of the driver requires web server with
PHP setup as a prerequisite
– Download from PHP extensions community library site
– Compile source using Informix Client-SDK
IBM Data Server driver setup
– Easiest way – install Zend Core for IBM
– Available at http://www-01.ibm.com/software/data/info/zendcore/
– Includes both PDO_INFORMIX and PDO_IBM drivers
– One or both of the drivers can be enabled
– Stand-alone installation of driver is also possible
• Pre-compiled binary available in dsdriver directory, underneath the
Data Server Client install directory
• Compile source using IBM Data Server Client
Refer to “Getting Started with IDS” book
27 © 2010 IBM Corporation
Information Management – Informix
Understanding Logs
– Logging allows multiple statements in a transaction
– Logging will preserve database consistency
– Out of log space = server hang
• Add more log space
– Use OAT, or
– onparams –a –d <dbspace> -s <size in KB>
• Backup the logs and free them for reuse
– ontape
Loading and Unloading Data
– Through SQL statements
• UNLOAD TO '/tmp/file.out' DELIMITER '|' SELECT * FROM items;
• LOAD FROM '/tmp/items.out' DELIMITER '|' INSERT INTO items;
– Execute SQL statements using dbaccess client
Resources
“Getting Started with IDS”, Jacques Roy.
The Online IDS Information Center
– http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp
– One-stop shop for IDS product documentation
– Supports book marking favorite topics, narrowing the scope to refine
searches, printing subsets of topics
Resources
IBM Informix DeveloperWorks Technical Articles
– http://www.ibm.com/developerworks/db2/products/informix/index.html
– Premium technical resource site for DBAs and developers
– Features explained with examples/sample code
– Contributions from IBM experts as well as customers
IBM Redbooks
– http://www.redbooks.ibm.com/cgi-bin/searchsite.cgi?query=informix
– Publications developed by the IBM International Technical Support
Organization (ITSO)
Summary
What is IDS?
IDS – Installation and Setup
Client – Installation and Setup
Java and IDS
Informix with PHP
Informix with Ruby and Rails
Informix and .NET
Informix and MATLAB
IDS Administration Basics
37 © 2010 IBM Corporation