Tuesday, November 17, 2009

Installing Oracle Database 10g Release 2 on Linux x86



Learn the basics of installing Oracle Database 10g Release 2 on Red Hat Enterprise Linux or Novell SUSE Enterprise Linux, from the bare metal up (for evaluation purposes only)

Contents
 




The guide provides a walkthrough of installing an Oracle Database 10g Release 2 database on commodity hardware for the purpose of evaluation. If you are new to Linux and/or Oracle, this guide is for you. It starts with the basics and walks you through an installation of Oracle Database 10g Release 2 from the bare metal up.
This guide will take the approach of offering the easiest paths, with the fewest number of steps for accomplishing a task. This approach often means making configuration choices that would be inappropriate for anything other than an evaluation. For that reason, this guide is not appropriate for building production-quality environments, nor does it reflect best practices.
The Linux distributions certified for Oracle Database 10g Release 2 are:
  • Red Hat Enterprise Linux 4 (RHEL4)
  • Red Hat Enterprise Linux 3 (RHEL3)
  • Novell SUSE Linux Enterprise Server 9 (SLES9)
Here we will cover both Linux 2.6 kernel-based distributions: RHEL4 and SLES9. RHEL3 is not covered here.  
This guide is divided into four parts: Part I covers the installation of the Linux operating system, Part II covers configuring Linux for Oracle, Part III discusses the essentials of installing the Oracle Database, and Part IV covers creating additional filesystems and  Automatic Storage Management (ASM)—a new storage option in Oracle Database 10g that greatly simplifies storage administration and management. The Appendix provides information to help you get started using your new database including how to access the database interactively and how to stop and start the database and related services.



Part I: Installing Linux
This guide assumes a server with the following hardware:
  • Two 800MHz Pentium III CPUs
  • 512MB of RAM
  • Two SCSI host adapters (Ultra SCSI 160)
  • Eight SCSI disk drives (2 x 9GB + 6 x 36GB)
  • One 100Base-T Ethernet adapter
  • One 1000Base-T Ethernet adapter

The disks are configured so that each SCSI host adapter is connected to one 9GB disk and three 36GB disks.
Note that although this is far from a "beefy" setup, much of what this guide covers can be accomplished with even less horsepower. All that is necessary for a basic database install is a single CPU, 512MB of RAM, and one disk drive (IDE, SCSI, or FireWire) with at least 6.5GB of free space.

Now, let's walk through the process of installing the Linux operating system on a server. The instructions assume a fresh install of Linux (as opposed to an upgrade), that the server will be dedicated to Oracle, and that no other operating systems or data are on the server.



RHEL4
Oracle Database 10g is certified to run the base release of RHEL4 (Advanced Server and Enterprise Server) without updates. (Free evaluation copies of RHEL4 are available for download.) If you have update CDs, you can use the boot CD from the update instead of the boot CD from the base release to automatically apply all updates during the installation. All updates from Red Hat are supported by Oracle.

The easiest and fastest way to apply the updates for a fresh install of Linux is to perform the install by using the update CDs. If Linux is already installed or you don't have the updates on CDs, they can be applied through RHN. Because this guide is designed for a fresh Linux install, you'll use the update CDs.
1.     Boot the server using the first CD.
o    You may need to change your BIOS settings to allow booting from the CD.
2.     The boot screen appears with the boot: prompt at the bottom of the screen.
o    Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
o    The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
3.     Language Selection
o    Accept the default.
4.     Keyboard Configuration
o    Accept the default.
5.     Welcome Screen
o    Click on Next.
6.     Disk Partitioning Setup
o    A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.
(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)
This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition—This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

7.     Boot Loader Configuration
o    Accept the default.
8.     Network Configuration
o    It is usually best to configure database servers with a static IP address. To do so, click on Edit .
o    A pop-up window appears. Uncheck the Configure using DHCP box, and enter the IP Address and Netmask for the server. Be sure that Activate on boot is checked, and click on OK .
o    In the Hostname box, select manually and enter the hostname.
o    In the Miscellaneous Settings box, enter the remaining network settings.
9.     Firewall Configuration
o    For the purposes of this walk-through, no firewall is configured. Select No firewall (security administrators, flame away).
10.   Additional Language Support
o    Accept the default.
11.   Time Zone Selection
o    Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.
12.   Set Root Password
o    Enter a password for root, and enter it again to confirm.
13.   Package Installation Defaults
o    Select Customize software packages to be installed.
14.   Package Group Selection
o    Select only the package sets shown here. Leave all others unselected.
o    Desktop
§  X Window System
§  Gnome
§  See comments in the RHES2.1 section regarding choice of GUI.
o    Applications
§  Editors
§  Graphical Internet
o    Servers
§  Do not select anything in this group.
o    Development
§  Development Tools
o    System
§  Administration Tools
o    Red Hat Enterprise Linux
§  Do not select anything in this group.
o    Click on Next to proceed.
15.   Installing Packages
o    Software will be copied to the hard disk and installed. Change disks as prompted.
16.   Congratulations
o    Remove the installation media from the system, and click on Reboot .
17.   The system automatically reboots and presents a new welcome screen.
o    Click on Next.
18.   License Agreement
o    Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
19.   Date and Time
o    Set the Date and Time.
o    If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.
20.   Display
o    Accept the defaults or change as required.
21.   Red Hat Login
o    Enter your Red Hat Network login and password or create a new one.
22.   System User
o    Create an account for yourself.
o    Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.
23.   Additional CDs
o    Click on Next.
24.   Finish Setup
o    Click on Next.
25.   A graphical login screen appears.
26.   Congratulations! Your RHEL4 software is now installed.

Verifying Your Installation

If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g . However, you can take the steps below to verify your installation.
Required kernel version: 2.6.9-5.EL (This is the kernel version shipped with the base release of RHEL4. This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g .)
Check your kernel version by running the following command:
 
uname -r
 
Ex:
# uname -r
2.6.9-5.ELsmp

Other required package versions (or later):
  • gcc-3.4.3-9.EL4
  • make-3.80-5
  • binutils- 2.15.92.0.2-10.EL4
  • openmotif-2.1.30-11
  • setarch-1.6-1
  • compat-db-4.1.25-9

To see which versions of these packages are installed on your system, run the following command as root:
 
rpm -q gcc make binutils openmotif setarch compat-db
 
 
Ex:  
# rpm -q gcc make binutils openmotif setarch compat-db
gcc-3.4.3-9.EL4
make-3.80-5
binutils-2.15.92.0.2-10.EL4
setarch-1.6-1
compat-db-4.1.25-9



RHEL3
Oracle Database 10g is certified to run the base release of Red Hat Enterprise Linux 3 (Advanced Server and Enterprise Server) without updates. If you have update CDs, you can use the boot CD from the update instead of the boot CD from the base release to automatically apply all updates during the installation. All updates from Red Hat are supported by Oracle.
1.     Boot the server using the first CD.
o    You may need to change your BIOS settings to allow booting from the CD.
2.     The boot screen appears with the boot: prompt at the bottom of the screen.
o    Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
o    The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
3.     Language Selection
o    Accept the default.
4.     Keyboard Configuration
o    Accept the default.
5.     Welcome Screen
o    Click on Next.
6.     Mouse Configuration
o    Accept the default.
7.     Installation Type
o    Select Custom.
8.     Disk Partitioning Setup
o    A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.
(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)
This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB (32-bit systems do not support swap files larger than 2GB). If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition— This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This was done purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

9.     Boot Loader Configuration
o    Accept the default.
10.   Network Configuration
o    It is usually best to configure database servers with a static IP address. To do so, click on Edit.
o    A pop-up window appears. Uncheck the Configure using DHCP box, and enter the IP Address and Netmask for the server. Be sure that Activate on boot is checked, and click on OK.
o    In the Hostname box, select manually and enter the hostname.
o    In the Miscellaneous Settings box, enter the remaining network settings.
11.   Firewall Configuration
o    For the purposes of this walk-through, no firewall is configured. Select No firewall.
12.   Additional Language Support
o    Accept the default.
13.   Time Zone Selection
o    Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.
14.   Set Root Password
o    Enter a password for root, and enter it again to confirm.
15.   Package Group Selection
o    Select only the package sets shown here. Leave all others unselected.
o    Desktop
- X Window System
- Gnome
- KDE
- See my comments in the RHES 2.1 section regarding choice of GUI.

o    Applications
- Editors
- Graphical Internet

o    Servers
- Do not select anything in this group.

o    Development
- Development Tools

o    System
- Administration Tools

o    Red Hat Enterprise Linux
- Do not select anything in this group.

o    Miscellaneous
- Legacy Software Development

o    Click on Next to proceed.
16.   About to Install
o    Click on Next.
17.   Installing Packages
o    Software will be copied to the hard disk and installed. Change disks as prompted, and click on Next when the installation is complete.
18.   Graphical Interface (X) Configuration
o    Accept the defaults unless the installer does not recognize your video card. If your video card is not recognized, you will not be able to continue.
19.   Monitor Configuration
o    Accept the default if the installer correctly identifies your monitor. Otherwise, select a compatible monitor from the list.
20.   Customize Graphical Configuration
o    Accept the defaults.
21.   Congratulations
o    Remove the installation media from the system, and click on Next.
22.   The system automatically reboots and presents a new welcome screen.
o    Click on Next.
23.   License Agreement
o    Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
24.   Date and Time
o    Set the Date and Time.
o    If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.
25.   User Account
o    Create an account for yourself.
o    Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.
26.   Red Hat Network
o    If you want to use or activate your Red Hat Network account now, accept the default, click on Next, and follow the product activation instructions that accompanied your Red Hat product.
27.   Additional CDs
o    Click on Next.
28.   Finish Setup
o    Click on Next.
29.   A graphical login screen appears.
30.   Congratulations! Your Linux software is now installed.

Verifying Your Installation
If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g. However, you can take the steps below to verify your installation.

Required kernel version: 2.4.21-4.EL (This is the kernel version shipped with the base release of RHEL3. This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g.)

Check your kernel version by running the following command:
 
uname -r
 
Ex:
# uname -r
2.4.21-4.0.1.ELsmp
Other required package versions (or later):
  • gcc-3.2.3-2
  • make-3.79
  • binutils-2.11
  • openmotif-2.2.2-16
  • setarch-1.3-1
  • compat-gcc-7.3-2.96.122
  • compat-gcc-c++-7.3-2.96.122
  • compat-libstdc++-7.3-2.96.122
  • compat-libstdc++-devel-7.3-2.96.122
  • compat-db-4.0.14.5 (listed in the Oracle 10g Database Installation Guide as required but not needed here)

To see which versions of these packages are installed on your system, run the following command as root:
 
rpm -q gcc make binutils openmotif setarch compat-db compat-gcc \
     compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
 
Ex:
# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc \
>      openmotif compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
gcc-3.2.3-20
make-3.79.1-17
binutils-2.14.90.0.4-26
openmotif-2.2.2-16
setarch-1.3-1
package compat-db is not installed
compat-gcc-7.3-2.96.122
compat-gcc-c++-7.3-2.96.122
compat-libstdc++-7.3-2.96.122
compat-libstdc++-devel-7.3-2.96.122

Note that the compat-db package is not installed. This package is not available from any of the package groups available during installation and must be installed in a separate step. If any of the other package versions on your system are missing or the versions are earlier than those specified above (other than compat-db), you can download and install the updates from the Red Hat Network.

Installing compat-db

Insert CD2 of the original Red Hat Enterprise Linux media. (This package has not been updated as of Update 2 and is found only on the original media.)
The CD mounts automatically.

Run the following command as root:
 
rpm -ivh /mnt/cdrom/RedHat/RPMS/compat-db-4.0.14-5.i386.rpm
 
Ex:
# rpm -ivh /mnt/cdrom/RedHat/RPMS/compat-db-4.0.14-5.i386.rpm
Preparing...         ########################################### [100%]
   1:compat-db       ########################################### [100%]



RHEL2.1
Oracle Database 10g is certified to run on Red Hat Enterprise Linux 2.1 (Advanced Server and Enterprise Server) with Update 3 or higher. Updates are available from the Red Hat Network (RHN) and can be downloaded as ISO files for creating CDs or as individual package updates.

The easiest and fastest way to apply the updates for a fresh install of Linux is to perform the install by using the update CDs. If Linux is already installed or you don't have the updates on CDs, they can be applied through RHN. Because this guide is designed for a fresh Linux install, you'll use the update CDs.
1.     Boot the server using the first CD in the set of update CDs.
o    You may need to change your BIOS settings to allow booting from the CD.
2.     The boot screen appears with the boot: prompt at the bottom of the screen.
o    Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
o    The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
3.     Language Selection
o    Accept the default.
4.     Keyboard Configuration
o    Accept the default.
5.     Mouse Configuration
o    Accept the default.
6.     Installation Type
o    Accept the default.
7.     Disk Partitioning Setup
o    A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.
(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)
This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition (50MB is the minimum for RHEL 2.1)
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB (32-bit systems do not support swap files larger than 2GB). If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition—This partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This was done purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

8.     Boot Loader Configuration
o    Accept the default.
9.     Boot Loader Password Configuration
o    If you would like to use a password for GRUB, enter it here. For an evaluation system, just leave this unset.
10.   Network Configuration
o    It is usually best to configure database servers with a static IP address. To do so, uncheck Configure using DHCP and enter the network configuration for the server. Be sure you've entered a host name and that Activate on boot is checked.
11.   Firewall Configuration
o    For the purposes of this walk-through, no firewall is configured. Select No firewall (security administrators, flame away).
12.   Additional Language Support
o    Accept the default.
13.   Time Zone Selection
o    Choose the time settings that are appropriate for your area. Setting the system clock to UTC is usually a good practice for servers. To do so, click on System clock uses UTC.
14.   Account Configuration
o    Choose a password for root, and enter it in the fields provided. Create an account for yourself. (Do not create the oracle account at this time; that happens later.)
15.   Package Group Selection
o    Choose either Gnome of KDE (or both) of the graphical user interfaces (Gnome being the default). Note: Both GUIs are very popular, with Gnome being more prevalent in the U.S. I personally prefer KDE, because the terminal emulator provides for easy cut and paste and offers the ability to duplicate input to multiple connections (this saves typing when you are configuring RAC on multiple nodes, for example).
o    Select Software Development
16.   Unresolved Dependencies
o    If you see this screen, simply select Install packages to satisfy dependencies (the default) and proceed.
17.   Graphical Interface (X) Configuration
o    Accept the defaults unless the installer does not recognize your video card. If your video card is not recognized, you will not be able to continue.
18.   Preparing to install
o    Click on Next
19.   Installing packages
o    Software will be copied to the hard disk and installed. Change disks as prompted, and click on Next when the installation is complete.
20.   Boot disk creation
o    Create a boot disk if you like, or select Skip boot disk creation.
21.   Monitor Configuration
o    Accept the default if the installer correctly identifies your monitor. Otherwise, select a compatible monitor from the list.
22.   Congratulations
o    Remove the installation media from the system, and click on Next.

The system automatically reboots and presents a graphical login screen. If you have performed the installation with the base product CDs rather than the update CDs, you will have to apply the updates through RHN before proceeding.

Verifying Your Installation
If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g. However, you can take the steps below to verify your installation.

Required kernel version: 2.4.9-e.25 (or later)

Check your kernel version by running the following command:
 
uname -r
 
Ex:
# uname -r
2.4.9-e.27smp
Other required package versions (or later):
  • gcc-2.96-124
  • make-3.79
  • binutils-2.11
  • openmotif-2.1.30-11
  • glibc-2.2.4-31

To see which versions of these packages are installed on your system, run the following command:
 
rpm -q gcc make binutils openmotif glibc
 
Ex:  
# rpm -q gcc make binutils openmotif glibc
gcc-2.96-118.7.2
make-3.79.1-8
binutils-2.11.90.0.8-12
openmotif-2.1.30-11
glibc-2.2.4-32.8

If any of the package versions on your system are missing or the versions are earlier than those specified above, you can download and install the updates from the Red Hat Network.



SLES9
Oracle Database 10g is certified to run on the base release of SLES9. Service Packs and package updates are available from Novell, either on CDs or online via its support portal. In this guide, we will install on the SLES9 base release.
1.     Boot the server, using the SLES9 CD.
o    You may need to change your BIOS settings to allow booting from the CD.
2.     The Novell SLES installation screen appears.
o    Select Installation.
o    The installer scans your hardware and presents the YaST interface.
3.     Language Selection
o    Accept the license agreement.
o    Accept the default, English (US).
4.     Installation Settings
o    Select New Installation.
5.     Partitioning
o    A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.
(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)
This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB. (Thirty-two-bit systems do not support swap files larger than 2GB.) If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition—this partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This approach is purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

6.     Software
o    Click on the link for Software.
o    The Software Selection screen appears.
o    Click on Detailed Selection.
o    The left-hand window displays a list of software selections. Click on the box next to each selection to select/deselect it.
o    Select the following software (this is the recommended set; all others should be deselected):
- Basis Runtime System
- YaST
- Linux Tools
- Help & Support Documentation
- Graphical Base System
- KDE Desktop Environment
- C/C++ Compiler and Tools

o    It is recommended that the following items not be installed, as they may conflict with Oracle products providing the same service:
- Simple Webserver
- Authentication Server (NIS, LDAP, Kerberos)

7.     Time Zone
o    Set your time zone.
8.     Click on Accept.
9.     A warning box appears. Click on Yes, install when ready to proceed.
10.   Change CDs as prompted by the installer.
11.   Confirm Hardware Detection
o    Network Cards – Click on OK.
12.   Password for "root." the system administrator.
o    Enter the root password and repeat to confirm.
13.   Configure your network interface(s), and click on Next when ready to proceed.
o    Static IP addresses are recommended for servers.
o    There is no need to configure printers, modems, ISDN adapters, or sound in order to build a database.
14.   Test Internet Connection
o    There is no need to connect to the Internet to download release notes or Linux updates. Select No, Skip This Test.
15.   Service Configuration
o    There is no need to configure CA Management or OpenLDAP Server. Select Skip Configuration.
16.   User Authentication Method
o    Select Local(/etc/passwd).
17.   Add a New Local User
o    Create an account for yourself. Do not create the oracle account at this time; we'll do that later.
18.   Release Notes
o    Click on Next
19.   Hardware Configuration
o    Confirm Hardware Detection – Graphics Cards – click on Continue.
o    There is no need to configure sound cards for a database – click on Skip.
o    If the graphics card and monitor have been successfully detected, click on Next. Otherwise, click on the Graphics Cards link and enter the correct information.
20.   Installation Completed
o    Click on Finish.
21.   Congratulations! Your SLES9 software is now installed.

Verifying Your Installation

If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g

However, you can take the steps below to verify your installation.
Required kernel version: 2.6.5-7.5 (or later)

Check your kernel version by running the following command:
 
uname -r
 
Ex:
# uname -r
2.6.5-7.97-smp
Other required package versions (or later):
  • gcc-3.3.3-43
  • gcc-c++-3.3.3-43
  • glibc-2.3.3-98
  • libaio-0.3.98-18
  • libaio-devel-0.3.98-18
  • make-3.80
  • openmotif-2.2.2-519.2

To see which versions of these packages are installed on your system, run the following command as root:
 
 
rpm -q gcc gcc-c++ glibc libaio libaio-devel make openmotif-libs
 
Ex:  
# rpm -q gcc gcc-c++ glibc libaio libaio-devel make openmotif-libs
gcc-3.3.3-43.24
gcc-c++-3.3.3-43.24
glibc-2.3.3-98.28
libaio-0.3.98-18.3
libaio-devel-0.3.98-18.3
make-3.80-184.1
openmotif-libs-2.2.2-519.1

If any of the package versions on your system are missing or the versions are earlier than those specified above, you can download and install the updates from the Novell SUSE Linux Portal.



SLES8
Oracle Database 10g is certified to run on Novell SUSE Linux Enterprise Server (SLES) 8 and SLES-9. Service Packs and package updates are available from Novell, either on CDs or online via its support portal. In this guide, we will install on SLES8 with Service Pack 3 from CDs.
1.     Boot the server, using the SLES8 CD.
o    You may need to change your BIOS settings to allow booting from the CD.
2.     The SUSE Linux Enterprise Server installation screen appears.
o    Select Installation.
o    The installer scans your hardware and presents the YaST interface.
3.     Language Selection
o    Accept the license agreement.
o    Accept the default, English (US).
4.     Installation Settings
o    Select New Installation.
5.     Partitioning
o    A thorough treatment of disk partitioning is beyond the scope of this guide, which assumes that you are familiar with disk partitioning methods.
(WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data!)
This guide uses the following partitioning scheme, with ext3 for each filesystem:

The 9GB disk on the first controller (/dev/sda) will hold all Linux and Oracle software and contains the following partitions:
- 100MB /boot partition
-1,500MB swap partition—Set this to at least twice the amount of RAM in the system but to no more than 2GB (32-bit systems do not support swap files larger than 2GB). If you need more than 2GB of swap space, create multiple swap partitions.
-7,150MB root partition—this partition will be used for everything, including /usr, /tmp, /var, /opt, /home, and more. This was done purely to simplify installation for the purposes of this guide. A more robust partitioning scheme would separate these directories onto separate filesystems.

6.     Software
o    Click on the link for Software.
o    The Software Selection screen appears.
o    Click on Detailed Selection.
o    The left-hand window displays a list of software selections. Click on the box next to each selection to select/deselect it.
o    Select the following software (this is the recommended set; all others should be deselected):
- C/C++ Compiler and Tools
- KDE (or Gnome)
- LSB Runtime Environment
- Help & Support Documentation
- Graphical Base System
- YaST2 config modules
- SLES Administration Tools

o    It is recommended that the following items not be installed, as they may conflict with Oracle products providing the same service:
- Simple Webserver
- Authentication Server (NIS, LDAP, Kerberos)

7.     Time Zone
o    Set your time zone.
8.     Click on Accept.
9.     A warning box appears. Click on Yes, install when ready to proceed.
10.   Change CDs as prompted by the installer.
11.   When the software has been installed, a window will appear advising that the base system has been successfully installed.
o    Remove the installation CD, and click on OK.
12.   The system reboots.
13.   Enter a password for root, and repeat to confirm.
14.   Create an account for yourself. Do not create the oracle account at this time; we'll do that later.
15.   Desktop Settings
o    Accept the default.
16.   A warning window appears regarding automatic detection of local printers.
o    Click on Skip detection.
17.   Configure your network interface(s), and click on Next when ready to proceed.
o    Static IP addresses are recommended for servers.
o    There is no need to configure printers, modems, ISDN adapters, or sound in order to build a database.
18.   A graphical login screen appears.
19.   Now you need to install Service Pack 3. Log in as yourself.
20.   Insert the update CD, and click on Patch CD Update.
21.   Start YaST2, SUSE's system administration tool.
o    Select SUSE > System > YaST2. (SUSE is the round green button with the smiling lizard face in profile at the bottom left of the screen. It means "Start.")
o    A window appears, prompting for the root password. Enter the password, and click on OK.
o    The YaST Control Center appears.
22.   The YaST Online Update window appears.
o    Accept the defaults, and click on Next.
23.   A window appears with a list of patch updates.
o    YaST needs to update itself first before updating the rest of the system. The needed packages are already selected. Do not select any other packages at this point.
o    Click on Accept.
24.   A window appears advising to restart the online update.
o    Click on OK.
25.   A window appears, stating that the installation was successful.
o    Click on OK.
26.   In the YaST Online Update window, click on Finish.
27.   In the YaST Control Center window, click on Close.
28.   Repeat steps 21 and 22.
29.   A window appears with a list of patch updates.
o    Click on Accept, to accept the defaults.
o    Small pop-up windows may appear with various advisories, such as "Make sure you update sendmail."  Click on OK to dismiss them.
o    This step takes a while. Hover your cursor over the Next button. If the update is still running, a clock icon will appear.
30.   A window appears, reporting that the installation was successful.
o    Click on OK.
31.   On the YaST Online Update screen, click on Next.
o    The installer writes the system configuration.
32.   In the YaST Control Center, click on Close.
33.   Log out.
o    SUSE > Logout.
34.   Remove the update CD.
35.   Reboot the system.
o    On the graphical login screen, click on Menu.
o    Select Shutdown.
o    Select Restart computer.
o    Enter the root password.
o    Click on OK.
36.   Congratulations! Your Linux software is now installed.

Verifying Your Installation
If you've completed the steps above, you should have all the packages and updates required for Oracle Database 10g. However, you can take the steps below to verify your installation.

Required kernel version: 2.4.21-138 (or later)

Check your kernel version by running the following command:
 
uname -r
 
Ex:
# uname -r
k_smp-2.4.21-138
Other required package versions (or later):
  • gcc-3.2.2-38
  • make-3.79
  • binutils-2.12
  • openmotif-2.2.2-124

To see which versions of these packages are installed on your system, run the following command as root:
 
rpm -q gcc make binutils openmotif
 
Ex:  
# rpm rpm -q gcc make binutils openmotif
gcc-3.2.2-38
make-3.79.1-407
binutils-2.12.90.0.15-50
openmotif-2.2.2-124

If any of the package versions on your system are missing or the versions are earlier than those specified above, you can download and install the updates from the SUSE Linux Portal.



Part II: Configuring Linux for Oracle
Now that the Linux software is installed, you need to configure it for Oracle. This section walks through the steps required to configure Linux for Oracle Database 10g.

Verifying System Requirements
To verify that your system meets the minimum requirements for an Oracle 10g database, log in as root and run the commands below.

To check the amount of RAM and swap space available, run this:
 
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
 
Ex:
# grep MemTotal /proc/meminfo
MemTotal:       512236 kB
# grep SwapTotal /proc/meminfo
SwapTotal:     1574360 kB

The minimum RAM required is 512MB, and the minimum required swap space is 1GB. Swap space should be twice the amount of RAM for systems with 2GB of RAM or less and between one and two times the amount of RAM for systems with more than 2GB.

You also need 2.5GB of available disk space for the Oracle Database 10g software and another 1.2GB for the database. The /tmp directory needs at least 400MB of free space. To check the available disk space on your system, run the following command:
 
df -h
 
Ex:
# df -h
Filesystem        Size  Used Avail Use% Mounted on
/dev/sda3         6.8G  1.3G  5.2G  20% /
/dev/sda1         99M   17M   77M  18% /boot

The example shows that the /tmp directory does not have its own filesystem. (It's part of the root filesystem for this guide.) With 5.2 GB available, the root filesystem has just enough space for the installation (2.5 + 1.2 + 0.4 = 4.1GB) with a little room left over.

Create the Oracle Groups and User Account
Next, create the Linux groups and user account that will be used to install and maintain the Oracle Database 10g software. The user account will be called oracle, and the groups will be oinstall and dba. Execute the following commands as root:
 
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
 id oracle
 
Ex:
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -m -g oinstall -G dba oracle
# id oracle
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

Set the password on the oracle account:
 
passwd oracle
 
Ex:
# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Create Directories
Now create directories to store the Oracle 10g software and the database files. This guide adheres to the Optimal Flexible Architecture (OFA) for the naming conventions used in creating the directory structure. For more information on OFA standards, see Appendix D of the Oracle Database 10g Installation Guide for UNIX Systems.

The following assumes that the directories are being created in the root filesystem. This is done for the sake of simplicity and is not recommended as a general practice. These directories would normally be created as separate filesystems.
Issue the following commands as root:
 
mkdir -p /u01/app/oracle
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01/app/oracle /u02/oradata
chmod -R 775 /u01/app/oracle /u02/oradata
 
Ex:
# mkdir -p /u01/app/oracle
# mkdir -p /u02/oradata
# chown -R oracle:oinstall /u01/app/oracle /u02/oradata
# chmod -R 775 /u01/app/oracle /u02/oradata

Configuring the Linux Kernel Parameters
The Linux kernel is a wonderful thing. Unlike most other *NIX systems, Linux allows modification of most kernel parameters while the system is up and running. There's no need to reboot the system after making kernel parameter changes. Oracle Database 10g requires the kernel parameter settings shown below. The values given are minimums, so if your system uses a larger value, don't change it.
 
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

If you're following along and have just installed Linux, the kernel parameters will all be at their default values and you can just cut and paste the following commands while logged in as root.
 
cat >> /etc/sysctl.conf <
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
EOF
/sbin/sysctl -p
 
Ex:
# cat >> /etc/sysctl.conf <
> kernel.shmall = 2097152
> kernel.shmmax = 2147483648
> kernel.shmmni = 4096
> kernel.sem = 250 32000 100 128
> fs.file-max = 65536
> net.ipv4.ip_local_port_range = 1024 65000
> EOF
 
# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
kernel.sysrq = 0
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

Run the following commands as root to verify your settings:
 
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep ip_local_port_range
 
Ex:
# /sbin/sysctl -a | grep shm
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shm-use-bigpages = 0
# /sbin/sysctl -a | grep sem
kernel.sem = 250        32000   100     128
# /sbin/sysctl -a | grep file-max
fs.file-max = 65536
# /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 1024     65000
I
f any of the parameters on your system are set lower than those shown, edit the /etc/sysctl.conf file and add or change the parameters. When you're finished, run the following command to activate the changes:
 
/sbin/sysctl -p

For all Novell SUSE Linux releases, use the following:
                                  /sbin/chkconfig boot.sysctl on

Setting Shell Limits for the oracle User
Oracle recommends setting limits on the number of processes and open files each Linux account may use. To make these changes, cut and paste the following commands as root:
 
cat >> /etc/security/limits.conf <
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
EOF
 
cat >> /etc/pam.d/login <
session    required     /lib/security/pam_limits.so
EOF

For RHEL 2.1 and 3, use the following:
 
cat >> /etc/profile <
if [ \$USER = "oracle" ]; then  
   if [ \$SHELL = "/bin/ksh" ]; then
       ulimit -p 16384
       ulimit -n 65536
   else
       ulimit -u 16384 -n 65536
   fi
   umask 022
fi
EOF
 
cat >> /etc/csh.login <
if ( \$USER == "oracle" ) then
   limit maxproc 16384
   limit descriptors 65536
   umask 022
endif
EOF

For SLES8, use the following:
cat >> /etc/profile.local <
if [ \$USER = "oracle" ]; then  
   if [ \$SHELL = "/bin/ksh" ]; then
       ulimit -p 16384
       ulimit -n 65536
   else
       ulimit -u 16384 -n 65536
   fi
   umask 022
fi
EOF
 
cat >> /etc/csh.login.local <
if ( \$USER == "oracle" ) then
   limit maxproc 16384
   limit descriptors 65536
   umask 022
endif
EOF

Avoid the Bug! (Novell SUSE Linux releases only)
There is a bug in the installation of Oracle Enterprise Manager 10g on SLES8 and SLES9 that causes it to fail due to required ports that are reserved in /etc/services. The OEM DBConsole needs port 1830, and in SUSE environments this port is already reserved in /etc/services. This bug is documented in MetaLink as bug# 3513603.

To avoid problems during the installation, log in as root and comment out the lines for ports 1830 through 1849 in the /etc/services file prior to installing the Oracle Database 10g software. (Note: It's probably a good idea to reboot the server at this point, to ensure that the above changes are in effect.)

Environment Variables for the oracle User

Several environment variables should or must be set in order to use Oracle products. For the database server, the recommended environment variables are:

ORACLE_BASE
ORACLE_HOME
ORACLE_SID
PATH


If you have more than one Oracle product or database on the same server, the ORACLE_HOME, ORACLE_SID, and PATH variables may change. The ORACLE_BASE variable should not change and can be set in your login profile if you want. Oracle provides a utility, called oraenv, for setting the remaining variables.
Log in as oracle and add ORACLE_BASE to your login profile by adding the following line to your .bash_profile or .profile (bash or ksh):
 
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
or add this line to your .login (csh):
 
setenv ORACLE_BASE /u01/app/oracle

This change will take effect the next time you log in to the oracle account. To make the changes active for the current session, simply run the command from the command line.



Part III: Installing Oracle
Oracle Database 10g can be downloaded from OTN. Oracle offers a development and testing license free of charge. However, no support is provided and the license does not permit production use. A full description of the license agreement is available on OTN.

The easiest way to make the Oracle Database 10g distribution media available on your server is to download them directly to the server.

Use the graphical login to log in as oracle.

Create a directory to contain the Oracle Database 10g distribution:
 
mkdir 10g_db

To download Oracle Database 10g from OTN, point your browser (Mozilla works well) to http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/linuxsoft.html. Fill out the Eligibility Export Restrictions page, and read the OTN License agreement. If you agree with the restrictions and the license agreement, click on I Accept.
Click on the ship.db.cpio.gz link, and save the file in the directory you created for this purpose (10g_db)—if you have not already logged in to OTN, you may be prompted to do so at this point.
Unzip and extract the file:
 
cd 10g_db
gunzip ship.db.cpio.gz
cpio -idmv < ship.db.cpio

Install the Software

Log in using the oracle account.
Specify the database name (ORACLE_SID). This is usually five characters or fewer. Use demo1 for this installation.
Set the environment variables:
  • Bourne and Korn shells
·         ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
·         ORACLE_SID=demo1; export ORACLE_SID
RHEL4 and SLES9 Only:
LD_ASSUME_KERNEL=2.4.19; export LD_ASSUME_KERNEL
  • C shell
·         setenv ORACLE_BASE /u01/app/oracle
·         setenv ORACLE_SID demo1
RHEL4 and SLES9 Only:
setenv LD_ASSUME_KERNEL 2.4.19

For RHEL4 Only: The Oracle Universal Installer will check the operating system release to verify that it is a supported release. As of Oracle Database 10g 10.1.0.3, the installer does not recognize RHEL4 as a supported release. The workaround is to follow the steps below prior to running runInstaller.
 
cp /etc/redhat-release /etc/redhat-release.orig
cat > /etc/redhat-release << EOF
Red Hat Enterprise Linux AS release 3 (Taroon)
EOF

Change directory to the location where you extracted the Oracle Database 10g software.
 
Ex:
$ cd $HOME/10g_db

Change directory to Disk1.
 
Ex:
$ cd Disk1

Start the Oracle Universal Installer.
 
$ ./runInstaller
1.     Welcome
o    Click on Next.
2.     Specify Inventory Directory and Credentials
o    If you've been following the steps in this guide, the defaults will be correct. If not, edit the path to the inventory directory to point to the correct directory.
o    The operating system group name should be oinstall.
3.     If this is the first time Oracle has been installed on this machine, you will get a pop-up window indicating that the orainstRoot.sh script needs to be run as root. Log in as root, cd to the directory specified in the window, and execute the script before proceeding.
4.     Specify File Locations
o    If you've been following the steps in this guide, the defaults will be correct. Otherwise, make sure that the Source path and the Destination path is correct before proceeding.
5.     Select Installation Type
o    Accept the default of Enterprise Edition.
6.     Product-specific Prerequisite Checks
o    If you've been following the steps in this guide, all the checks should pass without difficulty. If one or more checks fail, correct the problem before proceeding. (RHEL4 only: If the checks for binutils, gcc, and openmotif fail, ignore the warnings and proceed. SLES9 only: If the check for openmotif fails, ignore the warning and proceed.)
7.     Select Database Configuration
o    Accept the defaults of Create a starter database and General Purpose.
8.     Specify Database Configuration Options
o    Enter the global database name for your database. This should include ORACLE_SID followed by the domain name for the server (for example, demo1.orademo.org, where demo1 is the ORACLE_SID and orademo.org is the domain name).
o    The SID box fills in automatically when you enter the Global Database Name.
o    Accept the default Database Character Set.
o    Select Create database with sample schemas.
9.     Select Database Management Option
o    Select Use Database Control for Database Management.
10.   Specify Database File Storage Option
o    Select File System, and enter the pathname to be used for the database files (/u02/oradata, in this case).
11.   Specify Backup and Recovery Options
o    Select Do not enable Automated backups.
12.   Specify Database Schema Passwords
o    Select Use the same password for all the accounts.
o    Choose a password and enter it twice to confirm.
13.   Summary
o    A summary of the products being installed is presented.
o    Click on Install.
14.   Install
o    This screen progresses through several stages as the Oracle software is being installed and linked.
o    A pop-up window appears at the end of the installation process, displaying configuration information. Make note of the Enterprise Manager URL and click OK to dismiss the window.
o    A "Setup Privileges" pop-up window appears, indicating that a configuration script needs to be run as root. Log in as root, cd to the directory indicated in the window, and execute the root.sh script. The script prompts for the location of the local bin directory. Accept the default by pressing Enter. When the script completes, return to the Setup Privileges window and click on OK. (See below.)

15.   End of Installation
o    Make note of the URLs presented in the summary, and click on Exit when ready.
16.   Congratulations! Your new Oracle 10g database is up and ready for use.




Part IV: Configuring Storage

The database we created in Part III used a single filesystem (/u02/oradata) for disk storage. However, there are several ways to configure storage for an Oracle database.

Part IV explores other methods of configuring disk storage for this database. In particular, it describes creating additional filesystems and using Automatic Storage Management (ASM). Use of raw devices and Oracle Cluster File System (OCFS) is deferred until another guide in this series, which covers the creation of a cluster database using Oracle Real Application Clusters (RAC).

Filesystems
Filesystems are the most widely used means of storing data file, redo logs, and control files for Oracle databases. Filesystems are easy to implement and require no third-party software to administer.

In most cases, filesystems are created during the initial installation of Linux. However, there are times when a new filesystem must be created after the initial installation, such as when a new disk drive is being installed.
This section describes building a new filesystem and using it in an Oracle database. Unless otherwise noted, all commands must be run as root.

Partition the Disk


You must have an empty disk partition to create the filesystem. If you already have an empty disk partition available, skip to the next step.

The following shows an example of creating a new partition for a Linux filesystem. (WARNING: Improperly partitioning a disk is one of the surest and fastest ways to wipe out everything on your hard disk. If you are unsure how to proceed, stop and get help, or you will risk losing data.)

This example uses /dev/sdb (an empty SCSI disk with no existing partitions) to create a single partition for the entire disk (36 GB).
 
Ex:
# fdisk /dev/sdb
 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
 
 
The number of cylinders for this disk is set to 4427.
 
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
 
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
 
Command (m for help): p
 
Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4427, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4427, default 4427):
Using default value 4427
 
Command (m for help): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
 
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

Now verify the new partition:
 
Ex:
# fdisk /dev/sdb
 
The number of cylinders for this disk is set to 4427.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
 
Command (m for help): p
 
Disk /dev/sdb: 255 heads, 63 sectors, 4427 cylinders
Units = cylinders of 16065 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/sdb1             1      4427  35559846   83  Linux
 
Command (m for help): q

Create the Filesystem

Use ext3 to create this new filesystem. Other filesystems work just as well, but ext3 offers the fastest recovery time in the event of a system crash.
 
Ex:
# mke2fs -j /dev/sdb1
 
mke2fs 1.26 (3-Feb-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
4447744 inodes, 8889961 blocks
444498 blocks (5.00%) reserved for the super user
First data block=0
272 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
        2654208, 4096000, 7962624
 
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 23 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Create the Mount Point

A filesystem must have a mount point, which is simply an empty directory where the new filesystem "attaches" to the system's directory tree. Mount points should be given names consistent with the Oracle Flexible Architecture (OFA) standard. For more information on OFA standards, see Appendix D of the Oracle 10g Database Installation Guide.
Because you have already used the /u01 and /u02 directory names in Part I, use /u03 for this example.
 
Ex:
# mkdir /u03

Add the New Filesystem to /etc/fstab

So that the new filesystem will be mounted automatically when the system boots, you need to add a line to the /etc/fstab file that describes the new filesystem and where to mount it. Add a line similar to the one below to /etc/fstab, using a text editor.
 
/dev/sdb1         /u03           ext3    defaults       1 1

Mount the New Filesystem

Mounting the filesystem makes it available for use. Until the filesystem is mounted, files cannot be stored in it. Use the following commands to mount the filesystem and verify that it is available.
 
mount /u03
df -h /u03
 
Ex:
# mount /u03
# df -h /u03
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             33G   33M  31G   1%   /u03

Create Oracle Directories and Set Permissions

Now you create a directory to store your Oracle files. The directory name used in the example follows the OFA standard naming convention for a database with ORACLE_SID=demo1.
 
mkdir -p /u03/oradata/demo1
chown -R oracle:oinstall /u03/oradata
chmod -R 775 /u03/oradata

Create a New Tablespace in the New Filesystem

The new filesystem is ready for use. Next you create a new tablespace in the filesystem to store your database objects. Connect to the database as the SYSTEM user, and execute the CREATE TABLESPACE statement, specifying the data file in the new filesystem.
 
Ex:
$ sqlplus
 
SQL*Plus: Release 10.1.0.2.0 - Production on Sun Jun 13 15:01:08 2004
 
Copyright (c) 1982, 2004, Oracle.  All rights reserved.
 
Enter user-name: system
Enter password:
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
 
SQL> create tablespace data1
  2  datafile '/u03/oradata/demo1/data1_01.dbf' size 100M
  3  extent management local
  4  segment space management auto;
 
Tablespace created.

Now you can use the new tablespace to store database objects such as tables and indexes.
 
Ex:
SQL> create table demotab (id number(5) not null primary key,
  2  name varchar2(50) not null,
  3  amount number(9,2))
  4  tablespace data1;
  
Table created.
 



Automatic Storage Management (ASM)

I've saved the best for last.  ASM is a fantastic new feature in Oracle Database 10g that provides the services of a filesystem, logical volume manager, and software RAID in a platform-independent manner. ASM can stripe and mirror your disks, allow disks to be added or removed while the database is under load, and automatically balance I/O to remove "hot spots." It also supports direct and asynchronous I/O and implements the Oracle Data Manager API (simplified I/O system call interface) introduced in Oracle9i.
ASM is not a general-purpose filesystem and can be used only for Oracle data files, redo logs, and control files. Files in ASM can be created and named automatically by the database (by use of the Oracle Managed Files feature) or manually by the DBA. Because the files stored in ASM are not accessible to the operating system, the only way to perform backup and recovery operations on databases that use ASM files is through Recovery Manager (RMAN).

ASM is implemented as a separate Oracle instance that must be up if other databases are to be able to access it. On Linux the OCSSD service (installed by default by the Oracle Universal Installer) must be running to allow use of ASM. Memory requirements for ASM are light: only 64 MB for most systems.

Installing ASM

On Linux platforms, ASM can use raw devices or devices managed via the ASMLib interface. Oracle recommends ASMLib over raw devices, for ease-of-use and performance reasons. ASMLib is available for free download from OTN. This section walks through the process of configuring a simple ASM instance by using ASMLib and building a database that uses ASM for disk storage.

Determine Which Version of ASMLib You Need

ASMLib is delivered as a set of three Linux packages:
  • oracleasmlib - the ASM libraries
  • oracleasm-support - utilities needed to administer ASMLib
  • oracleasm - a kernel module for the ASM library

Each Linux distribution has its own set of ASMLib packages, and within each distribution, each kernel version has a corresponding oracleasm package. The following paragraphs describe how to determine which set of packages you need.

First, determine which kernel you are using by logging in as root and running the following command:
 
uname -rm
 
Ex:
# uname -rm
2.4.9-e.27smp i686

The example shows that this is a 2.4.9 kernel for an SMP (multiprocessor) box using Intel i686 CPUs.
Use this information to find the correct ASMLib packages on OTN:

1.     Point your Web browser to http://www.oracle.com/technology/tech/linux/asmlib
2.     Select the link for your version of Linux.
3.     Download the oracleasmlib and oracleasm-support packages for your version of Linux
4.     Download the oracleasm package corresponding to your kernel. In the example above, the oracleasm-2.4.9-e-smp-1.0.0-1.i686.rpm package is downloaded.
Next, install the packages by executing the following command as root:
rpm -Uvh oracleasm-kernel_version-asmlib_version.cpu_type.rpm \
oracleasmlib-asmlib_version.cpu_type.rpm \
oracleasm-support-asmlib_version.cpu_type.rpm
 
Ex:
# rpm -Uvh \
> oracleasm-2.4.9-e-smp-1.0.0-1.i686.rpm \
> oracleasmlib-1.0.0-1.i386.rpm \
> oracleasm-support-1.0.0-1.i386.rpm
Preparing...                #################################### [100%]
   1:oracleasm-support      #################################### [ 33%]
   2:oracleasm-2.4.9-e-smp  #################################### [ 66%]
Linking module oracleasm.o into the module path [  OK  ]
   3:oracleasmlib           #################################### [100%]

Configuring ASMLib

Before using ASMLib, you must run a configuration script to prepare the driver. Run the following command as root, and answer the prompts as shown in the example below.
 
# /etc/init.d/oracleasm configure
 
Configuring the Oracle ASM library driver.
 
This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting  without typing an
answer will keep that current value.  Ctrl-C will abort.
 
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration            [  OK  ]
Creating /dev/oracleasm mount point                        [  OK  ]
Loading module "oracleasm"                                 [  OK  ]
Mounting ASMlib driver filesystem                          [  OK  ]
Scanning system for ASM disks                              [  OK  ]
Now enable the ASMLib driver as shown below.
# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration            [  OK  ]
Scanning system for ASM disks                              [  OK  ]

Configuring Disks for ASM

Next you tell the ASM driver which disks you want it to use. Note that these are bare disks with nothing on them (not even a partition). It is possible to use disk partitions with ASM, but it isn't recommended.

You mark disks for use by ASMLib by running the following command as root:
 
/etc/init.d/oracleasm createdisk DISK_NAME device_name

(Tip: Enter the DISK_NAME in UPPERCASE letters. There is a bug in the current release that prevents the disks from being visible to the ASM instance if lowercase is used.)
 
Ex:
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb
Marking disk "/dev/sdb" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc
Marking disk "/dev/sdc" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd
Marking disk "/dev/sdd" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL4 /dev/sdf
Marking disk "/dev/sdf" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL5 /dev/sdg
Marking disk "/dev/sdg" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL6 /dev/sdh
Marking disk "/dev/sdh" as an ASM disk                     [  OK  ]
The following example shows how to list all the disks marked for use by ASMLib.
# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
VOL6

Now that ASMLib is installed and the disks are marked for use, you can create an ASM instance and build a database that uses ASM for disk storage. This is easiest to accomplish with the Data Base Configuration Assistant (DBCA).

Log in as oracle and start DBCA:
 
$ dbca
1.     Welcome
o    Click on Next.
2.     Operations
o    Select Create a Database.
3.     Database Templates
o    Select General Purpose.
4.     Database Identification
o    Enter the Global Database Name.
5.     Management Options
o    Select Configure the Database with Enterprise Manager.
o    Select Use Database Control for Database Management.
6.     Database Credentials
o    Select Use Same Password for All Accounts.
o    Enter the password and confirm.
7.     Storage Options
o    Select Automatic Storage Management (ASM).
8.     Create ASM Instance
o    Enter a password for the ASM instance, and confirm.
9.     A pop-up window appears, advising that DBCA will now create and start the ASM instance.
o    Click on OK.
10.   A pop-up window displaying a gearbox appears while the ASM instance is being created.
11.   ASM Disk Groups
o    The window shows no available disk groups, because this is a new ASM instance and you haven't created any yet.
o    Click on Create New.
12.   Create Disk Group
o    Disk Group Name
- Enter a name, such as DATA1, for the disk group.

o    Redundancy
- High mirrors data twice.
- Normal mirrors data once.
- External does not mirror data within ASM. This is typically used if an external RAID array is providing redundancy.

o    Select Member Disks
- You have to tell ASM where to look for your ASMLib disks manually, so click on Change Disk Discovery Path
-
A pop-up window appears for entry of the Disk Discovery Path.  Change the Disk Discovery Path to 'ORCL:*' as shown below.
- Click on OK to continue.


o    You are returned to the Select Member Disks window.  All your ASMLib disks should now appear in the window.
Select the disks for the disk group by clicking on the box at the beginning of the line. Click on OK when finished.


13.   ASM Disk Groups
o    You are returned to the ASM Disk Groups window. This time, the disk group you created in the previous step appears.
o    Select this disk group by clicking on the box at the beginning of the line. (Use a single disk group in this case.)
o    Click on Next.
14.   Database File Locations
o    Select Use Oracle-Managed Files.
o    Make sure the Database Area is set to the disk group you created. It has a leading plus sign—+DATA1, for example.
15.   Recovery Configuration
o    Select Specify Flash Recovery Area.
- Flash Recovery Area—Enter the ASM disk group to be used for Flash Recovery.
- Flash Recovery Area Size—Accept the default, 2048.

o    Select Enable Archiving if you want to use archivelog mode. For an evaluation database, you can leave this unchecked.
16.   Database Content
o    Select Sample Schemas.
o    You are not using Custom Scripts, so click on Next.
17.   Initialization Parameters
o    Accept the defaults and click on Next.
18.   Database Storage
o    Accept the defaults and click on Next.
19.   Creation Options
o    Select Create Database (the default) and click on Finish.
20.   Confirmation
o    Click on OK when you've finished reviewing Database Details.
21.   DBCA displays a list of actions and a progress bar. Database creation can take from several minutes to several hours, depending on your hardware.
22.   When the database creation is complete, a window appears, displaying a summary. Note the Enterprise Manager URL, and click on Exit.




Conclusion
Now that your database is up and running, you can begin exploring the many new features offered in Oracle Database 10g. A great place to start is Oracle Enterprise Manager, which has been completely re-written with a crisp new Web-based interface. If you're unsure where to begin, the Oracle Database 10g Concepts Guide and the 2-Day DBA Guide will help familiarize you with your new database. OTN also has a number of guides designed to help you get the most out of 10g. One of my favorites is the series by Arup Nanda, "Oracle Database 10g: The Top 20 Features for DBAs."



Appendix

Accessing the Database with SQL*Plus

Log into Linux as oracle. Set the environment.

Set the Oracle environment variables:
 
$ export ORACLE_BASE=/u01/app/oracle
$ export ORACLE_SID=demo1
$ export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1
$ export PATH=$PATH:$ORACLE_HOME/bin

Run SQL*Plus:
 
$ sqlplus
 
SQL*Plus: Release 10.1.0.2.0 - Production on Sat Jun 5 16:59:21 2004
 
Copyright (c) 1982, 2004, Oracle.  All rights reserved.
 
Enter user-name: / as sysdba
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
 
SQL> 
Using Oracle Enterprise Manager 10g Database Control

In a Web browser, connect to the URL provided during the installation.
Ex:
 

http://ds1.orademo.org:5500/em (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

User Name: SYS
Password:
Connect As: SYSDBA


Click on

Welcome to the wonderful world of Oracle Enterprise Manager 10g Database Control!
Starting and Stopping Oracle Enterprise Manager Database Control:
$ emctl start dbconsole
$ emctl stop dbconsole
Accessing the Database Using iSQL*Plus
iSQL*Plus is a Web-based version of the venerable SQL*Plus interactive tool for accessing databases. To use iSQL*Plus, click on the iSQL*Plus link in the Related Links section of the OEM console or point your browser to the iSQL*Plus URL provided during installation.
Ex:
http://ds1.orademo.org:5560/isqlplus (You may have to use the IP address instead of the host name if your database server isn’t in your DNS.)

User Name: SYSTEM
Password:

Click on .
Enter SQL commands in the Workspace box, and click on Execute.

Starting and Stopping iSQL*Plus:
 
$ isqlplusctl start
$ isqlplusctl stop

Starting and Stopping the Listener:

The listener accepts connection requests from clients and creates connections to the database once the credentials have been authenticated. Before you can use OEM or iSQL*Plus, the listener must be up.
 
$ lsnrctl start
$ lsnrctl stop

Starting and Stopping the Database:

The easiest way to start and stop the database is from the OEM Console. To do that from the command line, use SQL*Plus while logged in as oracle, as follows:

Startup:
 
$ sqlplus
 
SQL*Plus: Release 10.1.0.2.0 - Production on Sun Jun 13 22:27:48 2004
 
Copyright (c) 1982, 2004, Oracle.  All rights reserved.
 
Enter user-name: / as sysdba
Connected to an idle instance.
 
SQL> startup
ORACLE instance started.
 
Total System Global Area  188743680 bytes
Fixed Size                   778036 bytes
Variable Size             162275532 bytes
Database Buffers           25165824 bytes
Redo Buffers                 524288 bytes
Database mounted.
Database opened.
SQL> exit

Shutdown:
$ sqlplus
 
SQL*Plus: Release 10.1.0.2.0 - Production on Sun Jun 13 22:25:55 2004
 
Copyright (c) 1982, 2004, Oracle.  All rights reserved.
 
Enter user-name: / as sysdba
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
 
SQL> exit

List the Oracle Processes:
$ ps –fuoracle

What Are Those ocssd.bin Processes?

Oracle Cluster Synchronization Services (OCSSD) is a component of Oracle Cluster Ready Services (CRS) and is required for RAC and single-instance databases using ASM. It is installed by default, uses very few system resources, and is configured in /etc/inittab. These processes are started automatically each time the system boots. Oracle recommends against disabling OCSSD, even if you are not running ASM.

REFERENCES

Installing Oracle Database 10g Release 2 on Linux x86 by John Smiley

No comments:

Post a Comment