Installing Oracle Database 10g Release 2 on Linux x86
(RHEL4 )
The Linux distributions certified for Oracle Database 10g Release 2 are:
- Oracle Enterprise Linux 5 (OEL5)
- Oracle Enterprise Linux 4 (OEL4)
- Red Hat Enterprise Linux 5 (RHEL5)
- Red Hat Enterprise Linux 4 (RHEL4)
- Red Hat Enterprise Linux 3 (RHEL3)
- Asianux 2.0
- Asianux 1.0
We will cover the RHEL4 distributions only here.
- Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
- The installer scans your hardware, briefly displays the Red Hat splash screen, and then begins a series of screen prompts.
- Select Enter to continue with a graphical install on the console. (For other installation methods and options, refer to the Red Hat Installation Guide.)
- Language Selection
- Accept the default.
- Accept the default.
- Keyboard Configuration
- Accept the default.
- Accept the default.
- Welcome Screen
- Click on Next.
- Click on Next.
- Disk Partitioning Setup
- 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.
- Boot Loader Configuration
- Accept the default.
- Accept the default.
- Network Configuration
- It is usually best to configure database servers with a static IP address. To do so, click on Edit .
- 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 .
- In the Hostname box, select manually and enter the hostname.
- In the Miscellaneous Settings box, enter the remaining network settings.
- It is usually best to configure database servers with a static IP address. To do so, click on Edit .
- Firewall Configuration
- For the purposes of this walk-through, no firewall is configured. Select No firewall
- Select Disabled on the "Enable SELinux" drop down list.
- Click on Proceed when the "Warning - No Firewall" window appears.
- For the purposes of this walk-through, no firewall is configured. Select No firewall
- Additional Language Support
- Accept the default.
- Accept the default.
- Time Zone Selection
- 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.
- 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.
- Set Root Password
- Enter a password for root, and enter it again to confirm.
- Enter a password for root, and enter it again to confirm.
- Package Installation Defaults
- Select Customize software packages to be installed.
- Select Customize software packages to be installed.
- Package Group Selection
- Select only the package sets shown here and leave all others unselected.
- Desktop
- X Window System
- Gnome
- X Window System
- Applications
- Graphical Internet (optional)
- Graphical Internet (optional)
- Servers
- Do not select anything in this group.
- Do not select anything in this group.
- Development
- Development Tools
- Development Tools
- System
- Administration Tools
- System Tools
- Add the package 'sysstat' by clicking on the Details link and selecting "sysstat - The sar an iostat system monitoring commands." from the Optional Packages list.
- Add the package 'sysstat' by clicking on the Details link and selecting "sysstat - The sar an iostat system monitoring commands." from the Optional Packages list.
- Administration Tools
- Miscellaneous
- Do not select anything in this group.
- Do not select anything in this group.
- Click on Next to proceed.
- Select only the package sets shown here and leave all others unselected.
- Installing Packages
- Software will be copied to the hard disk and installed. Change disks as prompted.
- Software will be copied to the hard disk and installed. Change disks as prompted.
- Congratulations
- Remove the installation media from the system, and click on Reboot .
- Remove the installation media from the system, and click on Reboot .
- The system automatically reboots and presents a new welcome screen.
- Click on Next.
- Click on Next.
- License Agreement
- Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
- Read the license agreement. If you agree to the terms, select Yes, I agree to the License Agreement and click on Next.
- Date and Time
- Set the Date and Time.
- If you want to use an NTP server (recommended), select Enable Network Time Protocol and enter the name of the NTP server.
- Set the Date and Time.
- Display
- Accept the defaults or change as required.
- Accept the defaults or change as required.
- Red Hat Login
- Enter your Red Hat Network login and password or create a new one.
- Enter your Red Hat Network login and password or create a new one.
- System User
- Create an account for yourself.
- Do not create an account for oracle at this time. Creating the oracle account is covered later in this section.
- Create an account for yourself.
- Additional CDs
- Click on Next.
- Click on Next.
- Finish Setup
- Click on Next.
- Click on Next.
- A graphical login screen appears.
- Congratulations! Your RHEL4 software is now installed.
Verifying Your Installation
Required kernel version: 2.6.9-5.0.5.EL This kernel, or any of the kernels supplied in updates, works with Oracle Database 10g Release 2 .
Check your kernel version by running the following command:
uname -r
Ex:
# uname -r
2.6.9-22.ELsmp
Once you've completed the steps above, all of the packages required for Oracle Database 10g Release 2 will have been installed. Verify this using the example below.
Required package versions (or later):
- binutils-2.15.92.0.2-10.EL4
- compat-db-4.1.25-9
- control-center-2.8.0-12
- gcc-3.4.3-9.EL4
- gcc-c++-3.4.3-9.EL4
- glibc-2.3.4-2
- glibc-common-2.3.4-2
- gnome-libs-1.4.1.2.90-44.1
- libstdc++-3.4.3-9.EL4
- libstdc++-devel-3.4.3-9.EL4
- make-3.80-5
- pdksh-5.2.14-30
- sysstat-5.0.5-1
- xscreensaver-4.18-5.rhel4.2
- libaio-0.3.96
- openmotif21-2.1.30-11.RHEL4.2 (Required only to install Oracle demos. Installation of Oracle demos is not covered by this guide.)
To see which versions of these packages are installed on your system, run the following command:
rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
Ex:
# rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
> gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
binutils-2.15.92.0.2-15
compat-db-4.1.25-9
control-center-2.8.0-12.rhel4.2
gcc-3.4.4-2
gcc-c++-3.4.4-2
glibc-2.3.4-2.13
glibc-common-2.3.4-2.13
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.4-2
libstdc++-devel-3.4.4-2
make-3.80-5
pdksh-5.2.14-30.3
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.9
libaio-0.3.103-3
openmotif21-2.1.30-11.RHEL4.4
Part II: Configuring Linux for Oracle
To check the amount of RAM and swap space available, run this:
Create the Oracle Groups and User Account
Set the password on the oracle account:
Now create directories to store the Oracle Database 10g Release 2 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 C of the Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86.
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
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
Ex:
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle
Configuring the Linux Kernel Parameters
Run the following commands as root to verify your settings:
Setting Shell Limits for the oracle User
Use the graphical login to log in as oracle.
Create a directory to contain the Oracle Database 10g Release 2 distribution:
To download Oracle Database 10g Release 2 from OTN, point your browser (Firefox works well) to http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201linuxsoft.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 10201_database_linux32.zip link, and save the file in the directory you created for this purpose (10gR2_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 10gR2_db
unzip 10201_database_linux32.zip
Install the Software and Create a Database
Log in using the oracle account.
Change directory to the location where you extracted the Oracle Database 10g Release 2 software.
Start the Oracle Universal Installer.
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 C of the Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86.
Because you have already created the /u01 directory in Part I, use /u02 for this example.
Ex:
# mkdir /u02
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 /u02 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 /u02
df -h /u02
Ex:
# mount /u02
# df -h /u02
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 33G 33M 31G 1% /u02
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 /u02/oradata/demo1
chown -R oracle:oinstall /u02/oradata
chmod -R 775 /u02/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.2.0.1.0 - Production on Sun Nov 27 15:50:50 2005
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter user-name: system
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> create tablespace data1
2 datafile '/u02/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)
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 2.0 is available for free download from OTN. This section walks through the process of configuring a simple ASM instance by using ASMLib 2.0 and building a database that uses ASM for disk storage.
Determine Which Version of ASMLib You Need
ASMLib 2.0 is delivered as a set of three Linux packages:
- oracleasmlib-2.0 - the ASM libraries
- oracleasm-support-2.0 - utilities needed to administer ASMLib
- oracleasm - a kernel module for the ASM library
Each Linux distribution has its own set of ASMLib 2.0 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.6.9-22.ELsmp i686
The example shows that this is a 2.6.9-22 kernel for an SMP (multiprocessor) box using Intel i686 CPUs.
Use this information to find the correct ASMLib packages on OTN:
- Point your Web browser to http://www.oracle.com/technology/tech/linux/asmlib/index.html
- Select the link for your version of Linux.
- Download the oracleasmlib and oracleasm-support packages for your version of Linux
- Download the oracleasm package corresponding to your kernel. In the example above, the oracleasm-2.6.9-22.ELsmp-2.0.0-1.i686.rpm package was used.
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.6.9-22.ELsmp-2.0.0-1.i686.rpm \
> oracleasmlib-2.0.1-1.i386.rpm \
> oracleasm-support-2.0.1-1.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-22.ELsm########################################### [ 67%]
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 <ENTER> 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 ]
Next you tell the ASM driver which disks you want it to use. Oracle recommends that each disk contain a single partition for the entire disk. See Partitioning the Disks at the beginning of this section for an example of creating disk partitions.
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.
Ex:
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [ OK ]
Verify that ASMLib has marked the disks:
# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
Create the ASM Instance
ASM runs as a separate Oracle instance which can be created and configured using the Oracle Universal Installer. Now that ASMLib is installed and the disks are marked for use, you can create an ASM instance.
Log in as oracle and start runInstaller:
$ ./runInstaller
- Select Installation Method
- Select Advanced Installation
- Click on Next
- Select Advanced Installation
- Specify Inventory Directory and Credentials
- Inventory Directory: /u01/app/oracle/oraInventory
- Operating System group name: oinstall
- Click on Next
- Inventory Directory: /u01/app/oracle/oraInventory
- Select Installation Type
- Select Enterprise Edition
- Click on Next
- Select Enterprise Edition
- Specify Home Details
- Name: OraDB10gASM
- Path: /u01/app/oracle/product/10.2.0/asm
Note:Oracle recommends using a different ORACLE_HOME for ASM than the ORACLE_HOME used for the database for ease of administration. - Click on Next
- Name: OraDB10gASM
- Product-specific Prerequisite Checks
- 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.
- Click on Next
- 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.
- Select Configuration Option
- Select Configure Automatic Storage Management (ASM)
- Enter the ASM SYS password and confirm
- Click on Next
- Select Configure Automatic Storage Management (ASM)
- Configure Automatic Storage Management
- Disk Group Name: DATA
- Redundancy
- High mirrors data twice.
- Normal mirrors data once. This is the default.
- External does not mirror data within ASM. This is typically used if an external RAID array is providing redundancy. - Add Disks
The disks you configured for use with ASMLib are listed as Candidate Disks. Select each disk you wish to include in the disk group. - Click on Next
- Disk Group Name: DATA
- Summary
- A summary of the products being installed is presented.
- Click on Install.
- A summary of the products being installed is presented.
- Execute Configuration Scripts
- At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.
- Click on OK when finished.
- At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.
- Configuration Assistants
- The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
- The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
- End of Installation
- Make note of the URLs presented in the summary, and click on Exit when ready.
- Make note of the URLs presented in the summary, and click on Exit when ready.
- Congratulations! Your new Oracle ASM Instance is up and ready for use.
Create the Database
Once the ASM instance has been created, create a database that uses ASM for storage:
Log in as oracle and start runInstaller:
$ ./runInstaller
- Select Installation Method
- Select Advanced Installation
- Click on Next
- Select Advanced Installation
- Select Installation Type
- Select Enterprise Edition
- Click on Next
- Select Enterprise Edition
- Specify Home Details
- Name: OraDb10g_home1
- Path: /u01/app/oracle/product/10.2.0/db_1
Note:Oracle recommends using a different ORACLE_HOME for the database than the ORACLE_HOME used for ASM. - Click on Next
- Name: OraDb10g_home1
- Product-specific Prerequisite Checks
- 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.
- Click on Next
- 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.
- Select Configuration Option
- Select Create a Database
- Click on Next
- Select Create a Database
- Select Database Configuration
- Select General Purpose
- Click on Next
- Select General Purpose
- Specify Database Configuration Options
- Database Naming: Enter the Global Database Name and SID
- Database Character Set: Accept the default
- Database Examples: Select Create database with sample schemas
- Click on Next
- Database Naming: Enter the Global Database Name and SID
- Select Database Management Option
- Select Use Database Control for Database Management
- Click on Next
- Select Use Database Control for Database Management
- Specify Database Storage Option
- Select Automatic Storage Management (ASM)
- Click on Next
- Select Automatic Storage Management (ASM)
- Specify Backup and Recovery Options
- Select Do not enable Automated backups
- Click on Next
- Select Do not enable Automated backups
- Select ASM Disk Group
- Select the DATA disk group created in the previous section
- Click on Next
- Select the DATA disk group created in the previous section
- Specify Database Schema Passwords
- Select Use the same password for all the accounts
- Enter the password and confirm
- Click on Next
- Select Use the same password for all the accounts
- Summary
- A summary of the products being installed is presented.
- Click on Install.
- A summary of the products being installed is presented.
- Configuration Assistants
- The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
- The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically
- Execute Configuration Scripts
- At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.
- Click on OK when finished.
- At the end of the installation, a pop up window will appear indicating scripts that need to be run as root. Login as root and run the indicated scripts.
- End of Installation
- Make note of the URLs presented in the summary, and click on Exit when ready.
- Make note of the URLs presented in the summary, and click on Exit when ready.
- Congratulations! Your new Oracle Database is up and ready for use.
Accessing the Database with SQL*Plus
Log into Linux as oracle. Set the environment.
Set the Oracle environment variables:
$ . oraenv
ORACLE_SID = [oracle] ? demo1
Using Oracle Enterprise Manager 10g Database Control
In a Web browser, connect to the URL provided during the installation.
User Name: SYS
Password: <The password you chose during installation>
Connect As: SYSDBA
Welcome to the 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
User Name: SYSTEM
Password: <The password you chose during installation>
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:
Comments
Post a Comment