• Icinga and Oracle Part1 - Installing Oracle
Skip to end of metadata
Go to start of metadata

This howto series should show the steps to bring up Icinga with Oracle 

Part1: Icinga and Oracle Part1 - Installing Oracle Software

Part2: Icinga and Oracle Part2 - Building software

Part3: Icinga and Oracle Part3 - Configuration

Part4: Icinga and Oracle Part4 - Monitoring Oracle

Overview

  • install Oracle server software and database if you need and get it running 
  • install Oracle full Client or Oracle Instant Client on Icinga server (and on your build machine if this is different)
  • set Oracle environment variables to your Icinga and your build user environment
  • make sure you have access to Oracle database with tnsping and/or sqlplus from Icinga and build server
  • build and install ocilib
  • build Icinga and plugins
  • install Icinga and plugins
  • build small running icinga basesetup without ido
  • create Icinga database user and tablespaces;
  • create Icinga ido schema objects
  • modify ido2db settings for Oracle
  • modify icinga.cfg to enable idomod
  • modify idomod.cfg if needed
  • optional:install icinga-web

Part1 Installing Oracle Software

install database server

You can skip this step if you have a running Oracle database available

There are several ways to get an Oracle database up and running. It also depends if you are in a production or a test environment. You need Oracle version 10.1 or up. Free Oracle database version "Oracle XE" for Linux and Windows may be sufficient, it is easy to install but lacks a lot of features often used and is a little bit outdated. See http://www.oracle.com/technetwork/database/express-edition/overview/dbxe-faq-129842.pdf and install Guide (links see below) Ch.3 limitations. All other versions are not free but downloadable from Oracle Technet (OTN) http://www.oracle.com/technetwork/index.html, free account required and is free of charge for testing proposes. See Oracle OTN License Agreement for details and limitations.

option 1: use prebuild VM

For a test environment the easiest way to get an Oracle database is to use one of the prebuild developer virtual machines offered by Oracle, currently at http://www.oracle.com/technetwork/community/developer-vm/index.html.

option 2: install prebuild Oracle XE as package
Oracle XE 10gR2

as of Aug 2011 Oracle XE 10gR2 is retired, but works well with lower system requirements than the actual version Oracle XE 11gR2

Minimum recommended hardware sizing: Pentium/Athlon 1Ghz+, 1GB RAM
Software requirements for XE on Windows: Windows2000SP4+, XP SP1+, Server2003
Installation Guide Windows: http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm]
Software requirements for XE on Linux: Debian or RPM package manager, glibc 2.3.2+, libaio 0.96+ X86(32bit)
see Oracle Installation Guide: http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25144/toc.htm
For installation of XE you must be root.

you will find the installation in /usr/lib/oracle/xe. Your sys and system password is "oracle" as defined within response file

  • set environment: TNS_ADMIN to directory containing sqlnet.ora, NLS_LANG=AMERICAN_AMERICA.UTF8 (depending on your OS locale and charset settings), expand PATH and LD_LIBRARY_PATH with $ORACLE_HOME/bin and $ORACLE_HOME/lib . This can be done for all users in Linux by adding into /etc/profile.d but at least for user oracle and icinga
Oracle XE 11gR2

Software requirements for XE on Linux:

RPM package manager, glibc 2.3.4+, libaio 0.3.104+ x86-64 only, RHEL/OEL 4+5/SuSE ES10/11, RHEL/CentOS6 is not named, but works for me. There are no debian packages available until now.
see Oracle Installation Guide: http://download.oracle.com/docs/cd/E17781_01/install.112/e18802/toc.htm

Minimum recommended hardware sizing: Intel/AMD 64bit 2Ghz+, 2GB+ RAM overall, but XE is limited to assume only one core and 1GB RAM. See Ch.3 "Licensing Restrictions" within install guide

For installation of XE you must be root.

you will find the installation in /u01/app/oracle/ Your sys and system password is "oracle" if you defined this within response file

  • set environment: TNS_ADMIN to directory containing sqlnet.ora, NLS_LANG=AMERICAN_AMERICA.UTF8 (depending on your OS locale and charset settings), expand PATH and LD_LIBRARY_PATH with $ORACLE_HOME/bin and $ORACLE_HOME/lib . This can be done for all users in Linux by adding into /etc/profile.d but at least for user oracle and icinga
  • Alternativ if only local: use supplied scripts in $ORACLE_HOME/bin (source oracle_env.sh or oracle_env.csh)
option 3: install full Oracle Server with included installer

To get full features you need to install current Oracle server software. Download it from OTN http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html) Server File1 and File2 are sufficient.

Server requirements for Oracle 11R2 installation:
Intel Atom 2GB RAM, 4GB filesystem for Oracle software +4GB installation files (temporary), 4GB filesystem for Oracle system database instance files + space for own data. Don't calculate too low! With respect of the current hardware you should have 100GB filesystem and 2GB RAM available for Oracle.
If you are not working directly on the server, you will need an XWindow client (Windows users: I suggest PuTTY for ssh and XMing as XWin-Server)

Manual Oracle server installation steps (not all details are covered here, see howtos in OTN and Oracle installation guides for your OS and your Oracle version http://tahiti.oracle.com. Here are the steps for CentOS 5.5:

  • read and fulfil software dependencies for your system (e.g. add required system packages)
  • read and fulfil kernel parameter requirements and hard limits
  • create mountpoints and filesystems for Oracle software installation and datafiles. Oracle recommends an "OracleFlexibleArchitecture (OFA)"-installation (4 mountpoints called /u01 ... /u04, I use the classical approach in /opt/oracle)
  • create a dba and oinstall user group
  • create an oracle (and oinstall) user, assign dba group to oracle and oinstall group to both
  • remove os user limits for these users
  • chown Oracle filesystems to oracle:dba user (installation will change this partially to oinstall)
  • login as oracle user. ssh users needs X11 forwarding enabled with -x switch. An "su oracle"command will not forward your display. You should connect directly to the oracle user. If you are using putty+Xming start Xming first. Then within putty dialog before(!) connecting you need to set the X11forwarding flag (checkbox) in configuration dialog section "Connection->SSH->X11"
  • test XWindow capability
  • extract Oracle Server Software in a large (4GB+ ) filesystem. I use /opt/oracle/install.
  • make sure your TEMP and TMP environment variables are pointing to a filesystem >1GB

For Oracle 10g on Linux other than RHEL it might be necessary to drop/ignore/fake the "Supported OS" check by editing /opt/oracle/install/database/install/oraparam.ini

  • define ORACLE_BASE and ORACLE_HOME environment variables.

Now run installer java gui by starting

This will not start if your XWindow system doesn't work as checked with the xclock test!!!

  • within the installer gui
    • check and correct prereq. installer errors
    • choose "stand-alone" database installation
    • install default (seed) general purpose or OLTP database instance. Memory settings defaults to 40% of system memory. You should not have less than 768MB for Oracle, but take care to leave enough memory for all other processes (avoid swap). Modify file locations with your own file system layout as created in the beginning. The installer offers to build customer configured instance. This is the best, but you have to provide a lot of options and parameters. Usually, the seed database is sufficient in general and details might be changed later
    • run root*.sh scripts as root in second terminal as suggested, then continue
    • skip other assistants
      Post installation tasks as root
  • set variables: TNS_ADMIN to directory containing sqlnet.ora, NLS_LANG=AMERICAN_AMERICA.UTF8 (depending on your OS locale and charset settings), expand PATH and LD_LIBRARY_PATH with $ORACLE_HOME/bin and $ORACLE_HOME/lib. This can be done for all users in Linux by adding into /etc/profile.d but at least for user oracle


Back to console as Oracle create network configuration files

  • run $ORACLE_HOME/bin/netca or create network configuration files manually (listener.ora, sqlnet.ora, tnsnames.ora) in /var/opt/oracle. Create a listener, choose local and ezconnect naming method and optionally create an entry for the instance you just created. Icinga-Web needs EZconnect adapter, idoutils may operate with both, tnsnames and ezconnect
  • add Oracle server, listener and Enterprise Manager Console startup to your init.d
  • check if listener and Oracle database processes are up

Post installation tasks as Oracle

  • test local connect as oracle with sqlplus "/ as sysdba". This needs ORACLE_SID set to <instance_name> as above
  • Check remote connectivity and common errors described in Connectivity Tests. If all checks are successful, you can proceed with Oracle Client installation.

Client installation

If you are on the same box where your Oracle server lives, you don't need special client software from Oracle. All is already available within your server installation. But to have access to this your DBA (oracle user) has to make most all of files and directories within $ORACLE_HOME readable (and executable for binaries and dirs). If this will compromise your security policies you also need the client software as described below.

There are two different kinds of client software available: Full (fat) Client and (limited) Instant Client. If possible you should prefer the full client. I found more than one issue which has been solved with using the full Client or DB-Server installation. But this client is bundled to the Oracle server license. As of now, the instant client may be distributed as part with other software. But check current Oracle client policies before doing that. You need the same client on your Icinga server as the version you build ocilib. You can have installed both versions if you can ensure, your current profile will only point to one of them at time.

Oracle Full Client installation

Full client can be downloaded from the same page as the server software but you have to click "SeeAll" first. This Full client install follows the same methods as described in server installation but no init.d or daemon processes are installed. For CentOS

  • read and fulfill software dependencies for your system (e.g. add required system packages)
  • create oracle user and dba group (if not already there) and create directories
  • login as oracle user, ssh users needs X11 forwarding enabled:
  • test XWindow capability
  • extract Oracle client software. I use my /opt/oracle/install previously created
  • make sure your TEMP and TMP environment variables are pointing to a filesystem >1GB

For Oracle 10g on Linux other than RHEL it might be nessesary to drop/ignore/fake the "Supported OS" check by editing /opt/oracle/install/database/install/oraparam.ini

  • define ORACLE_BASE and ORACLE_HOME environment variables.

Now run installer java gui by starting

This will not start if your XWindow system doesn't work as checked with the xclock test!!
choose "Runtime Installation", if you don't know the details


Create profile with Oracle environment variables and put it to the profile.d or into another location

  • source environment just created
  • copy network configuration files (at least tnsnames.ora and sqlnet.ora) to $TNS_ADMIN.
  • test connectivity to server. see Connectivity Tests
Oracle Instant client

Oracle Instant client you will find currently on http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
You need the full base, sdk and sqlplus package. Currently not used, but maybe in future is the "ProC" precompiler. If you have java based applications you can also download JDBC supplement software.
Installation is quite easy: unzip all in a directory and set environment variables

Create profile with Oracle environment variables and put it to the profile.d or into another location

  • copy at least tnsnames.ora and sqlnet.ora to $TNS_ADMIN
  • source environment just created
  • check network connectivity with sqlplus (tnsping is not available with instant client). See Connectivity Tests

Oracle Connectivity Tests, common errors and solutions

There are some basic checks you should fulfil to make sure you are able to connect. Without this your Icinga will not be able to connect to your database as well.
<tnsname> may have several formats. Usually it is the name you gave your instance in tnsnames.ora. But to use icinga-web you need the EasyConnect Syntax "//<dbhost>:<port>/Servicename" Servicename is one of the instance configuration parameter "service_names" you defined while creating instance.

If not, please correct errors first. *It makes no sense to proceed without this.*

Common Oracle connectivity errors:
  • "tnsping not found"
    • Instant Client doesn't include tnsping . Nobody knows why Oracle dropped this small helpful utility from the package. Don't try to copy it from a full installation as mentioned somewhere in the net. It's not legal.
    • check PATH settings. Usually, other Oracle environment variables are also missing
  • "sqlplus not found":
    • check if Oracle Client software is installed properly
    • check PATH settings. Usually, other Oracle environment variables are also missing
  • sqlplus: error while loading shared libraries: libxxx.so: cannot open shared object file: No such file or directory
    • check LD_LIBRARY_PATH settings. Make sure that libraries in path have the expected architecture (mostly 64bit/32bit mismatch)
  • "ORA-12504/ORA-12514 listener does not currently know of service requested in connect descriptor"
    • If you are using ezconnect naming (//host:port/Servicename), Servicename must match service_names parameter. Actual settings can be found with sqlplus or listener status query on server
    • if you are using tnsnames.ora service_name or SID part is wrong
  • ORA-12541: TNS:no listener
    • listener process on server not reachable or not started. Restart listener on server as oracle user
    • wrong host or port configured. Query listener as user oracle on database server to find out, on which ip and port the listener works
    • Firewall blocked. Check with your network administrator.
  • ORA-12154: TNS:could not resolve the connect identifier specified
    • if using tnsnames check in tnsnames.ora if identifier (<identifier>=(Description=... )exists
    • if in sqlnet.ora is set "names_default_domain=<nddvalue>", the tnsnames.ora entry must set similar to
    • if tnsnames.ora entries looks like "<identifier>.<nddvalue>=(Description=(..." and names_default_domain is NOT set, you can set names_default_domain to <nddvalue> in sqlnet.ora or use the full name syntax
    • check host part for ezconnect naming
  • TNS-03505: Failed to resolve name
    • the same error as above while using tnsping
  • ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
    • for sys you have to include " as sysdba"

Advanced configuration tasks

not needed for icinga, but must have for production environment

  • define db_recovery_file_dest and size (at least three times the sum of all data files)
  • define recovery target time
  • run instance in archive log mode
  • create daily online backup job
  • create job for maintaining and cleaning archive logs
  • create job for daily statistics gathering
  • tune memory allocation

more optional:

  • enable flashback feature
  • enable Oracle Enterprise Manager/DBConsole (only Standard and Enterprise Edition)
  • use SQLDeveloper
    I would like suggest to download and install the free java based Oracle development tool "SQLDeveloper" Version 3+; http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html (and not use the old version you will find on the oracle installation media. You should change the default java memory settings in sqldeveloper.conf to 512M+ to prevent a "coffee shock" experience

continued in Part 2: Icinga and Oracle Part2 - Building software

  • No labels