DBA Tips Archive for Oracle

  


Installing Oracle Database 10g R1 (10.1.0) on Solaris 9

by Jeff Hunter, Sr. Database Administrator


Contents

  1. Overview
  2. Hardware Overview
  3. Operating Environment Configuration
  4. Disk Configuration - (Internal Disk for ORACLE_HOME)
  5. Configuring the Oracle User
  6. Disk Configuration - (External Disks for ASM)
  7. Installing the Oracle Database 10g Software
  8. Applying the 10.1.0.4 Database Patchset
  9. Configure Oracle Net
  10. Creating the Oracle Database
  11. Creating / Altering Tablespaces
  12. Setting up Automatic Database Starting & Stopping
  13. Miscellaneous Options
  14. Copyright
  15. About the Author



Overview

This article is a comprehensive guide for installing Oracle Database 10g Release 1 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 Oracle Database 10g (10.1.0):

  Oracle Database 10g Release 1 (10.1) Documentation
  Oracle Database Quick Installation Guide 10g Release 1 (10.1) for Solaris Operating System (SPARC) - (B10814-01)
Here is a short introduction to some of the configuration parameters that will be used for installing the Oracle Database Software and creating a database:


By the time you finish this article, the following will be configured:


The following is a list of items NOT covered in this article:


  The installation instructions in this document will also work with Solaris 10!



Hardware Overview

For the purpose of this document, I will be utilizing a Sun Blade 150 running SPARC Solaris 9. The Sun Blade 150 will be connected to a Sun StorEDGE D1000 Dual Channel Disk Array with access to one channel containing six 9.1GB / 10000 RPM / UltraSCSI disk drives for a total disk array capacity of 54GB. The disk array is connected to the Sun Blade 150 using a Dual Differential Ultra/Wide SCSI (X6541A) host adapter.

The Sun Blade 150 and Sun StorEDGE D1000 Disk Array are configured as follows:

Processor: UltraSPARC-IIe 650MHz
Operation Environment: Solaris 9
Memory: 1.7GB
Internal Disks: 2 x 40GB IDE hard drives identified as follows:
  • /dev/dsk/c0t0d0
  • /dev/dsk/c0t2d0
D1000 Disk Array: 6 x 9.1GB Ultra SCSI hard drives identified as follows:
  • /dev/dsk/c1t0d0
  • /dev/dsk/c1t1d0
  • /dev/dsk/c1t2d0
  • /dev/dsk/c1t3d0
  • /dev/dsk/c1t4d0
  • /dev/dsk/c1t5d0


After discussing the hardware being utilized for this article, I end this section by describing how each of the disks will be used for the Oracle Database software installation and database:

Device Type Size - (GB) Usage Mount Point /
ASM Disk Group
c0t0d0 Internal 40 Solaris Operating Environment /
c0t2d0 Internal 40 Oracle Database 10g Software.
  • ORACLE_BASE: /u01/app/oracle
  • ORACLE_HOME: /u01/app/oracle/product/10.1.0/db_1
/u01
c1t0d0 D1000 Disk Array 9.1 ASM Disk Group 1 TESTDB_DATA1
c1t1d0 D1000 Disk Array 9.1 ASM Disk Group 1 TESTDB_DATA1
c1t2d0 D1000 Disk Array 9.1 ASM Disk Group 1 TESTDB_DATA1
c1t3d0 D1000 Disk Array 9.1 ASM Disk Group 2 TESTDB_DATA2
c1t4d0 D1000 Disk Array 9.1 ASM Disk Group 2 TESTDB_DATA2
c1t5d0 D1000 Disk Array 9.1 ASM Disk Group 2 TESTDB_DATA2



Operating Environment Configuration

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 account.

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

  2. The following Solaris packages MUST be installed:
    SUNWarc    SUNWlibms   SUNWi1of
    SUNWbtool  SUNWsprot   SUNWi1cs
    SUNWhea    SUNWsprox   SUNWi15cs
    SUNWlibm   SUNWtoo     SUNWxwfnt
    Use the pkginfo command to verify the above packages:
    # pkginfo -i SUNWarc SUNWlibms SUNWi1of SUNWbtool SUNWsprot SUNWi1cs \
                 SUNWhea SUNWsprox SUNWi15cs SUNWlibm SUNWtoo SUNWxwfnt
    system      SUNWarc        Archive Libraries
    system      SUNWbtool      CCS tools bundled with SunOS
    system      SUNWhea        SunOS Header Files
    system      SUNWi15cs      X11 ISO8859-15 Codeset Support
    system      SUNWi1cs       X11 ISO8859-1 Codeset Support
    system      SUNWi1of       ISO-8859-1 (Latin-1) Optional Fonts
    system      SUNWlibm       Forte Developer Bundled libm
    system      SUNWlibms      Forte Developer Bundled shared libm
    system      SUNWsprot      Solaris Bundled tools
    system      SUNWsprox      Sun WorkShop Bundled 64-bit make library
    system      SUNWtoo        Programming Tools
    system      SUNWxwfnt      X Window System platform required fonts

  3. 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.

      It is essential that the the following patches are installed for Solaris 9:

    • 112233-11: SunOS 5.9: Kernel Patch
    • 111722-04: SunOS 5.9: Math Library (libm) patch

    To determine whether an operating system patch is installed, enter a command similar to the following:

    # /usr/sbin/patchadd -p | grep patch_number

  4. Ensure enough swap space is available. An amount of disk space equal to 1 GB (1048576 KB) or twice the amount of RAM, whichever is greater. On systems with 2 GB or more of RAM, the swap space can be between one and two times the size of RAM.

    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. For example:
      4198304 * 512 = 2149531648 bytes
                    = 2 GB of swap

  5. Ensure enough disk space in the /tmp directory. An amount of disk space equal to 400 MB (or greater) needs to be available for the Oracle Database installation.

      If 1 GB 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

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

  7. 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=256
    set semsys:seminfo_semmns=204800
    * +---- SNIP HERE ---+
      After making changes to the kernel parameters under Solaris, you will need to re-boot the database server before any changes can take effect.

  8. The system architure must be 64-bit. To determine whether the system architecture is 64-bit, enter the following command:
    # /bin/isainfo -kv
    This command should return the following output. If you do not see the expected output, you cannot install the software on this system.
    64-bit sparcv9 kernel modules

  9. Verify a the firewall is disabled and that UDP ICMP rejections are turned off. To disable the firewall in Solaris 10:
    # pfexec ipf D
    
    - or 
    
    # svcadm disable ipfilter



Disk Configuration - (Internal Disk for ORACLE_HOME)

As noted in the section "Hardware Overview", I discussed the disks that will be utilized for both the Oracle Database 10g Software installation and the physical database files. This section discusses the steps I took to partition (and mount) one of those internal 40GB IDE hard drives that will be used for the Oracle Database software.

The Solaris Operating Environment will be installed on one of those disks (/dev/dsk/c0t0d0) while the second IDE hard disk (/dev/dsk/c0t2d0) will be used to store the Oracle Database 10g software. Before using this second disk, I need to first partition the disk and then create a file system (ufs) on the disk. Finally, I need to mount the file system to /u01.

The following steps require use of the root user account:


# [ LOGIN AS ROOT ] # su -
# [ PARTITION ENTIRE DISK ] # format c0t2d0 format> partition partition> print Current partition table (original): Total disk cylinders available: 19156 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 unassigned wm 0 0 (0/0/0) 0 1 unassigned wm 0 0 (0/0/0) 0 2 backup wm 0 - 19155 37.27GB (19156/0/0) 78156480 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 partition> 4 Part Tag Flag Cylinders Size Blocks 4 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: usr Enter partition permission flags[wm]: wm Enter new starting cyl[0]: 0 Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 19155c partition> print Current partition table (unnamed): Total disk cylinders available: 19156 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 unassigned wm 0 0 (0/0/0) 0 1 unassigned wm 0 0 (0/0/0) 0 2 backup wm 0 - 19155 37.27GB (19156/0/0) 78156480 3 unassigned wm 0 0 (0/0/0) 0 4 usr wm 0 - 19154 37.27GB (19155/0/0) 78152400 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 partition> label Ready to label disk, continue? yes partition> quit format> quit
# [ CREATE NEW FILE SYSTEM ] # newfs -i 8192 /dev/rdsk/c0t2d0s4 newfs: construct a new file system /dev/rdsk/c0t2d0s4: (y/n)? y /dev/rdsk/c0t2d0s4: 78152400 sectors in 19155 cylinders of 16 tracks, 255 sectors 38160.4MB in 737 cyl groups (26 c/g, 51.80MB/g, 6400 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 106368, 212704, 319040, 425376, 531712, 638048, 744384, 850720, 957056, Initializing cylinder groups: .............. super-block backups for last 10 cylinder groups at: 77121984, 77228320, 77334656, 77440992, 77547328, 77653664, 77760000, 77866336, 77972672, 78074912,
# [ CREATE MOUNT POINT DIRECTORY ] # mkdir /u01
# [ INSERT THE FOLLOWING ENTRY INTO /etc/vfstab ] # echo "/dev/dsk/c0t2d0s4 /dev/rdsk/c0t2d0s4 /u01 ufs 2 yes -" >> /etc/vfstab
# [ MOUNT THE NEW FILE SYSTEM ] # mount /u01
# [ CHECK FOR NEW FILE SYSTEM ] # df -k Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t0d0s0 36409485 2159608 33885783 6% / /proc 0 0 0 0% /proc mnttab 0 0 0 0% /etc/mnttab fd 0 0 0 0% /dev/fd swap 3521816 40 3521776 1% /var/run swap 3521776 0 3521776 0% /tmp cartman:/share2 306562280 94150712 212105008 31% /cartman /dev/dsk/c0t2d0s4 38474780 9 38090024 1% /u01



Configuring the Oracle User

This section covers the steps required to create the UNIX group and user that will be used to install the Oracle Database 10g software.

The following steps require use of the root user account:

  1. Create the UNIX Group for the Oracle User Id.
    # groupadd -g 116 oinstall
    # groupadd -g 115 dba

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

  3. Verify the oracle UNIX user account. The following command verifies that oinstall is the primary group and dba is the secondary group:
    # id -a oracle
    uid=175(oracle) gid=116(oinstall) groups=115(dba)

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

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

  6. Verify the /usr/local/bin directory exists:
    # mkdir -p /usr/local/bin

  7. Unpackage the contents of the oracle_10g_installation_files.tar archive. After extracting the archive, you will have a new directory called oracle_10g_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 configuration files.

    The following commands should be run as the newly created oracle user account:

    # su - oracle
    $ id -a
    uid=175(oracle) gid=116(oinstall) groups=116(oinstall),115(dba)
    
    $ pwd
    /u01/app/oracle
    
    $ tar xvf oracle_10g_installation_files.tar
    x oracle_10g_installation_files, 0 bytes, 0 tape blocks
    x oracle_10g_installation_files/common.tar, 1542144 bytes, 3012 tape blocks
    x oracle_10g_installation_files/dbora, 8070 bytes, 16 tape blocks
    x oracle_10g_installation_files/local_bin.tar, 19968 bytes, 39 tape blocks
    x oracle_10g_installation_files/oratab, 758 bytes, 2 tape blocks
    x oracle_10g_installation_files/profile_oracle, 6012 bytes, 12 tape blocks
    x oracle_10g_installation_files/system, 1804 bytes, 4 tape blocks
    x oracle_10g_installation_files/ldap.ora, 851 bytes, 2 tape blocks
    x oracle_10g_installation_files/listener.ora, 1545 bytes, 4 tape blocks
    x oracle_10g_installation_files/sqlnet.ora, 16078 bytes, 32 tape blocks
    x oracle_10g_installation_files/tnsnames.ora, 1301 bytes, 3 tape blocks
    x oracle_10g_installation_files/crontabTESTDB.txt, 3460 bytes, 7 tape blocks
    
    $ cp oracle_10g_installation_files/profile_oracle ~/.profile
    
    $ tar xvf oracle_10g_installation_files/common.tar
    
    $ cp oracle_10g_installation_files/oratab /var/opt/oracle/
    
    $ (cd /opt/bin && tar xvf ~/oracle_10g_installation_files/local_bin.tar)
    
    $ . ~/.profile
    .profile executed
    $

  8. 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.

  9. Create the Oracle product / admin directory.
    $ mkdir /u01/app/oracle/product
    $ mkdir /u01/app/oracle/admin

  10. Verify O/S Shell Limits.

    Oracle Database 10g 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.



Disk Configuration - (External Disks for ASM)

As noted at the beginning of this article, the Sun Blade 150 is connected to an external D1000 SCSI disk array. The Sun server will have access to six 9.1GB SCSI disks on one SCSI channel. These six disks will be used to store all physical Oracle database files using Automatic Storage Management (ASM).


Create Disk Partitions

Before any of the disks can be discovered by ASM, they need to be properly partitioned and configured. Before providing the details on how to partition all six disks, here are some things to keep in mind with regards to configuring disks for ASM:

  Before discussing the syntax of the format utility, it is important to understand the Free Hog slice that this utility may use. When you use the format utility to change the size of one or more disks slices, you may designate a temporary slice that will expand and shrink to accommodate the resizing operations. This temporary slice donates, or "frees" space when you expand a slice, and receives, or "hogs" the discarded space when you shrink a slice. This donor slice is called the free hog. (Source: Oracle MetaLink, Note ID: 271621.1)

  The following commands should be used to configure the partitions necessary on each disk to allow them to be discovered by Oracle ASM. Each of the disks will contain a small partition (500MB) for slice 0 (Source: Oracle MetaLink, Note ID: 271621.1) while slice 4 will be used for the main data partition.

Below, I only show the commands for one of the disks - (/dev/dsk/c1t0d0). I used the same format utility on all five remaining disks.

Run the format command to create the appropriate partitions on all disks that will be used for Oracle ASM. In this example, I ran the following format utility for c1t0d0, c1t1d0, c1t2d0, c1t3d0, c1t4d0, and then c1t5d0:


# [ LOGIN AS ROOT ] # su -
# [ CREATE PARTITIONS ON ALL SIX EXTERNAL DISK(s) ] # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <WDC WD400BB-22DEA0 cyl 19156 alt 2 hd 16 sec 255> /pci@1f,0/ide@d/dad@0,0 1. c0t2d0 <WDC WD400BB-22DEA0 cyl 19156 alt 2 hd 16 sec 255> /pci@1f,0/ide@d/dad@2,0 2. c1t0d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@0,0 3. c1t1d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@1,0 4. c1t2d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@2,0 5. c1t3d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@3,0 6. c1t4d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@4,0 7. c1t5d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@5,0 Specify disk (enter its number): 2 selecting c1t0d0 [disk formatted] FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name !<cmd> - execute <cmd>, then return quit format> partition PARTITION MENU: 0 - change `0' partition 1 - change `1' partition 2 - change `2' partition 3 - change `3' partition 4 - change `4' partition 5 - change `5' partition 6 - change `6' partition 7 - change `7' partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk !<cmd> - execute <cmd>, then return quit partition> modify Select partitioning base: 0. Current partition table (original) 1. All Free Hog Choose base (enter number) [0]? 1 Part Tag Flag Cylinders Size Blocks 0 root wm 0 0 (0/0/0) 0 1 swap wu 0 0 (0/0/0) 0 2 backup wu 0 - 4923 8.43GB (4924/0/0) 17682084 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 usr wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 Do you wish to continue creating a new partition table based on above table[yes]? yes Free Hog partition[6]? 7 Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 500mb Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: 7.9gb Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]: Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 285 501.48MB (286/0/0) 1027026 1 swap wu 0 0 (0/0/0) 0 2 backup wu 0 - 4923 8.43GB (4924/0/0) 17682084 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 286 - 4899 7.90GB (4614/0/0) 16568874 5 unassigned wm 0 0 (0/0/0) 0 6 usr wm 0 0 (0/0/0) 0 7 unassigned wm 4900 - 4923 42.08MB (24/0/0) 86184 Okay to make this the current partition table[yes]? yes Enter table name (remember quotes): "asm" Ready to label disk, continue? yes partition> quit format> verify format> disk AVAILABLE DISK SELECTIONS: 0. c0t0d0 <WDC WD400BB-22DEA0 cyl 19156 alt 2 hd 16 sec 255> /pci@1f,0/ide@d/dad@0,0 1. c0t2d0 <WDC WD400BB-22DEA0 cyl 19156 alt 2 hd 16 sec 255> /pci@1f,0/ide@d/dad@2,0 2. c1t0d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@0,0 3. c1t1d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@1,0 4. c1t2d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@2,0 5. c1t3d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@3,0 6. c1t4d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@4,0 7. c1t5d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /pci@1f,0/pci@5/scsi@1/sd@5,0 Specify disk (enter its number)[2]: <Continue with disks 3 through 7>

  After creating the appropriate partitions for a single disk (disk 2 in my example above), I use the disk command within format to list the disks again. After completing disk 2 (c1t0d0), I then move on and perform the same actions on disks 3 through 7 - creating a small 500MB partition on slice 0 and then allocating the remaining 7.9GB to slice 4.


Configure the Slices to be used as ASM Disks

The next step in this section is to configure the main data slices (created above on slice 4) for use as ASM disks. To perform this action, we need to give a raw (character) interface to it, with appropriate permissions.

We start by looking in the /dev/rdsk directory to locate the raw interfaces (logical) that already exist for the slice(s) we created in the previous tasks.

# cd /dev/rdsk
# ls -l c1t0d0s4 c1t1d0s4 c1t2d0s4 c1t3d0s4 c1t4d0s4 c1t5d0s4
lrwxrwxrwx  1 root  root   48 Dec 15 13:51 c1t0d0s4 -> ../../devices/pci@1f,0/pci@5/scsi@1/sd@0,0:e,raw
lrwxrwxrwx  1 root  root   48 Dec 15 13:51 c1t1d0s4 -> ../../devices/pci@1f,0/pci@5/scsi@1/sd@1,0:e,raw
lrwxrwxrwx  1 root  root   48 Dec 15 13:51 c1t2d0s4 -> ../../devices/pci@1f,0/pci@5/scsi@1/sd@2,0:e,raw
lrwxrwxrwx  1 root  root   48 Dec 15 13:51 c1t3d0s4 -> ../../devices/pci@1f,0/pci@5/scsi@1/sd@3,0:e,raw
lrwxrwxrwx  1 root  root   48 Dec 15 13:51 c1t4d0s4 -> ../../devices/pci@1f,0/pci@5/scsi@1/sd@4,0:e,raw
lrwxrwxrwx  1 root  root   48 Dec 15 13:51 c1t5d0s4 -> ../../devices/pci@1f,0/pci@5/scsi@1/sd@5,0:e,raw
The above listing shows that the files in this directory are simply symbolic links to the physical device file. We can resolve this with the -L option as follows:
# cd /dev/rdsk
# ls -lL c1t0d0s4 c1t1d0s4 c1t2d0s4 c1t3d0s4 c1t4d0s4 c1t5d0s4
crw-r-----   1 root     sys       32,  4 Dec 15 13:51 c1t0d0s4
crw-r-----   1 root     sys       32, 12 Dec 15 13:51 c1t1d0s4
crw-r-----   1 root     sys       32, 20 Dec 15 13:51 c1t2d0s4
crw-r-----   1 root     sys       32, 28 Dec 15 13:51 c1t3d0s4
crw-r-----   1 root     sys       32, 36 Dec 15 13:51 c1t4d0s4
crw-r-----   1 root     sys       32, 44 Dec 15 13:51 c1t5d0s4
Great, we can now see the major and minor device numbers for each of the physical device files. Take the disk device c1t0d0s4 for example, it has a major number of 32 and minor number of 4. The 'c' at the beginning shows that this is a character (raw) special file.

Given this information, we can do a better job of organizing ASM disks by creating additional interfaces to these slices from a different location.

We start by creating a directory to store these new interfaces:

# su -
# mkdir /asmdisks
# cd /asmdisks
The next step is to use the mknod utility. The mknod utility is used to create both character and block special files. The following creates six new (character) special files for our main data slices created earlier and using the major and minor numbers identified from the listing above:
# mknod disk1 c 32 4
# mknod disk2 c 32 12
# mknod disk3 c 32 20
# mknod disk4 c 32 28
# mknod disk5 c 32 36
# mknod disk6 c 32 44
The above commands created six character special files which are simply raw interfaces to the slices that we had created earlier in this section:
# ls -l /asmdisks
total 0
crw-r--r--   1 root   other    32,  4 Mar 22 20:52 disk1
crw-r--r--   1 root   other    32, 12 Mar 22 20:52 disk2
crw-r--r--   1 root   other    32, 20 Mar 22 20:52 disk3
crw-r--r--   1 root   other    32, 28 Mar 22 20:53 disk4
crw-r--r--   1 root   other    32, 36 Mar 22 20:53 disk5
crw-r--r--   1 root   other    32, 44 Mar 22 20:53 disk6
The final step we should perform is to give the appropriate permissions to these files for the oracle UNIX user account and the ASM instance:
# cd /asmdisks
# chown oracle:dba disk1
# chown oracle:dba disk2
# chown oracle:dba disk3
# chown oracle:dba disk4
# chown oracle:dba disk5
# chown oracle:dba disk6

# ls -l 
total 0
crw-r--r--   1 oracle   dba    32,  4 Mar 22 20:52 disk1
crw-r--r--   1 oracle   dba    32, 12 Mar 22 20:52 disk2
crw-r--r--   1 oracle   dba    32, 20 Mar 22 20:52 disk3
crw-r--r--   1 oracle   dba    32, 28 Mar 22 20:53 disk4
crw-r--r--   1 oracle   dba    32, 36 Mar 22 20:53 disk5
crw-r--r--   1 oracle   dba    32, 44 Mar 22 20:53 disk6
We now have the slices ready to be accessible by the ASM instance. Later in this article, we will be configuring the ASM instance to recognize and discover these six disks to be used (added) to any diskgroup.



Installing the Oracle Database 10g Software


Obtain Oracle Database 10g Software

The first step is to obtain the Oracle Database 10g software. You may already have the Oracle Database 10g software on CD-ROM. If you do not, the software can be downloaded from Oracle's OTN site - http://otn.oracle.com.

  If you do not currently have an account with Oracle OTN, you will need to create one. This is a FREE account!

Download the Oracle Database 10g software from:

From the link above, download the file:

After downloading the file, place it in a temporary directory (i.e. /u01/app/oracle/orainstall) as the oracle UNIX user account. To extract the file, use the following:

$ id -a
uid=175(oracle) gid=116(oinstall) groups=116(oinstall),115(dba)

$ mkdir -p /u01/app/oracle/orainstall
$ mv ~/ship_rel10_sol64_db.cpio.gz /u01/app/oracle/orainstall
$ cd /u01/app/oracle/orainstall
$ gunzip ship_rel10_sol64_db.cpio.gz
$ cpio -idcmv < ship_rel10_sol64_db.cpio

  Some browsers will uncompress the files but leave the extension the same (gz) when downloading. If the above steps do not work for you, try skipping the un-compressing step (without changing the filename) and then extracting the file using cpio:
$ cpio -idmv < ship_rel10_sol64_db.cpio.gz
        

After successfully un-compressing and extracting the downloaded file, it will create a directory named Disk1 containing the Oracle Database 10g installation files:

/Disk1


X Windows Server Requirement

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.

  You must install the Oracle database software from an X windows workstation, an X terminal, or a PC or other system with X server software installed.


Database Software Installation Steps

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

      If you are using Hummingbird's Exceed X-Windows emulator while installing and using Oracle Database 10g, 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.0
    $ export DISPLAY
    For example:
    $ DISPLAY=melody: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 almost ready to start the Oracle Universal Installer.

    If you are using a CD-ROM to install the Oracle databse software, insert Disk 1 (of 1) of the Oracle Database 10g Release 1 (10.1.0.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 as the root UNIX user account:

    $ 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.

    If you downloaded and extracted the software to a temporary directory (I used /u01/app/oracle/orainstall for this article), there is nothing to mount. Just take note of the directory that contains the runInstaller executable. For this article, the OUI executable will be located in /u01/app/oracle/orainstall/Disk1/runInstaller:

    $ ls -l /u01/app/oracle/orainstall/Disk1/runInstaller
    -rwxr-xr-x  1 oracle  oinstall   651 Jan 30  2004 /u01/app/oracle/orainstall/Disk1/runInstaller*

  5. Run the Oracle Universal Installer (OUI). Before running the OUI, however, verify the following:

    • Verify you are logged in as the "oracle" UNIX user account.
    • If you are using a CD-ROM to install the Oracle database software, the OUI should be run while in a directory other than the CD-ROM. (From Oracle's home directory for example.)
    • The umask for your session should be set to the value "022".
    • Set the DISPLAY environment variable to the X server you will be working from. (For example, the X server on your workstation or PC)
    • Ensure that the /tmp directory has at least 400MB of space. If you determined that the /tmp directory had insufficient free disk space when checking the hardware requirements, enter the following commands to set the TMP and TMPDIR environment variables. Specify a directory on a file system with sufficient free disk space. For example:
      $ TMP=/directory
      $ TMPDIR=/directory
      $ export TEMP TMPDIR
    • Verify that the environment variables ORACLE_BASE and ORACLE_SID are appropriately set before running the OUI.
    • Unset the environment variables ORACLE_HOME and TNS_ADMIN before running the OUI.

    # su - oracle
    
    $ id -a
    uid=175(oracle) gid=116(oinstall) groups=116(oinstall),115(dba)
    
    $ pwd
    /u01/app/oracle
    
    $ umask
    022
    
    $ echo $TMP
    /tmp
    
    $ echo $TMPDIR
    /tmp
    
    $ df -k /tmp
    Filesystem            kbytes    used   avail capacity  Mounted on
    swap                 3568264       0 3568264     0%    /tmp
    
    $ echo $ORACLE_BASE
    /u01/app/oracle
    
    $ echo $ORACLE_SID
    TESTDB
    
    $ unset ORACLE_HOME
    $ unset TNS_ADMIN
    
    $ /u01/app/oracle/orainstall/Disk1/runInstaller
    $ Starting Oracle Universal Installer...
    
    Checking installer requirements...
    
    Checking operating system version: must be 5.8 or 5.9.                Actual 5.9      Passed
    Checking Temp space: must be greater than 80 MB.                      Actual 3483 MB  Passed
    Checking swap space: must be greater than 150 MB.                     Actual 3504MB   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/OraInstall2005-03-23_07-24-27PM. Please wait ...
    Oracle Universal Installer, Version 10.1.0.2.0 Production
    Copyright (C) 1999, 2004, Oracle. All rights reserved.

    Oracle Database 10g Software Installation Screen Responses
    Screen Name Response
    Welcome Screen Click <Next>
    Specify Inventory directory and credentials Accept the default values:
       Full path of inventory directory: /u01/app/oracle/oraInventory
       Operating System group name: dba
    Click <Next>
    Specify File Locations Leave the default value for the Source directory. In most cases, the OUI will select the correct destination name and ORACLE_HOME. I always prefer to use the values I have documented below:
       Source Path: /u01/app/oracle/orainstall/Disk1/stage/products.xml
       Destination Name: OraDb10g_home1
       Destination Path: /u01/app/oracle/product/10.1.0/db_1
    Click <Next>
    Select Installation Types For this example, I selected to do an Enterprise Edition install. You can also make a choice to do a Standard Edition or a Custom install.
       Enterprise Edition (1.18GB)
       Standard Edition (1.15GB)
       Custom
    Click <Next>
    Product-specific Prerequisite Checks   The OUI then presents the dialog "Product-specific Prerequisite Checks". During the check procedures on SPARC Solaris version 9, you will get a warning while checking security kernel parameters:

    Checking for noexec_user_stack=1; found Not found.   Failed <<<<

    The reason for this error message is the noexec_user_stack kernel setting is only applicable to Sun SPARC Solaris versions 2.6, 2.7, and 2.8. In Solaris 9 (2.9) noexec_user_stack is obsolete.

    You can safely ignore this error/failure.

    To obtain more information on this warning/failure, see Metalink Note ID: 266766.1 - "10g install on Solaris 9 gets failure on noexec_user_stack setting".

    Additionally, shmmin and shmseg are obsolete with Solaris 9 and any errors/failures related to them can safely be ignored if the operating system is Solaris 9.

    You will need to acknowledge any of these warnings in this dialog by selecting the checkbox next to the warning/failure. This will change the warning/failure to User Verified.

    Click <Next>

    Select Database Configuration This dialog provides the option to have the OUI create a database. Since I will be applying the latest database patch to this install, (10.1.0.4.0), I will forgo the creation of the database and select the option to not create a starter database:
       Database Configuration: Do not create a starter database
    Click <Next>
    Summary Click <Install> to start the installation process.

  6. At the end of the installation, linking, and setup 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/10.1.0/db_1 and run the root.sh script:
    $ cd /u01/app/oracle/product/10.1.0/db_1
    $ su
    Password: *******
    
    # ./root.sh
    Running Oracle10 root.sh script...
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/oracle/product/10.1.0/db_1
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/bin
    The file "dbhome" already exists in /opt/bin.  Overwrite it? (y/n) [n]: n
    The file "oraenv" already exists in /opt/bin.  Overwrite it? (y/n) [n]: n
    The file "coraenv" already exists in /opt/bin.  Overwrite it? (y/n) [n]: n
    
    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.
    Successfully accumulated necessary OCR keys.
    Creating OCR keys for user 'root', privgrp 'other'..
    Operation successful.
    Oracle Cluster Registry for cluster has been initialized
    
    Adding to inittab
    Mar 24 00:22:35 alex root: [ID 702911 user.alert] (Oracle CSSD will be run out of init)
    Checking the status of Oracle init process...
    Expecting the CRS daemons to be up within 600 seconds.
    CSS is active on these nodes.
            alex
    CSS is active on all nodes.
    Oracle CSS service is installed and running under init(1M)
    
    # exit
    $
    After successfully running the root.sh script, go back to the dialog window from the Oracle Universal Installer and click "OK" to continue.

  7. The last screen of a successful Oracle Database 10g installation is the "End of Installation" screen. The OUI provides you with several URLs that will be activated by the OUI:

    The following J2EE Applications have been deployed and are accessible at the 
    URLs listed below.
    
    Ultra Search URL:
    http://alex:5620/ultrasearch
    
    Ultra Search Administration Tool URL:
    http://alex:5620/ultrasearch/admin
    
    iSQL*Plus URL:
    http://alex:5560/isqlplus

    Click the <Exit> button to exit from the Oracle Universal Installer.



Applying the 10.1.0.4 Database Patchset


Downloading the Patchset

At the time of this writing, the latest patchset for Oracle Database 10g running on SPARC Solaris (64-bit) is 10.1.0.4 (also known as patch 4163362). This patch will need to be downloaded from Oracle Metalink.

  Access to Oracle Metalink requires a valid login and CSI number.

After logging in to the Oracle Metalink website (http://metalink.oracle.com), click on the "Patches & Updates" button on the topics menu (left) and use the following to download the correct database patchset:

  1. On the "Select a Patch Search Area" screen, select the link for Simple Search.

  2. From the Simple Search screen, select the "Product or Family" option in the Search By pull-down listing. In the text field to the right, enter "RDBMS Servers".

  3. In the Release option, select "Oracle 10.1.0".

  4. For the Patch Type option, select "Patchset/Minipack".

  5. Finally, for the Platform or Language option, select "Solaris Operating System (SPARC 64-bit)".

  6. When all of the options are filled out, click the "Go" button.

  7. This will bring up the available patchsets in the Results section. For the purpose of this article, I will be downloading and installing patch: 4163362. Select this patchset in the Results section and then click the Download button to start the download process.

      The file name of the patchset to download is p4163362_10104_SOLARIS64.zip and is 708MB in size. This may take some time to download.


Applying the Patchset

As the oracle user account, extract the patch file to a temporary directory:
$ id -a
uid=175(oracle) gid=116(oinstall) groups=116(oinstall),115(dba)

$ mkdir -p /u01/app/oracle/orapatch
$ mv p4163362_10104_SOLARIS64.zip /u01/app/oracle/orapatch
$ cd /u01/app/oracle/orapatch
$ unzip p4163362_10104_SOLARIS64.zip

  You must install the Oracle database patch from an X windows workstation, an X terminal, or a PC or other system with X server software installed.

If you are not installing the patch software from the local system, enter the following command to direct X applications to display on the workstation / PC you are running on:

$ DISPLAY=<your_local_workstation>:0.0 ; export DISPLAY

In this example, your_local_workstation is the host name or IP address of the system that you want to use to display the Installer (your workstation or PC).

Before starting the OUI to install the patch set, we need to stop all listeners and other processes running in the Oracle home directory. If you have been following the instructions in this article, the only process running should be the Cluster Ready Services (CRS). To stop this process, use the following as the root UNIX user account:

$ su -
# /etc/init.d/init.cssd stop
Shutting down CRS daemon.
Shutting down EVM daemon.
Shutting down CSS daemon.
Shutdown request successfully issued.
# exit

Once all processes running in the Oracle home directory are stopped, we can now start the patch installation process. To do this, navigate to the directory where you extracted the patch set to and run the OUI installer as the oracle UNIX user account:

$ id -a
uid=175(oracle) gid=116(oinstall) groups=116(oinstall),115(dba)

$ cd /u01/app/oracle/orapatch/Disk1
$ ./runInstaller

Oracle Database 10.1.0.4.0 Patchset Installation Screen Responses
Screen Name Response
Welcome Screen Click <Next>
Specify File Locations Leave the default value for the Source directory. By default, it should be pointing to the products.xml file from the stage directory where you unpacked the patch set files.

In most cases, the OUI will also select the correct destination name and ORACLE_HOME that you want to update with this patch set.

Here are the settings I used for this article:
   Source Path: /u01/app/oracle/orapatch/Disk1/stage/products.xml
   Destination Name: OraDb10g_home1
   Destination Path: /u01/app/oracle/product/10.1.0/db_1
Click <Next>

Summary On the Summary screen, click <Install> to start the installation process.

At the end of the patch set installation, linking, and setup 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/10.1.0/db_1 and run the root.sh script:

$ cd /u01/app/oracle/product/10.1.0/db_1

$ su
Password: *******

# ./root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/10.1.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/bin
The file "dbhome" already exists in /opt/bin.  Overwrite it? (y/n) [n]: n
The file "oraenv" already exists in /opt/bin.  Overwrite it? (y/n) [n]: n
The file "coraenv" already exists in /opt/bin.  Overwrite it? (y/n) [n]: n

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.
clscfg: EXISTING configuration version 2 detected.
clscfg: version 2 is 10G Release 1.
Successfully accumulated necessary OCR keys.
clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Starting Oracle CSS service under init(1M)
Startup will be queued to init within 30 seconds.
Expecting the CRS daemons to be up within 120 seconds.
CSS is active on these nodes.
        alex
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

# exit
After successfully running the root.sh script, go back to the dialog window from the Oracle Universal Installer and click "OK" to continue. On the End of Installation screen, click Exit, then click Yes to exit from the Installer.

The Oracle Database 10g Patch Set 2 has now been successfully applied!



Configure Oracle Net

The Database Configuration Assistant (DBCA) requires the Oracle TNS Listener process to be configured and running on the database server before it can create the database.

Bring up the Network Configuration Assistant (NETCA) and run through the process of creating a new TNS listener process and to also configure the node for local access.

To start the NETCA, run the following GUI utility as the oracle UNIX user account:

$ netca &

Oracle Network Configuration Installation Screen Responses
Screen Name Response
Type of Configuration Select Listener configuration.
Listener Configuration - Next 6 Screens The following screens are now like any other normal listener configuration. You can simply accept the default parameters for the next six screens:
   What do you want to do: Add
   Listener name: LISTENER
   Selected protocols: TCP
   Port number: 1521
   Configure another listener: No
   Listener configuration complete! [ Next ]
You will be returned to this Welcome (Type of Configuration) Screen.
Type of Configuration Select Naming Methods configuration.
Naming Methods Configuration The following screens are:
   Selected Naming Methods: Local Naming
   Naming Methods configuration complete! [ Next ]
You will be returned to this Welcome (Type of Configuration) Screen.
Type of Configuration Click Finish to exit the NETCA.

The Oracle TNS listener process should now be running:

$ ps -ef | grep lsnr | grep -v 'grep' | awk '{print $9}'
LISTENER



Creating the Oracle Database

We will be using the Oracle Database Configuration Assistant (DBCA) to create a database / instance named TESTDB.

Before executing the Database Configuration Assistant, make sure that $ORACLE_HOME and $PATH are set appropriately for the $ORACLE_BASE/product/10.1.0/db_1 environment.

  If you have been following this article, you will notice that I entered TESTDB as the $ORACLE_SID environment variable and more importantly, as an entry in the file /var/opt/oracle/oratab. This causes a problem with the DBCA when it attempts to create a database (TESTDB) with the same name. To get around this, before attempting to create the TESTDB database, I first use the operation to Delete the TESTDB database within the DBCA. All instructions for this are provided below.

To start the database creation process, run the following as the oracle UNIX user account:

$ dbca &

Oracle Database Configuration Assistant Screen Responses
Screen Name Response
Welcome Screen Click <Next>
Operations Select Delete a Database.
Click <Next>
Database From the available databases listed, select TESTDB.
Click <Finish>.

When prompted to ask if you want to proceed, answer Yes.

You are then prompted one last time indicating that it could not determine the database files for the SID TESTDB. Acknowledge this prompt by answering OK to proceed.

When the delete process has completed, it prompts if you would like perform another operation. Click Yes.

Operations Select Create a Database.
Click <Next>
Database Templates Select Custom Database.
Click <Next>
Database Identification Select:
   Global Database Name: TESTDB.IDEVELOPMENT.INFO
   SID Prefix: TESTDB

  I used idevelopment.info for the database domain. You may use any domain. Keep in mind that this domain does not have to be a valid DNS domain.

Click <Next>

Management Option Leave the default options here which is to Configure the Database with Enterprise Manager.
Click <Next>
Database Credentials I selected to Use the Same Password for All Accounts. Enter the password (twice) and make sure the password does not start with a digit number.
Click <Next>
Storage Options For this article, we will select to use Automatic Storage Management (ASM).
Click <Next>
Create ASM Instance With the exception of supplying the SYS password I wanted to use for this instance, all other options I used were the defaults. This includes the default for all ASM parameters and then to use default parameter file (IFILE): {ORACLE_BASE}/admin/+ASM/pfile/init.ora.

You will then be prompted with a dialog box asking if you want to create and start the ASM instance. Select the OK button to acknowledge this dialog.

The OUI will now create and start the ASM instance on the database server.

ASM Disk Groups We will be configuring two ASM disk groups in this section.

To start, click the Create New button. This will bring up the "Create Disk Group" window. Click the Change Disk Discovery Path button and enter '/asmdisks/*' for the discovery patch. Then hit OK. This should bring up all six external disks as CANDIDATEs.

  If after changing the Disk Discovery Path you still do not see the six external disks as CANDIDATEs, click on the "Show All" radio button. If the disks show up under this window with a Header Status of MEMBER, then it is possible that these disks were part of an ASM instance and an old disk group. (This can happen if you are trying to go through this article a second time after already configuring the disks for ASM!) If this is the case, then ASM metadata has been left on the disk and will need to be removed. Note that you cannot simply select the disks that have a Header Status of MEMBER to be used for our new disk group as this will give errors like in the following:

  ORA-15018: diskgroup cannot be created
  ORA-15033: disk '/asmdisks/disk1' belongs to diskgroup "TESTDB_DATA1"
  ORA-15033: disk '/asmdisks/disk2' belongs to diskgroup "TESTDB_DATA1"
  ...

To remove the ASM metadata from the disks, first cancel out of the "Create Disk Group" dialog and get back to the "ASM Disk Groups" window. Then as the UNIX root account, change to the directory we created named "/asmdisks" and perform the following:

  dd if=/dev/zero of=/asmdisks/disk1 bs=8192 count=100
  dd if=/dev/zero of=/asmdisks/disk2 bs=8192 count=100
  dd if=/dev/zero of=/asmdisks/disk3 bs=8192 count=100
  dd if=/dev/zero of=/asmdisks/disk4 bs=8192 count=100
  dd if=/dev/zero of=/asmdisks/disk5 bs=8192 count=100
  dd if=/dev/zero of=/asmdisks/disk6 bs=8192 count=100

From the "ASM Disk Groups" windows, click on the "Create New" button. This should bring up all six disks with a Header Status of "CANDIDATE".

Select the first three disks: /asmdisks/disk1, /asmdisks/disk2, and /asmdisks/disk3. For this first "Disk Group Name", I used the string TESTDB_DATA1. Click OK on this dialog after all information has been entered. The OUI will create the disk group and return you to the ASM Disk Groups screen and all three disks should now have a status of "PROVISIONED".

Now, let's create the second disk group by clicking the Create New button again. You will notice that the only candiates are the three remaining disks (that were not provisioned in the previous step. Select these three disks and name the Disk Group Name TESTDB_DATA2. Click OK on this dialog after all information has been entered. The OUI will create the second disk group and return you to the ASM Disk Groups screen and all three disks should now have a status of "PROVISIONED".

Select the checkbox next to the newly created Disk Group Name TESTDB_DATA1 and TESTDB_DATA2 and click <Next> to continue.

Database File Locations I selected to use the default which is Use Oracle-Managed Files:
   Database Area: +TESTDB_DATA1.
Click <Next>
Recovery Configuration I selected to use the default for the Flash Recovery Area which is +TESTDB_DATA2. I did, however, increase the size of the Flash Area to 6GB (6144 M Bytes).

On this screen, you can also enable Archiving.
Click <Next>

Database Content I left all of the Database Components (and destination tablespaces) set to their default value.
Click <Next>
Initialization Parameters Change any parameters for your environment. I left them all at their default settings.
Click <Next>
Database Storage Change any parameters for your environment. I left them all at their default settings.
Click <Next>
Creation Options Keep the default option Create Database selected and click Finish to start the database creation process.

Click OK on the "Confirmation" screen.

End of Database Creation At the end of the database creation, exit from the DBCA.

When the Oracle Database Configuration Assistant has completed, you will have a fully functional Oracle10g database running!

  I like to review the log files that were created by the DBCA process. For the purpose of the example in this article, my log files were created in /u01/app/oracle/admin/TESTDB/create.



Creating / Altering Tablespaces

When creating the Oracle database, we left all tablespaces set to their default size. Since I am using a large set of drives for the storage, I like to make a sizable testing database.

This section provides several optional SQL commands I used to modify and create all tablespaces for my testing database. Please keep in mind that the database file names (OMF files) I used in this example may differ from what Oracle creates for your environment.

$ sqlplus "/ as sysdba"

SQL> create user scott identified by tiger default tablespace users;
SQL> grant dba, resource, connect to scott;

SQL> alter database datafile '+TESTDB_DATA1/testdb/datafile/users.264.555686549' resize 1024m;
SQL> alter tablespace users add datafile '+TESTDB_DATA1' size 1024m autoextend off;

SQL> create tablespace indx datafile '+TESTDB_DATA1' size 1024m
  2  autoextend on next 50m maxsize unlimited
  3  extent management local autoallocate
  4  segment space management auto;

SQL> -- SYSTEM Tablespace
SQL> alter database datafile '+TESTDB_DATA1/testdb/datafile/system.260.555686443' resize 800m;

SQL> -- SYSAUX Tablespace
SQL> alter database datafile '+TESTDB_DATA1/testdb/datafile/sysaux.262.555686513' resize 500m;

SQL> alter tablespace undotbs1 add datafile '+TESTDB_DATA1' size 1024m
  2  autoextend on next 50m maxsize 2048m;

SQL> alter database tempfile '+TESTDB_DATA1/testdb/tempfile/temp.263.555686529' resize 1024m;

Here is a snapshot of the tablespaces I have defined for my test database environment:

SQL> @dba_tablespaces

Status    Tablespace Name TS Type      Ext. Mgt.  Seg. Mgt.    Tablespace Size    Used (in bytes) Pct. Used
--------- --------------- ------------ ---------- --------- ------------------ ------------------ ---------
ONLINE    INDX            PERMANENT    LOCAL      AUTO           1,073,741,824             65,536         0
ONLINE    SYSAUX          PERMANENT    LOCAL      AUTO             524,288,000        225,574,912        43
ONLINE    SYSTEM          PERMANENT    LOCAL      MANUAL           838,860,800        450,625,536        54
ONLINE    UNDOTBS1        UNDO         LOCAL      MANUAL         1,283,457,024         56,819,712         4
ONLINE    USERS           PERMANENT    LOCAL      AUTO           2,147,483,648            131,072         0
ONLINE    TEMP            TEMPORARY    LOCAL      MANUAL         1,073,741,824         25,165,824         2
                                                            ------------------ ------------------ ---------
avg                                                                                                      17
sum                                                              6,941,573,120        758,382,592

6 rows selected.



Setting up Automatic Database Starting Stopping

Included in the file you downloaded and extracted earlier in this article (oracle_10g_installation_files.tar) is a utility called dbora that may be used to automatically start and stop the Oracle database and all other Oracle routines. The dbora script may differ on every database server only slightly as each database server has different requirements for handling Apache, TNS 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 database(s) to start and stop.

Here is how to install the dbora file:

$ su
# cp /u01/app/oracle/oracle_10g_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/S99dbora
# exit


The next step is to edit the /var/opt/oracle/oratab file to allow the dbora script to automatically start and stop databases. Simply alter the final field in the +ASM and TESTDB entry from N to Y. NOTE: Ensure that the ASM instance is started BEFORE any databases that are making use of disk groups contained in it.

...
+ASM:/u01/app/oracle/product/10.1.0/db_1:Y
TESTDB:/u01/app/oracle/product/10.1.0/db_1:Y
... 

  No changes needed to be made to the dbshut or dbstart scripts located in the $ORACLE_HOME/bin directory.


The final step to manually edit the script /etc/inittab so that the entry for init.cssd comes before running the runlevel 3. As explained in Metalink Note ID: 264235.1, the fix is as follows:


  Bug: 3458327 - Automatic Startup On Reboot Fails When Database Uses ASM

This bug is "almost" fixed in the 10.1.0.4.0 Patch Set!!!!!!

If you have been following this article and applied the 10.1.0.4 patchset (and modified the /etc/inittab file to force init.cssd to run before running runlevel 3), this bug should affect you. If you are using 10.1.0.3 (and below), however, this bug will not allow the Oracle ASM instance to start, which will also prevent any other instances that have disk groups within that ASM instance to start. As they exist, the dbstart and dbshut scripts are not ASM aware with 10.1.0.3 and below. Even with patchset 10.1.0.4.0, we had to manually modify the /etc/inittab script. When the dbora script attempts to start the ASM database, even after the ocssd.bin is up and running, you will receive the error:

ORA-29701: unable to connect to Cluster Manager

Note that I used /etc/rc3.d/S99 to start the dbora script. You should make note that the dbora script MUST run after the /etc/init.d/init.cssd if you are starting an ASM instance. For Solaris, the OUI places the start for init.cssd as /etc/rc3.d/S96init.cssd.

You will also notice that I had to put a sleep 120 in the dbora script before starting any databases/instances. The dbora script will sleep for 120 seconds to ensure that ocssd.bin daemon is running before starting any ASM instances.



Miscellaneous Options


Oracle DBA Scripts

Included in the file you downloaded and extracted earlier in this article (oracle_10g_installation_files.tar) is a set of DBA scripts that were extracted to $ORACLE_BASE/dba_scripts/sql. This directory is included in the environment variable $ORACLE_PATH which is like a $PATH directory for SQL*Plus and other Oracle tools.

To start using these scripts, simply login to SQL*Plus from any directory as a DBA user. There is a Help script (help.sql) that can be used to identify all scripts that are available. Here is an example session:

$ sqlplus system/manager

SQL> @help.sql
========================================
DDL Examples
========================================
cr_clob.sql
cr_clob_8.sql
cr_dimension.sql
cr_index.sql

... <snip> ...

========================================
Tuning
========================================
perf_db_block_buffer_usage.sql
perf_explain_plan.sql
perf_file_io.sql
perf_file_io_7.sql
perf_file_io_efficiency.sql


SQL> @dba_tablespaces

Status    Tablespace Name TS Type      Ext. Mgt.  Seg. Mgt.    Tablespace Size    Used (in bytes) Pct. Used
--------- --------------- ------------ ---------- --------- ------------------ ------------------ ---------
ONLINE    INDX            PERMANENT    LOCAL      AUTO           1,073,741,824             65,536         0
ONLINE    SYSAUX          PERMANENT    LOCAL      AUTO             524,288,000        226,557,952        43
ONLINE    SYSTEM          PERMANENT    LOCAL      MANUAL           838,860,800        450,691,072        54
ONLINE    UNDOTBS1        UNDO         LOCAL      MANUAL         1,283,457,024         56,819,712         4
ONLINE    USERS           PERMANENT    LOCAL      AUTO           2,147,483,648            131,072         0
ONLINE    TEMP            TEMPORARY    LOCAL      MANUAL         1,073,741,824         25,165,824         2
                                                            ------------------ ------------------ ---------
avg                                                                                                      17
sum                                                              6,941,573,120        759,431,168

6 rows selected.


Enterprise Manager - Database Console

During the database creation section, I asked for DBCA to create the Enterprise Manager Database Console application. To start the DB console application, login as the UNIX oracle user account and type the following:
$ emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.1.0.4
Copyright (c) 1996, 2004 Oracle Corporation.  All rights reserved.
http://alex:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control .............. started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.1.0/db_1/alex_TESTDB/sysman/log
The OEM DB Console application may take several minutes to start.

Once the DB Console application is up and running, point your web browser to http://<Database_Server>:5500/em as in the following:

http://alex.idevelopment.info:5500/em

  The emctl start dbconsole command can be placed in the /etc/init.d/dbora script to be stopped and started when the database server is cycled.


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, Oracle 9.2.0, and 10.1.0). For example, you may have two database - ORA920 (using Oracle release 9.2.0) and TESTDB (using Oracle release 10.1.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] ? TESTDB
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 TESTDB, then all required environment variables would be reset to access this database.


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


Bug: 4147463

If you have been following this article and applied the 10.1.0.4 patchset, this bug should affect you. If you are using 10.1.0.3 (and below), however, this bug may hang your database instance, not allowing connections to succeed. The bug seems to loose the mapping of the instance to the SGA with the error appearing in a trace file similar to the following:
kstwlb: SGA is no longer mapped
AUM timeouts: MQL_TUNE(300s) TUR_TUNE(60s) SESS_EXPRN(1800s) QRY_EXPRN(1800s) 
  SLOT_PERIOD(600s) MQL_CUSHION(300s) KSUCKI_FG_PERIOD(150s) 
  MMNL_EXPRN(1200s) KTTSINFO(300s)



Copyright © 1998-2005 Jeffrey M. Hunter. All rights reserved.

This article 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 article 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 in this article and hosted on my web site are 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.



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
Sunday, 18-Mar-2012 22:27:50 EDT
Page Count: 50660