Novell Home

AppNote: Configuration of ZENworks Linux Management with Oracle 9i R2 Database

Novell Cool Solutions: AppNote
By Reddy S Swathi

Digg This - Slashdot This

Posted: 22 Jan 2007
 

1: Introduction

ZENworks Linux Management (ZLM) requires either a PostgreSQL or Oracle database for storing ZENworks-related data. This Appnote explains how to extend the oracle schema to configure the ZLM server with Oracle database. It also describes how to set up Oracle database on SLES9x server.

2: Installation of ZLM

  1. Refer to this section of the documentation for information about installing ZLM server on any given server. Ensure the ZLM installation is successful on the server.
  2. Make sure that the following Oracle drivers are installed on the above ZLM server. Download the Oracle drivers from here.
    • oracle-instantclient-basic-10.1.0.3-1.i386.rpm
    • oracle-instantclient-jdbc-10.1.0.3-1.i386.rpm
    • oracle-instantclient-sqlplus-10.1.0.3-1.i386.rpm

3: Oracle 9i R2 (9.2.0.4) Installation Procedure on Linux (SLES9x)

The following procedure helps you to set up Oracle 9i on a SLES9x server.

3.1: Pre-requisites

  1. Download the following gunzip files from here.
    • ship_9204_linux_disk2.cpio.gz
    • ship_9204_linux_disk1.cpio.gz
    • ship_9204_linux_disk3.cpio.gz
  2. Download the latest orarun.rpm from here.
  3. Ensure gcc packages are installed on the server.

3.2: Pre-installation steps

  1. Copy the latest orarun.rpm package to the linux machine and run the rpm as root user.
    rpm ?i /root/orarun.rpm
  2. Edit the file /etc/passwd. For the "oracle" user, change the shell value from /bin/false to /bin/bash
  3. Set new password for the user "oracle" using /usr/bin/passwd oracle.
  4. Run /usr/sbin/rcoracle start to set the kernel parameters.
  5. Get the software downloaded from the web (Prerequisite.1). Copy them to /opt/oracle directory and do the following:
    1. Run the following command to create the cpio files:
      gunzip <file name>
    2. Run the following cpio command command to create three directories - Disk1,Disk2, Disk3.
      cpio ?idmv < <filename>
  6. Login to linux as oracle user and check if the following two environment variables are set. These are set by the orarun.rpm.
    • $ echo $LD_ASSUME_KERNEL
    • $ echo $LD_PRELOAD
    If echo displays the value then the variables are set. Otherwise, export these variables for the "oracle" user.

3.3: Installation steps

  1. Login as "oracle" user.
  2. Run Oracle Installer from Disk1 directory:
    ./runInstaller
  3. Click "Next" and proceed as instructed by the installer in all the screens except for the screens shown below.

    • Enter the Unix group name as "dba" in the following screen


    • For ZLM, enter "orcl" as value for Global database name and SID. The product expects them to have same value.


    • Click on "Exit" and exit from the install once it is done.

3.4: Post-Installation

  1. Login as "oracle" user. Run "echo $ORACLE_SID" and check the value returned.
  2. If the value returned is "orcl" move on to next step. Otherwise "vi /etc/profile" and insert the following to the file and save.
    • ORACLE_SID=orcl
    • Export ORACLE_SID
    Log off and login as "oracle" user for the changes to take effect.
  3. Check if the file "initorcl.ora" is present in "/opt/oracle/products/9ir2/dbs". This file is necessary for Oracle to start.
  4. If the file is not present in the above path, copy the file
    "initorcl.ora.<some number>" from "/opt/oracle/admin/orcl/pfile" to the "/opt/oracle/products/9ir2/dbs" and rename it to "initorcl.ora".

3.5: Login as Oracle user

  1. Login as "oracle" user.
  2. Type "sqlplus /nolog"
  3. On sql prompt type the following:
    connect / as sysdba
  4. startup (to start the oracle instance that would mount the orcl db)
  5. shutdown immediate

4: Extending Schema

Use the following steps to extend the schema on the Oracle Server before running zlm-config.

  1. After bringing up the Oracle database, create the following directory structures on the Oracle server:
    • $HOME/schema
    • /opt/oracle/novell/zenworks/database/trace.
  2. Change the group by using the command
    chown -R oracle:root /opt/oracle/novell/zenworks/database
  3. Copy the oracle initialization file from ZLM server
    (/opt/novell/zenworks/share/datamodel/linux-init-oracle.ora) to /opt/oracle/novell/zenworks/database folder
  4. Copy linux-createdb-oracle.sql from ZLM server
    (/opt/novell/zenworks/share/datamodel/linux-createdb-oracle.sql )to $HOME/schema
  5. Launch SQLPLUS and at the prompt, connect as sysdba and shutdown previous instance by typing:
    • connect / as sysdba;
    • shutdown immediate;

  6. Here are modifications to the scripts, if the above assumption/default settings need to be modified.
    1. If you need to modify the default database name and user, then please refer in this file, to the section on Default Database Name and modify the same, as well as the db_name parameter in linux-init-oracle.ora
    2. If you need to modify the default user and password, then please refer in this file to the section on Default user and modify the same.
    3. If you need to change the directory structure, then please modify in this file all references to /opt/oracle/novell/zenworks/database in this file and linux-init-oracle.ora. Also, you will need to create the new directory structure and place the linux-init-oracle.ora appropriately.
    4. If you need to bypass the zlm install for creating the schema into the database, Copy these sql files from zlm server from /opt/novell/zenworks/share/datamodel to a folder $HOME/schema on Oracle server

      • @$HOME/schema/zenworks-oracle.sql;
      • @$HOME/schema/db_function-oracle.sql;
      • @$HOME/schema/enums_ora.sql;
      • @$HOME/schema/Message_en_us_ora.sql;
      • @$HOME/schema/queue-oracle.sql;
      • @$HOME/schema/os_targets-oracle.sql;

      Uncomment the above line in the linux-createdb-oracle.sql and save the file.

  7. Enter the following command to create the database and wait till the database gets created.
    @$HOME/schema/linux-createdb-oracle.sql
  8. Start the database with the following commands whenever the db is shutdown:
    connect / as sysdba;
                     STARTUP PFILE=/opt/oracle/novell/zenworks/database/linux-init-oracle.ora
  9. Login as oracle and start the listener
    lsnrctl start
  10. Run zlm-config on the ZLM server and provide the required information to configuration with Oracle database.

5: Troubleshooting Tips

Following are some of the common problems faced while setting up Oracle on a Linux server.

  • Error: ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist

    Solution : Check if the oracle engine is running. Otherwise, start the engine .
    Type "startup" in the sql prompt
  • Issue : Not able to run any scripts

    Solution : check if the "oracle" user has the necessary rights and permissions for the files/folders.

Conclusion

At this point you have setup Oracle on a Linux server and configured ZENworks Linux Management to store data in an Oracle database.

For additional information, consult the ZENworks Linux Management documentation.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell