DBA Tips Archive for Oracle

  


Installing Oracle8i R3 (8.1.7) 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 8.1.7.4.0 Patchset
  6. Configure Net8
  7. Creating the Oracle Database - (ORA817)
  8. Setting up Automatic Database Starting & Stopping
  9. Miscellaneous Options
  10. About the Author


Overview

This article is a comprehensive guide for installing Oracle8i Release 3 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 Oracle8i (8.1.7):
  Oracle8i 8.1.7 Documentation
  Oracle8i Installation Guide Release 3 (8.1.7) for Sun SPARC Solaris - (A85471_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. For our installation, we will be using four mount points 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_817_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.

    Oracle8i Release 3 (8.1.7) 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_817_installation_files.tar archive. After extracting the archive, you will have a new directory called 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_817_installation_files.tar
    x oracle_817_installation_files, 0 bytes, 0 tape blocks
    x oracle_817_installation_files/admin.tar, 50176 bytes, 98 tape blocks
    x oracle_817_installation_files/common.tar, 813568 bytes, 1589 tape blocks
    x oracle_817_installation_files/crontabORA817.txt, 3450 bytes, 7 tape blocks
    x oracle_817_installation_files/dbora, 8056 bytes, 16 tape blocks
    x oracle_817_installation_files/dbshut, 2511 bytes, 5 tape blocks
    x oracle_817_installation_files/dbstart, 4092 bytes, 8 tape blocks
    x oracle_817_installation_files/local_bin.tar, 20480 bytes, 40 tape blocks
    x oracle_817_installation_files/oratab, 746 bytes, 2 tape blocks
    x oracle_817_installation_files/profile_oracle, 5903 bytes, 12 tape blocks
    x oracle_817_installation_files/system, 1804 bytes, 4 tape blocks
    
    $ cp oracle_817_installation_files/profile_oracle ~/.profile
    
    $ tar xvf oracle_817_installation_files/admin.tar
    
    $ tar xvf oracle_817_installation_files/common.tar
    
    $ cp oracle_817_installation_files/oratab /var/opt/oracle/
    
    $ (cd /opt/bin && tar xvf ~/oracle_817_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 Net8 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 Oracle8i, 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 2) of the Oracle8i Enterprise Edition, Release 3 (8.1.7) for Sun SPARC Solaris. On most systems, 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 hsfs /dev/.... /cdrom

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

    Oracle8i Software Installation Screen Responses
    Screen Name Choice
    Welcome Screen <Next>
    File Locations Source Path: /cdrom/oracle8i/stage/products.jar
    Destination Path: /u01/app/oracle/product/8.1.7
    <Next>
    UNIX Group Name UNIX Group Name: dba
    <Next>
    Available Products Oracle8i Enterprise Edition 8.1.7.0.0
    Oracle8i Client 8.1.7.0.0
    Oracle8i Management and Integration 8.1.7.0.0
    <Next>
    Installation Types Typical (1.01GB)
    Minimal (836MB)
    Custom
    <Next>
    Software Assessment Manager [*] Oracle8i Server 8.1.7.0.0

    Oracle HTTP Server 1.3.12.0.1a
       [*] Oracle HTTP Server Extensions 8.1.7.0.0
       [*] Apache Module for Oracle Servlet Engine 8.1.7.0.0
       [*] Oracle Mod PL/SQL Gateway 3.0.0.4.0
       [*] BC4J Runtime 3.2.1
       [*] Apache Configuration for XML Developer's Kit 8.1.7.0.0

    Oracle Product Options
       [*] Oracle Time Series 8.1.7.0.0
       [*] Oracle Visual Information Retrieval 8.1.7.0.0
       [*] Oracle Spatial 8.1.7.0.0
       [  ] Oracle Advanced Security 8.1.7.0.0
       [*] Oracle interMedia 8.1.7.0.0
       [*] Advanced Replication 8.1.7.0.0
       [*] Oracle Partitioning 8.1.7.0.0
       [  ] Legato Storage Manager 8.1.7.0.0

    Net8 Product Set
       [*] Net8 Client 8.1.7.0.0
       [*] Net8 Server 8.1.7.0.0
       [*] Oracle Names 8.1.7.0.0
       [*] Oracle Connection Manager 8.1.7.0.0
       [*] External Naming NIS 8.1.7.0.0
       [  ] Oracle Protocol Support 8.1.7.0.0

    Oracle Utilities
       [*] Oracle Database Utilities 8.1.7.0.0
       [*] SQL*Plus 8.1.7.0.0

    Oracle Java Products
       [*] Oracle JDBC Drivers 8.1.7.0.0 (All)
       [*] Oracle SQLJ 8.1.7.0.0
       [*] Oracle Java Tools 8.1.7.0.0

    Oracle Enterprise Manager Products
       [*] Oracle Intelligent 8.1.7.0.0
       [*] Oracle Agent Extensions 8.1.7.0.0
       [  ] Oracle Management Server 2.2.0.0.0
       [*] Oracle Enterprise Manager Client 2.2.0.0.0
       [  ] Oracle Enterprise Manager Web Site 2.2.0.0.0
       [*] Oracle Enterprise Manager Quick Tours 2.2.0.0.0

    Oracle Configuration Assistant
       [*] Oracle Data Migration Assistant 8.1.7.0.0
       [*] Oracle Database Configuration Assistant 8.1.7.0.0

    Development Tools
       [*] Oracle Call Interface (OCI) 8.1.7.0.0
       [*] Oracle Type Translator 8.1.7.0.0
       [*] Oracle XML Developer's Kit 8.1.7.0.0
       [*] Oracle XML SQL Utility 2.0.0.0.0

    Oracle Installation Products
       [*] Oracle Universal Installer 1.7.1.8.0

    [*] Oracle8i for UNIX Documentation 8.1.7.0.0

    <Next>

    Component Locations <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".

    NOTE: There are times when Disk 2 will be mounted as /cdrom/oracle8i#1. It this happens, the Oracle Universal Installer will not recognize it since it was started from /cdrom/oracle8i. If this happens, you can simply create a symbolic link as follows and go back to the dialog and hit "OK":
    # cd /cdrom
    # ln -s oracle8i#1 oracle8i

  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/8.1.7 and run the root.sh script:
    $ cd /u01/app/oracle/product/8.1.7
    $ su
    Password: *******
    
    # ./root.sh
    Running Oracle8 root.sh script...
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/oracle/product/8.1.7
        ORACLE_SID=   ORA817
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/bin
    Entry will be added to the /var/opt/oracle/oratab file 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.
    IMPORTANT NOTE: Please delete any log and trace files previously
                    created by the Oracle Enterprise Manager Intelligent
                    Agent. These files may be found in the directories
                    you use for storing other Net8 log and trace files.
                    If such files exist, the OEM IA may not restart.
    # 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 /otp/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 Oracle8i are already included in the archive "oracle_817_installation_files.tar"; downloaded earlier in this article. Therefore, when prompted for the Net8 Configuration Assistant, simply hit "Cancel" and allow it to fail. Again, the Net8 configuration files I already have included within the "oracle_817_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 2 from the CD-ROM.
    $ eject cdrom


Installing the Oracle 8.1.7.4.0 Patchset

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

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

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

After shutting down all Oracle processes, you will then need to obtain the 8.1.7.4.0 patchset from Metalink. Simply download the patchset "8174_solaris32_release.tar" 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 8174_solaris32_release.tar /u01/app/oracle/patchset
$ cd /u01/app/oracle/patchset
$ tar xvf 8174_solaris32_release.tar
$ cd
$ runInstaller
$ Initializing Java Virtual Machine from /u01/app/oracle/jre/1.1.8/bin/jre. Please wait...
Here is a sample of the screen shots that I used for the patchset install:

Oracle8i 8.1.7.4.0 Patchset Installation Screen Responses
Screen Name Choice
Welcome Screen <Next>
File Locations Source Path: /u01/app/oracle/patchset/Disk1/stage/products.jar
Destination Path: /u01/app/oracle/product/8.1.7
<Next>
Summary <Install>



Configure Net8

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 Net8 software. If you have been following this article, you will already have the necessary files to configure Net8. The file "oracle_817_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_817_installation_files
$ pwd
/u01/app/oracle/oracle_817_installation_files

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

$ cd
$ lsnrctl start

LSNRCTL for Solaris: Version 8.1.7.4.0 - Production on 31-JUL-2004 18:21:39

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

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

TNSLSNR for Solaris: Version 8.1.7.4.0 - Production
System parameter file is /u01/app/oracle/product/8.1.7/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/8.1.7/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=alex)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=alex)(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 8.1.7.4.0 - Production
Start Date                31-JUL-2004 18:21:39
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/8.1.7/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/8.1.7/network/log/listener.log
Services Summary...
  PLSExtProc            has 1 service handler(s)
The command completed successfully


Creating the Oracle Database - (ORA817)

We are now heading into the final strech - time to create an Oracle database. This section will describe the steps to create an Oracle 8.1.7 database named ORA817 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
$ dbassist

If you would like to create the ORA817 (one in which installs all Oracle options like JServer, Virage, Timeseries, SQL*Plus Help, Spatial, etc.) I have included with this example, simply navigate to the directory ~oracle/admin/ORA817/create and run the file RUN_CRDB.sh as the oracle user id as follows:

$ cd ~/admin/ORA817/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/ORA817/create
$ tail -f crdb.log



Setting up Automatic Database Starting & Stopping

Included in the file you downloaded and extracted earlier in this article (oracle_817_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_817_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_817_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.

NOTE: For Oracle 8.1.6 users, the DBA would need to modify the dbstart script to recognize the JServer banner in SQL*Plus. This is a bug with dbstart in the 8.1.6 release, but I always look for and include this modified version of dbstart. In the included dbstart script, I would have to add the following to line 64 of the dbstart script.
/(PL\/SQL|JServer) (Release|Version)/ {substr($3,1,3) ;



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.6 and Oracle 8.1.7). For example, you may have two database - ORA816 (using Oracle release 8.1.6) and ORA817 (using Oracle release 8.1.7). 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 = [ORA817] ? ORA816
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 ORA816, 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 Net8, I included a pretty generic listener.ora file that will not allow the OIA recognize and discover the Oracle SID ORA817. In order for the OIA to discover this SID, you will need to edit the listener.ora file to include the ORA817 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 = TCP)(HOST = localhost)(PORT = 2481))
      )
      (PROTOCOL_STACK =
       (PRESENTATION = GIOP)
       (SESSION = RAW)
      )
    )

    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
        (ADDRESS = (PROTOCOL = IPC)(KEY = ORA817_ALEX.IDEVELOPMENT.INFO))
        (ADDRESS = (PROTOCOL = IPC)(KEY = ORA817_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/8.1.7)
      (PROGRAM = extproc)
      (ENVS="EXTPROC_DLLS=ANY")
    )
    (SID_DESC =
      (GLOBAL_DBNAME  = ORA817_ALEX.IDEVELOPMENT.INFO)
      (SID_NAME       = ORA817)
      (ORACLE_HOME    = /u01/app/oracle/product/8.1.7)
    )
  )

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
$ lsnrctl dbsnmp_start
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, ORA817_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
    $ lsnrctl dbsnmp_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.ORA817_ALEX.IDEVELOPMENT.INFO.NAME=dbsnmp
    SNMP.CONNECT.ORA817_ALEX.IDEVELOPMENT.INFO.PASSWORD=manager

  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  1 12:20 /u01/app/oracle/product/8.1.7/network/admin/snmp_rw.ora

  5. Change the DBSNMP password on the database. You can use either Security Manager, SQL*Plus, or Server Manager. 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.
    $ lsnrctl dbsnmp_start

  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 Oracle8i 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 server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, 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 20 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 and Mathematics.



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:15 EDT
Page Count: 13010