DBA Tips Archive for Oracle

  


Installing Oracle9i R2 (9.2.0) on Solaris 9

by Jeff Hunter, Sr. Database Administrator


Contents

  1. Overview
  2. Hardware Requirements
  3. Configuring the Oracle UNIX User ID
  4. Starting the Oracle Universal Installer
  5. Installing the Oracle 9.2.0.5.0 Patchset
  6. Configure Oracle Net
  7. Creating the Oracle Database - (ORA920)
  8. Setting up Automatic Database Starting & Stopping
  9. Miscellaneous Options
  10. About the Author


Overview

This article is a comprehensive guide for installing Oracle9i Release 2 on the Solaris 9 (SPARC) operating environment. Please keep in mind that this article should not be considered a substitution for completely reading and understanding the official installation guide and release notes from Oracle. The following links can be used to download the official installation guides for Oracle9i (9.2.0):
  Oracle9i Database Release 2 Documentation
  Oracle9i Installation Guide Release 2 for Sun Solaris - (A96167-01)
Here is a short introduction to some of the configuration parameters that will be used for installing the Oracle database software:


Hardware Requirements

This section describes the steps and requirements that should be performed by the DBA as it relates to the Sun hardware and Solaris operating environment before performing the Oracle database software. Keep in mind that the following steps need to be performed by the root user id.

  1. Login as the root user id.
    % su -
  2. Install the latest Sun Patch Cluster. The Sun Solaris 9 Patch Cluster can be downloaded from the following URL:

    sunsolve.sun.com/pub-cgi/show.pl?target=patches/patch-access

    Download and unzip the file 9_Recommended.zip to a temporary directory. It will create the directory called 9_Recommended. Change to this directory and run the install_cluster shell script. The process may take up to several hours depending on the system.

    # su -
    # unzip 9_Recommended.zip
    # cd 9_Recommended
    # ./install_cluster
    During the patch process you may encounter several failures with either error code 2 and/or error code 8. These are normal. They represent "package already at current rev" and "underlying package not installed". Anything other than 2 or 8 you should look more closely at.

  3. Ensure enough swap space is available. An amount of disk space equal to twice the amount of RAM or at least 400 MB, whichever is greater. Use the following command to determine the amount of swap space installed on the system:
    # /usr/sbin/swap -l
    swapfile              dev  swaplo  blocks    free
    /dev/dsk/c0t0d0s1   136,1      16 4198304 4198304
    and multiply the value in the BLOCKS column by 512.

    NOTE: If 400 MB or more is not available in /tmp, you can create a "tmp" directory in another file system, then set the environment variables TMP (used by Oracle) and TMPDIR (used by operating system programs like the linker "ld" and library archiver "ar") to point to this location. For example:
    # mkdir /u01/app/oracle/tmp
    # TEMP=/u01/app/oracle/tmp; export TEMP
    # TMPDIR=/u01/app/oracle/tmp; export TMPDIR

  4. Ensure database server has at lease 256 MB of RAM.
    # /usr/sbin/prtconf | grep "Memory size"
    Memory size: 1792 Megabytes

  5. Ensure the OS Block Size has been setup to the proper size. For my server, I want an OS block size of 8192 (8K). To check the OS block size in Solaris, use the df -g command.
    # df -g | grep "block size"
    /              (/dev/dsk/c0t0d0s0 ):     8192 block size    1024 frag size
    /proc          (/proc             ):      512 block size     512 frag size
    /etc/mnttab    (mnttab            ):      512 block size     512 frag size
    /dev/fd        (fd                ):     1024 block size    1024 frag size
    /var/run       (swap              ):     8192 block size    8192 frag size
    /tmp           (swap              ):     8192 block size    8192 frag size
    /u01           (/dev/dsk/c0t2d0s7 ):     8192 block size    1024 frag size
    /u03           (/dev/md/dsk/d0    ):     8192 block size    1024 frag size
    /u04           (/dev/md/dsk/d1    ):     8192 block size    1024 frag size
    /u05           (/dev/md/dsk/d2    ):     8192 block size    1024 frag size
    /u06           (/dev/md/dsk/d3    ):     8192 block size    1024 frag size
    /cartman       (cartman:/share2   ):     8192 block size     512 frag size

  6. Set the Solaris kernel parameters in the /etc/system file. For a detailed overview on setting Solaris kernel parameters for Oracle, please see my article entitled "Setting Solaris Kernel Parameter for Oracle".
    * +---- SNIP HERE ---+
    *
    * +--------------------------------------------------------------+
    * | SHARED MEMORY                                                |
    * | ------------------------------------------------------------ |
    * | shmmax - Maximum size, in bytes, of a single shared memory   |
    * |          segment. Should be set large enough for the largest |
    * |          SGA size. Typically set to 4GB.                     |
    * | shmmin - The minimum size, in bytes, of a single shared      |
    * |          memory segment.                                     |
    * | shmseg - The maximum number of share memory segments that    |
    * |          can be attached (i.e. used) by a single process.    |
    * | shmmni - This determines how many shared memory segments can |
    * |          be on the system.                                   |
    * +--------------------------------------------------------------+
    set shmsys:shminfo_shmmax=4294967295
    set shmsys:shminfo_shmmin=1
    set shmsys:shminfo_shmseg=10
    set shmsys:shminfo_shmmni=100
    
    * +------------------------------------------------------------+
    * | SEMAPHORES                                                 |
    * | ---------------------------------------------------------- |
    * | semmni - Maximum number of semaphore sets on the system    |
    * | semmsl - Maximum number of semaphores per set              |
    * | semmns - Maximum number of semaphores available system wide|
    * |                                                            |
    * |          NOTE: The maximum number of available semaphores  |
    * |                on the system is the lesser of SEMMNS and   |
    * |                the product (SEMMNI*SEMMSL).                |
    * +------------------------------------------------------------+
    set semsys:seminfo_semmni=800
    set semsys:seminfo_semmsl=25
    set semsys:seminfo_semmns=20000
    * +---- SNIP HERE ---+
    NOTE: After making changes to the kernel parameters under Solaris, you will need to re-boot the database server before any changes can take effect.

  7. Create the UNIX Group for the Oracle User Id.
    # groupadd -g 115 dba

  8. Create the UNIX User for the Oracle Software.
    # mkdir -p /u01/app
    # useradd -u 175 -c "Oracle Software Owner" -d /u01/app/oracle -g "dba" -m -s /bin/ksh oracle
    64 blocks
    
    # passwd oracle
    New Password: ***********
    Re-enter new Password: ***********
    passwd: password successfully changed for oracle

  9. Verify all mount points. Please keep in mind that all of the following mount points can simply be directories if you only have one hard drive. For our installation, we will be using four mount points (or directories) as follows:

    • /u01 : The Oracle database software will be installed to /u01/app/oracle.

    • /u03 : This mount point will contain the physical Oracle files:

      • Control File 1
      • Online Redo Log File - Group 1 / Member 1
      • Online Redo Log File - Group 2 / Member 1
      • Online Redo Log File - Group 3 / Member 1

    • /u04 : This mount point will contain the physical Oracle files:

      • Control File 2
      • Online Redo Log File - Group 1 / Member 2
      • Online Redo Log File - Group 2 / Member 2
      • Online Redo Log File - Group 3 / Member 2

    • /u05 : This mount point will contain the physical Oracle files:

      • Control File 3
      • Online Redo Log File - Group 1 / Member 3
      • Online Redo Log File - Group 2 / Member 3
      • Online Redo Log File - Group 3 / Member 3

    • /u06 : This mount point will contain the all physical Oracle data files.

      • This will be one large RAID 0 stripe for all Oracle data files.
      • All tablespaces including System, UNDO, Temporary, Data, and Index.

    NOTE: Not all database servers come with a large number of disks needed to store all of the mount points /u01 through /u06. For example, you may have a machine that only has one disk / partition for the database called /db0. To create the database on this machine, the DBA Group will use symbolic links to emulate the different mount points.

    If for example you have only one partition named /db0, simply go to this directory and create all of the mount points: /u01 through /u06. Once all of the mount points are created in the /db0 directory, go back to the root directory (cd /) and create symbolic links to the /db0/<mount_point> for all mount points. For example:

    # su
    # cd /db0
    # mkdir u01 u03 u04 u05 u06
    # cd /
    # ln -s /db0/u01 /u01
    # ln -s /db0/u03 /u03
    # ln -s /db0/u04 /u04
    # ln -s /db0/u05 /u05
    # ln -s /db0/u06 /u06
    # mkdir /u01/app
    # mkdir /u01/app/oracle
    # cd /db0
    # chown -R oracle:dba u*

  10. Change the ownership of all mount points to the Oracle User Id.
    # chown -R oracle:dba /u01
    # chown -R oracle:dba /u03
    # chown -R oracle:dba /u04
    # chown -R oracle:dba /u05
    # chown -R oracle:dba /u06

  11. Create /var/opt/oracle directory.
    # cd /var/opt
    # mkdir oracle
    # chown -R oracle:dba oracle

  12. Create LOCAL_BIN directory.
    # cd /opt
    # mkdir bin
    # chown -R oracle:dba bin


Configuring the Oracle UNIX User ID

After configuring the Solaris operating environment, it is time to setup the Oracle UNIX User ID for the installation of the Oracle database software. Keep in mind that the following steps need to be performed by the oracle user id.

Before delving into the details for configuring the Oracle User ID, I packaged an archive of shell scripts and configuration files to assist with the Oracle preparation and installation. You should download the archive "oracle_920_installation_files.tar" as the Oracle User ID and place it in his HOME directory.

  1. Login as the oracle user id.
    % su - oracle

  2. Verify O/S Shell Limits.

    Oracle9i Release 2 (9.2.0) includes native support for files greater than 2 GB. Check your shell to determine whether it will impose a limit.

    • To check current soft shell limits, enter the following command:
      $ ulimit -Sa
      time(seconds) unlimited
      file(blocks) unlimited
      data(kbytes) unlimited
      stack(kbytes) 8192
      coredump(blocks) unlimited
      nofiles(descriptors) 256
      memory(kbytes) unlimited
    • To check maximum hard limits, enter the following command:
      $ ulimit -Ha
      time(seconds) unlimited
      file(blocks) unlimited
      data(kbytes) unlimited
      stack(kbytes) unlimited
      coredump(blocks) unlimited
      nofiles(descriptors) 65536
      memory(kbytes) unlimited
    The file (blocks) value should be multiplied by 512 to obtain the maximum file size imposed by the shell. A value of unlimited is the operating system default and is the maximum value of 1 TB.

  3. Unpackage the contents of the oracle_920_installation_files.tar archive. After extracting the archive, you will have a new directory called oracle_920_installation_files that contains all required files. The following set of commands descibe how to extract the file and where to copy/extract all required files:
    $ id
    uid=175(oracle) gid=115(dba)
    
    $ pwd
    /u01/app/oracle
    
    $ tar xvf oracle_920_installation_files.tar
    x oracle_920_installation_files, 0 bytes, 0 tape blocks
    x oracle_920_installation_files/admin.tar, 48128 bytes, 94 tape blocks
    x oracle_920_installation_files/common.tar, 813568 bytes, 1589 tape blocks
    x oracle_920_installation_files/dbora, 8060 bytes, 16 tape blocks
    x oracle_920_installation_files/dbshut, 3310 bytes, 7 tape blocks
    x oracle_920_installation_files/dbstart, 5002 bytes, 10 tape blocks
    x oracle_920_installation_files/local_bin.tar, 20480 bytes, 40 tape blocks
    x oracle_920_installation_files/oratab, 746 bytes, 2 tape blocks
    x oracle_920_installation_files/profile_oracle, 5903 bytes, 12 tape blocks
    x oracle_920_installation_files/system, 1804 bytes, 4 tape blocks
    x oracle_920_installation_files/ldap.ora, 851 bytes, 2 tape blocks
    x oracle_920_installation_files/listener.ora, 1752 bytes, 4 tape blocks
    x oracle_920_installation_files/sqlnet.ora, 16075 bytes, 32 tape blocks
    x oracle_920_installation_files/tnsnames.ora, 1606 bytes, 4 tape blocks
    x oracle_920_installation_files/crontabORA920.txt, 3450 bytes, 7 tape blocks
    
    $ cp oracle_920_installation_files/profile_oracle ~/.profile
    
    $ tar xvf oracle_920_installation_files/admin.tar
    
    $ tar xvf oracle_920_installation_files/common.tar
    
    $ cp oracle_920_installation_files/oratab /var/opt/oracle/
    
    $ (cd /opt/bin && tar xvf ~/oracle_920_installation_files/local_bin.tar)
    
    $ . ~/.profile
    .profile executed
    $

  4. Ensure that all of the required executables are in your PATH. To check for these executables, enter the following:
    $ /usr/bin/which make
    $ /usr/bin/which ar
    $ /usr/bin/which ld
    $ /usr/bin/which nm
    Each command should point to the /usr/ccs/bin directory. If not, add /usr/ccs/bin to the beginning of the PATH environment variable in the current shell.

  5. Create the Oracle Product directory.
    $ mkdir /u01/app/oracle/product

  6. Create all remaining directories.
    $ mkdir -p /u03/app/oradata
    $ mkdir -p /u04/app/oradata
    $ mkdir -p /u05/app/oradata
    $ mkdir -p /u06/app/oradata


Starting the Oracle Universal Installer

Beginning with Oracle version 8i, the Oracle Universal Installer (OUI) is a Java application and uses a JRE (Java runtime Environment) shipped on the media. Other Java applications that utilize the JRE are the Database Configuration Assistant and the Oracle Net Assistant. The JRE shipped by Oracle is the only one supported to run with these applications.

Installations can no longer be performed using character mode. However, the DBA may elect to configure the OUI to perform a non-interactive installation of the Oracle products. The OUI in non-interactive mode can be run directly from a machine's console, X-Windows environment or via an X-terminal emulator.

  1. From a workstation (running X Windows or Solaris/Linux) telnet to the target database server as the "oracle" account.

    NOTE: If you are using Hummingbird's Exceed X-Windows emulator while installing and using Oracle9i, set the window manager to run in "Native" mode so that Microsoft windows functions as the window manager. See your Exceed documentation for instructions on configuring the window manager.

  2. Set your DISPLAY variable on the Solaris database server to point to your local workstation:
    $ DISPLAY=<your local workstation>:0
    $ export DISPLAY
    For example:
    $ DISPLAY=bartman:0
    $ export DISPLAY

  3. To determine if your X-Windows system is properly working on your local workstation, try starting a small X-Windows application:
    $ xclock
       

  4. After validating that you can re-direct X-Windows applications to your local workstation, you are ready to start the Oracle Universal Installer. To do this, insert Disk 1 (of 3) of the Oracle9i Enterprise Edition, Release 2 (9.2.0) for Sun SPARC Solaris. On most systems, the CD-ROM will be mounted automatically by the Solaris Volume Manager. If not, you can perform the following root user id:
    $ su -
    # mkdir /cdrom
    # mount -r -F hsfs /dev/dsk/cxtydzs2 /cdrom
    In the above example, /cdrom is the CD-ROM mount point directory and /dev/dsk/cxtydzs2 is the device name for the CD-ROM device, for example /dev/dsk/c0t6d0s2.

  5. Run the Oracle Universal Installer as the "oracle" UNIX User ID from Oracle's home directory:
    $ cd
    
    $ pwd
    /u01/app/oracle
    
    $ /cdrom/cdrom0/runInstaller
    $ Initializing Java Virtual Machine from /tmp/OraInstall/jre/bin/jre. Please wait...

    Oracle9i Software Installation Screen Responses
    Screen Name Choice
    Welcome Screen <Next>
    File Locations Source Path: /cdrom/cdrom0/stage/products.jar
    Destination Name: OracleHome920
    Destination Path: /u01/app/oracle/product/9.2.0
    <Next>
    Available Products Oracle9i Database 9.2.0.1.0
    Oracle9i Client 9.2.0.1.0
    Oracle9i Management and Integration 9.2.0.1.0
    <Next>
    Installation Types Enterprise Edition (3.18GB)
    Standard Edition (3.10GB)
    Custom
    <Next>
    Available Product Components [*] Oracle9i 9.2.0.1.0

    Enterprise Edition Options 9.2.0.1.0
       [  ] Oracle Advanced Security 9.2.0.1.0
       [*] Oracle Partitioning 9.2.0.1.0
       [*] Oracle Spatial 9.2.0.1.0
       [  ] Legato Networker Single Server 6.1.0.0.0
       [  ] Oracle Label Security 9.2.0.1.0
       [*] Oracle OLAP 9.2.0.1.0
       [*] Oracle Data Mining 9.2.0.1.0

    Oracle Net Services 9.2.0.1.0
       [*] Oracle Net Listener 9.2.0.1.0
       [*] Oracle Connection Manager 9.2.0.1.0
       [  ] Oracle Names 9.2.0.1.0

    Oracle Enterprise Manager Products 9.2.0.1.0
       [*] Oracle Intelligent Agent 9.2.0.1.0
       [  ] Oracle Enterprise Manager Web Site 9.2.0.1.0
       [  ] Oracle Management Server 9.2.0.1.0
       [*] Oracle Enterprise Manager Client 9.2.0.1.0
       [*] Oracle Change Management Pack 9.2.0.1.0
       [*] Oracle Diagnostics Pack 9.2.0.1.0
       [*] Oracle Tuning Pack 9.2.0.1.0
       [*] Oracle Management Pack for Oracle Applications 9.2.0.1.0
       [  ] Oracle Management Pack for Oracle Standard Edition 9.2.0.1.0

    Oracle9i Development Kit 9.2.0.1.0
       [*] Oracle C++ Call Interface 9.2.0.1.0
       [*] Oracle Call Interface (OCI) 9.2.0.1.0
       [*] Oracle Programmer 9.2.0.1.0
       [*] Oracle XML Developer's Kit 9.2.0.1.0

    [*] Oracle9i for UNIX Documentation 9.2.0.1.0

    Oracle HTTP Server 9.2.0.1.0
       [*] Oracle HTTP Server Extensions 9.2.0.1.0
       [*] Apache Configuration for Oracle XML Developer's Kit 9.2.0.1.0
       [*] Oracle eBusiness Management Extensions 9.2.0.1.0
       [*] BC4J Runtime for Database 9.0.2.692.1
       [*] Oracle Mod PL/SQL Gateway 3.0.9.8.3b

    [  ] Oracle Transparent Gateways 9.2.0.1.0

    [*] iSQL*Plus 9.2.0.1.0

    [*] Oracle JDBC/OCI Interfaces 9.2.0.1.0

    <Next>

    Component Locations Keep all defaults
    <Next>
    Privileged Operating System Groups OSDBA: dba
    OSOPER: dba
    <Next>
    Upgrading or Migrating an Existing Database Leave unchecked...
    <Next>
    Create Database Yes
    No
    <Next>
    Summary <Install>

  6. During the installation phase, you will be asked to remove Disk 1 and replace it with Disk 2. You will need to unmount CD Disk 1 as the root user id:
    $ su -
    # eject cdrom
    # exit
    $
    After replacing Disk 1 with Disk 2, return the dialog box from the Oracle Universal Installer and hit "OK".

    You will need to following the same procedures to replace Disk 2 with Disk 3.

  7. At the end of the installation and linking phase, you will be prompted to run a configuration script as the root user before the installation can proceed. Leave this window up, and go to /u01/app/oracle/product/9.2.0 and run the root.sh script:
    $ cd /u01/app/oracle/product/9.2.0
    $ su
    Password: *******
    
    # ./root.sh
    Running Oracle9 root.sh script...
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/oracle/product/9.2.0
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/bin
    
    Adding entry to /var/opt/oracle/oratab file...
    Entries will be added to the /var/opt/oracle/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    
    # exit
    $
    After successfully running the root.sh script, go back to the dialog window from the Oracle Universal Installer and click "OK" to continue.

  8. Running the root.sh script will overwrite the custom oraenv script that I rely on when switching my SHELL environment. After running the root.sh script
    $ cd /opt/bin
    $ cp oraenv.custom oraenv

  9. When the Oracle Universal Installer is complete, it will attempt to run several of Oracle's configuration tools. The scripts required to complete the configuration of Oracle9i are already included in the archive "oracle_920_installation_files.tar"; downloaded earlier in this article. Therefore, when prompted for the Oracle Net Configuration Assistant, simply hit "Cancel" and allow it to fail. Again, the Oracle Net configuration files I already have included within the "oracle_920_installation_files.tar" file. Go ahead and accept the Error dialog box that indicates one or more tools failed then Exit from the Oracle Universal Installer

  10. You can now eject Disk 3 from the CD-ROM.
    $ eject cdrom


Installing the Oracle 9.2.0.5.0 Patchset

If you have been following this article, you will have just finished installing Oracle9i (9.2.0.1.0). It is now time to apply the 9.2.0.5.0 patchset and that is what we will be doing in this section.

Before starting the installation of the Oracle 9.2.0.5.0 patchset, you will need to verify and shutdown all Oracle processes that have been started from the 9.2.0.1.0 product set. During the installation process (above) you will notice that the Oracle Configuration Assistant started the Apache web server and the Oracle Intelligent Agent. You will be required to shut this process down before continuing:

$ $ORACLE_HOME/Apache/Apache/bin/apachectl stop
/u01/app/oracle/product/9.2.0/Apache/Apache/bin/apachectl stop: httpd stopped

$ agentctl stop

DBSNMP for Solaris: Version 9.2.0.1.0 - Production on 01-AUG-2004 21:29:35

Copyright (c) 2002 Oracle Corporation.  All rights reserved.

Agent shutdown

After shutting down all Oracle processes, you will then need to obtain the 9.2.0.5.0 patchset from Metalink. Simply download the patchset "p3501955_9205_SOLARIS.zip" to a temporary directory. Extract the contents of this archive and run the Oracle Universal Installer to install the patchset:

$ mkdir /u01/app/oracle/patchset
$ mv p3501955_9205_SOLARIS.zip /u01/app/oracle/patchset
$ cd /u01/app/oracle/patchset
$ unzip p3501955_9205_SOLARIS.zip
$ cpio -idmv < 9205_solaris_release.cpio
$ cd Disk1
$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be 5.6, 5.7, 5.8 or 5.9.    Actual 5.9
                                      Passed

Checking Temp space: must be greater than 250 MB.   Actual 3100 MB    Passed
Checking swap space: must be greater than 500 MB.   Actual 3424MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2004-08-01_09-48-18PM. Please wait ...ORA920 on alex
: Oracle Universal Installer, Version 10.1.0.2.0 Production
Copyright (C) 1999, 2004, Oracle. All rights reserved.
Here is a sample of the screen shots that I used to install the newset Oracle Universal Installer (10.1.0.2.0):

Oracle9i 9.2.0.5.0 Patchset Installation Screen Responses
Screen Name Choice
Welcome Screen <Next>
File Locations Source Path: /u01/app/oracle/patchset/Disk1/stage/products.xml
Destination Name: OracleHome920
Destination Path: /u01/app/oracle/product/9.2.0
<Next>
Select a Product to Install Oracle 9iR2 Patch Set 9.2.0.5.0
Oracle Universal Installer 10.1.0.2.0
<Next>
Summary <Install>

Exit from the Oracle Universal Installer (OUI). At this point, we have only installed the newest version (10.1.0.2.0) of the Oracle Universal Installer. We know need to kick off this version of OUI to apply the 9.2.0.5.0 patchset:

$ cd /u01/app/oracle/patchset/Disk1
$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be 5.6, 5.7, 5.8 or 5.9.    Actual 5.9
                                      Passed

Checking Temp space: must be greater than 250 MB.   Actual 3100 MB    Passed
Checking swap space: must be greater than 500 MB.   Actual 3424MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2004-08-01_09-48-18PM. Please wait ...ORA920 on alex
: Oracle Universal Installer, Version 10.1.0.2.0 Production
Copyright (C) 1999, 2004, Oracle. All rights reserved.
Here is a sample of the screen shots that I used to install the 9.2.0.5.0 patch set

Oracle9i 9.2.0.5.0 Patchset Installation Screen Responses
Screen Name Choice
Welcome Screen <Next>
File Locations Source Path: /u01/app/oracle/patchset/Disk1/stage/products.xml
Destination Name: OracleHome920
Destination Path: /u01/app/oracle/product/9.2.0
<Next>
Select a Product to Install Oracle 9iR2 Patch Set 9.2.0.5.0
Oracle Universal Installer 10.1.0.2.0
<Next>
Summary <Install>

At the end of the installation and linking phase, you will be prompted to run a configuration script as the root user before the installation can proceed. Leave this window up, and go to /u01/app/oracle/product/9.2.0 and run the root.sh script:

$ cd /u01/app/oracle/product/9.2.0
$ su
Password: *******

# ./root.sh
Running Oracle9 root.sh script...

The following environment variables are set as:
    ORACLE_HOME=  /u01/app/oracle/product/9.2.0
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.

# exit
$
After successfully running the root.sh script, go back to the dialog window from the Oracle Universal Installer and click "OK" to continue.


Configure Oracle Net

At this point, the Oracle database software and required patchset have been installed. Before moving on in creating our Oracle database, we should first configure the Oracle Net software. If you have been following this article, you will already have the necessary files to configure Oracle Net. The file "oracle_920_installation_files.tar" contains three files:

You can simple copy these three files to the proper location as follows as the oracle user id and start the Oracle listener:

$ id
uid=175(oracle) gid=115(dba)

$ cd ~/oracle_920_installation_files
$ pwd
/u01/app/oracle/oracle_920_installation_files

$ cp listener.ora sqlnet.ora tnsnames.ora $ORACLE_HOME/network/admin

$ cd
$ lsnrctl start

LSNRCTL for Solaris: Version 9.2.0.5.0 - Production on 01-AUG-2004 22:22:32

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Starting /u01/app/oracle/product/9.2.0/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 9.2.0.5.0 - Production
System parameter file is /u01/app/oracle/product/9.2.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/9.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2481))(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 9.2.0.5.0 - Production
Start Date                01-AUG-2004 22:22:32
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2481))(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


Creating the Oracle Database - (ORA920)

We are now heading into the final strech - time to create an Oracle database. This section will describe the steps to create an Oracle 9.2.0 database named ORA920 using regular SQL scripts. If you have been following along with this article, I have already included the SQL scripts required to create the database.

NOTE: The scripts I have included for in this article were created from Oracle's Database Configuration Assistant (DBCA) and slightly modified. If you wanted to create the database on your own, you can simply use Oracle's DBCA to create one with your own features and options. Simple export your DISPLAY variable to poing to your local workstation and run dbca. For my example below, the name of my workstation is bartman:
$ DISPLAY=bartman:0
$ export DISPLAY
$ dbca

If you would like to create the ORA920 (one in which installs all Oracle options like Oracle JVM, interMedia, Context, XMLDB, Spatial, ultraSearch, cwmlite, Demo Schemas, etc.) I have included with this example, simply navigate to the directory ~oracle/admin/ORA920/create and run the file RUN_CRDB.sh as the oracle user id as follows:

$ cd ~/admin/ORA920/create
$ ./RUN_CRDB.sh

NOTE: The database creation process can take anywhere from 40 minutes to well over an hour depending on the speed of you server. During the database creation phase, you can open another terminal session to the database server and monitor the creation process by tailing the file crdb.log as follows:
$ id
uid=175(oracle) gid=115(dba)

$ cd admin/ORA920/create
$ tail -f crdb.log



Setting up Automatic Database Starting & Stopping

Included in the file you downloaded and extracted earlier in this article (oracle_920_installation_files.tar) is a utility called dbora that may be used to automatically start and stop the Oracle database and all the other Oracle routines. The dbora script may differ on every database server only slightly as each database server has different requirements for handling Apache, listener and other agents. The dbora script should be place in /etc/init.d.

The dbora utility has been implemented to utilize the Oracle supplied scripts $ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut. This utility (dbora) will be run by the UNIX init process, and reads the /var/opt/oracle/oratab file to dynamically determine which databases to start and stop.

Here is how to install the dbora file:

$ su
# cp /u01/app/oracle/oracle_920_installation_files/dbora /etc/init.d
# cd /etc/init.d
# chmod 744 dbora
# chown root:sys dbora

# ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S90dbora
# exit

NOTE: Make sure to set the ORACLE_HOME shell variable in the dbora file to the proper product set (version) you wish to use. This is commonly the highest version of the Oracle you have installed on the machine.

Note that I also included a revised version of the Oracle supplied scripts dbshut and dbstart. You will want to copy these two files to the $ORACLE_HOME/bin directory:

$ id
uid=175(oracle) gid=115(dba)

$ cd oracle_920_installation_files
$ cp $ORACLE_HOME/bin/dbstart $ORACLE_HOME/bin/dbstart.original
$ cp $ORACLE_HOME/bin/dbshut $ORACLE_HOME/bin/dbshut.original
$ cp dbstart dbshut $ORACLE_HOME/bin

Within the dbshut script, I wanted to use the immediate option for all shutdowns. I did not have to make any changes to the dbstart script.



Miscellaneous Options

Change Oracle Database Environment
In many cases, you will have more than one database running on your single database server. It is even possible to be using two different databases running on different releases of the Oracle database software. (i.e. Oracle 8.1.7 and Oracle 9.2.0). For example, you may have two database - ORA817 (using Oracle release 8.1.6) and ORA920 (using Oracle release 9.2.0). When logged in to the database server, you may need to switch your environment variables to switch between these two databases. This would require you update environment variables like ORACLE_HOME, ORACLE_SID, PATH, LD_LIBRARY_PATH, etc. Although this can be done manually at the command line, it can get old real quick. Instead you can use a single command line script to switch between all database environments declared in your /var/opt/oracle/oratab file.

If you have been following along with this article, the required scripts for switching your Oracle database environment is already included. From the command prompt, simply run the following:

$ . oraenv
ORACLE_SID = [ORA920] ? ORA817
Notice that in the above example, we didn't just run the oraenv script, but rather, we sourced it by using a dot followed by a space and then the script name . When sourcing the oraenv script, it will prompt you for the ORACLE_SID, (defined in your /var/opt/oracle/oratab file), you want to switch to. In the above example, if an entry exists for ORA817, then all required environment variables would be reset to access this database.
Lock Down Default Accounts
Lock the following accounts using:
SQL> alter user <USERID> account lock;
  • CTXSYS
  • MDSYS
  • ORDSYS
  • ORDPLUGINS
  • OSE$HTTP$ADMIN
  • OUTLN
  • TRACESVR
Starting the Oracle Intelligent Agent
Now let's look at how to start the Oracle Intelligent Agent (OIA). Note that in the section Configure Oracle Net, I included a pretty generic listener.ora file that will not allow the OIA to recognize and discover the Oracle SID ORA920. In order for the OIA to discover this SID, you will need to edit the listener.ora file to include the ORA920 database.

Edit the listener.ora file as follows:

listener.ora
LISTENER =
  (DESCRIPTION_LIST =

    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )
      (PROTOCOL_STACK =
       (PRESENTATION = TTC)
       (SESSION = NS)
      )
    )

    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
        (ADDRESS = (PROTOCOL = IPC)(KEY = ORA920_ALEX.IDEVELOPMENT.INFO))
        (ADDRESS = (PROTOCOL = IPC)(KEY = ORA920_ALEX))
      )
      (PROTOCOL_STACK =
       (PRESENTATION = TTC)
       (SESSION = NS)
      )
    )

  )

CONNECT_TIMEOUT_LISTENER = 10

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/9.2.0)
      (PROGRAM = extproc)
      (ENVS="EXTPROC_DLLS=ANY")
    )
    (SID_DESC =
      (GLOBAL_DBNAME  = ORA920_ALEX.IDEVELOPMENT.INFO)
      (SID_NAME       = ORA920)
      (ORACLE_HOME    = /u01/app/oracle/product/9.2.0)
    )
  )

After making changes to the listener.ora file, you will need to restart the Oracle listener:

$ lsnrctl stop
$ lsnrctl start
Now that we have the listener setup, let's start the Oracle Intelligent Agent
$ agentctl start
DBSNMP for Solaris: Version 9.2.0.5.0 - Production on 03-AUG-2004 19:15:02

Copyright (c) 2003 Oracle Corporation.  All rights reserved.

Starting Oracle Intelligent Agent...
Agent started
To verify that the OIA did indeed recognize our database, do a head on the file snmp_ro.ora to verify the snmp.visibleservices entry:
$ head -n 1 snmp_ro.ora
snmp.visibleservices = (listener, ORA920_ALEX.IDEVELOPMENT.INFO)
The Oracle Intelligent Agent requires a database logon for each SID that it manages. By default this account is called "dbsnmp" and the password is "dbsnmp". The account name and/or password can be changed from the default but you will need to make a few additional modifications. In the examples below, you will need to replace any information with brackets < > with the information from your system.

To change the PASSWORD and or USERNAME used by the Intelligent Agent:

  1. Remove all Jobs and Events currently registered against this database.

  2. Stop the Intelligent Agent
    $ agentctl stop

  3. Edit the $ORACLE_HOME/network/admin/snmp_rw.ora file and add the following parameter:
    SNMP.CONNECT.<connect_string>.NAME=<username>
    SNMP.CONNECT.<connect_string>.PASSWORD=<password>
    NOTE: The variable <connect_string> is the exact listing of the database name as it appears in the snmp_ro.ora file.

    If <username> is the default (DBSNMP), there is no need to specify the user here. Only the password is required.

    Here is an example of the entry I added to my $ORACLE_HOME/network/admin/snmp_rw.ora file to change the password of DBSNMP to manager:

    snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.name=dbsnmp
    snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.password=manager
    NOTE: The above 2 lines are case-sensitive and the OIA keywords (not the service names) must be listed in lower case letters or the parameters will be ignored.

  4. On UNIX, set the following permission on the "snmp_rw.ora" file:
    $ chmod 600 $ORACLE_HOME/network/admin/snmp_rw.ora
    
    $ ls -al $ORACLE_HOME/network/admin/snmp_rw.ora
    -rw-------  1 oracle  dba   259 Aug  3 19:18 /u01/app/oracle/product/9.2.0/network/admin/snmp_rw.ora

  5. Change the DBSNMP password on the database. You can use either Security Manager or SQL*Plus. If you use SQL*Plus, you can issue the following command:
    SQL> alter user DBSNMP identified by <newpassword>
    Here is how I changed the password for DBSNMP:
    SQL> alter user DBSNMP identified by manager;

  6. Start the Oracle Intelligent Agent.
    $ agentctl start
    NOTE: New in Oracle9i, if the password is changed in the snmp_rw.ora file, the first time the agent is started the parameter listed above will change and the password will become encrypted. This ensures the password is secure for this account. As a side note, some platforms will not allow white spaces around the equal sign. Here is a snippet of the two lines I added to the snmp_rw.ora file to change the default password of the DBSNMP password:
    snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.name=dbsnmp
    snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.encryptedpassword="8bfa724579334d65"

  7. Verify that the Oracle Intelligent Agent was able to login to the database.
    $ sqlplus system/manager
    
    SQL> select username from v$session where username = 'DBSNMP';
    
    USERNAME
    --------------
    DBSNMP
    DBSNMP
    The query should return two records as shown above.

  8. Edit the catsnmp.sql script to reflect the new USERNAME and/or PASSWORD. This will prevent anyone from accidentally changing the account back to the default setting.

  9. Set Administrator or Root only permissions on the CATSNMP.SQL file to prevent an average user from seeing the file with its new changes.
Re-linking the Product Set
The Oracle9i product set does not use the Oracle Installer to re-link objects. It is all done through the re-link command in the $ORACLE_HOME/bin directory. If you should find it necessary to need to re-link the Oracle product, run the following as the oracle user id:
$ cd $ORACLE_HOME/bin
$ relink all



About the Author

Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX, Linux, and Windows server environment. Jeff's other interests include mathematical encryption theory, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 18 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science.



Copyright (c) 1998-2014 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Saturday, 18-Sep-2010 17:53:16 EDT
Page Count: 17813