Oracle database 11gr2 linux

Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 6

This article describes the installation of Oracle Database 11g Release 2 (11.2) (64-bit) on Oracle Linux 6 (64-bit). The article is based on a server installation with a minimum of 2G swap, with SELinux set to permissive and the firewall disabled. The following package groups were included for this installation.

  • Base System > Base
  • Base System > Client management tools
  • Base System > Compatibility libraries
  • Base System > Hardware monitoring utilities
  • Base System > Large Systems Performance
  • Base System > Network file system client
  • Base System > Performance Tools
  • Base System > Perl Support
  • Servers > Server Platform
  • Servers > System administration tools
  • Desktops > Desktop
  • Desktops > Desktop Platform
  • Desktops > Fonts
  • Desktops > General Purpose Desktop
  • Desktops > Graphical Administration Tools
  • Desktops > Input Methods
  • Desktops > X Window System
  • Development > Additional Development
  • Development > Development Tools
  • Applications > Internet Browser

An example of this type of Linux installations can be seen here. Alternative installations may require more packages to be loaded, in addition to the ones listed below.

Download Software

Download the Oracle software from OTN or MOS depending on your support status.

Unpack Files

Unzip the files.

You should now have a single directory called «database» containing installation files.

Hosts File

The «/etc/hosts» file must contain a fully qualified name for the server.

Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

Automatic Setup

If you plan to use the «oracle-rdbms-server-11gR2-preinstall» package to perform all your prerequisite setup, follow the instructions at http://public-yum.oracle.com to setup the yum repository for OL, then perform the following command.

All necessary prerequisites will be performed automatically.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

Manual Setup

If you have not used the «oracle-rdbms-server-11gR2-preinstall» package to perform all prerequisites, you will need to manually perform the following setup tasks.

Oracle recommend the following minimum parameter settings.

The current values can be tested using the following command.

Add or amend the following lines in the «/etc/sysctl.conf» file.

Run the following command to change the current kernel parameters.

Add the following lines to the «/etc/security/limits.conf» file.

Install the following packages if they are not already present.

This will install all the necessary 32-bit packages for 11.2.0.1. From 11.2.0.2 onwards many of these are unnecessary, but having them present does not cause a problem.

Create the new groups and users.

We are not going to use the «asm» groups, since this installation will not use ASM.

Additional Setup

Set the password for the «oracle» user.

Amend the «/etc/security/limits.d/90-nproc.conf» file as described below. See MOS Note [ID 1487773.1]

Set secure Linux to permissive by editing the «/etc/selinux/config» file, making sure the SELINUX flag is set as follows.

Once the change is complete, restart the server.

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here.

Create the directories in which the Oracle software will be installed.

Login as root and issue the following command.

Login as the oracle user and add the following lines at the end of the «.bash_profile» file.

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.

Proceed with the installation of your choice. The prerequisites checks will fail for the following version-dependent reasons:

  • 11.2.0.1: The installer shows multiple «missing package» failures because it does not recognize several of the newer version packages that were installed. These «missing package» failures can be ignored as the packages are present. The failure for the «pdksh» package can be ignored because we installed the «ksh» package in its place.
  • 11.2.0.2: The installer should only show a single «missing package» failure for the «pdksh» package. It can be ignored because we installed the «ksh» package in its place.
  • 11.2.0.3: The installer shows no failures and continues normally.

You can see the type of installation I performed by clicking on the links below to see screen shots of each stage.

If you are doing an installation for an Enterprise Manager repository, remember to do an advanced installation and pick the ALT32UTF8 character set.

Post Installation

Edit the «/etc/oratab» file setting the restart flag for each instance to ‘Y’.

Common Errors

«error code 35» : The machine name in the «/etc/hosts» file is not correct. It needs an entry for the loopback adapter (localhost) and the machine name. If you are using DNS for name resolution, you still need the loopback adapter reference in this file.

«error code 37» : The DNS not working properly. You may also get this error is the «/etc/hosts» file is not configured correctly.

«sqlplus: error while loading shared libraries: libclntsh.so.11.1» : The prerequisites have not been met. Work through them again. Specifically, make sure the «gcc» package has been installed.

Listener fails to start — Typically this is due to incorrect name resolution. Make sure the «/etc/hosts» and/or DNS is configured correctly.

Linking errors — Almost always due to missing prerequisites. Review the setup sections.

Источник

Oracle Database 11g Release 2 RAC On Linux Using VMware Server 2

This article describes the installation of Oracle Database 11g release 2 (11.2 64-bit) RAC on Linux (Oracle Enterprise Linux 5 64-bit) using VMware Server 2 with no additional shared disk devices.

I no longer use VMware Server. Since this article was written I’ve switched to VirtualBox as my main virtualization solution for testing installations.

Introduction

One of the biggest obstacles preventing people from setting up test RAC environments is the requirement for shared storage. In a production environment, shared storage is often provided by a SAN or high-end NAS device, but both of these options are very expensive when all you want to do is get some experience installing and using RAC. A cheaper alternative is to use a FireWire disk enclosure to allow two machines to access the same disk(s), but that still costs money and requires two servers. A third option is to use VMware Server to fake the shared storage.

Using VMware Server you can run multiple Virtual Machines (VMs) on a single server, allowing you to run both RAC nodes on a single machine. In addition, it allows you to set up shared virtual disks, overcoming the obstacle of expensive shared storage.

Before you launch into this installation, here are a few things to consider.

  • The finished system includes the host operating system, two guest operating systems, two sets of Oracle Grid Infrastructure (Clusterware + ASM) and two Database instances all on a single server. As you can imagine, this requires a significant amount of disk space, CPU and memory. I completed this installation on a Quad-Core processor with 8G of memory, so don’t expect to work on a low spec machine.
  • Following on from the last point, the VMs will each need 2G of RAM, preferably 3-4G if you don’t want the VM to swap like crazy. As you can see, 11gR2 RAC requires much more memory than 11gR1 RAC. Don’t assume you will be able to run this on a small PC or laptop. You won’t.
  • This procedure provides a bare bones installation to get the RAC working. There is no redundancy in the Grid Infrastructure installation or the ASM installation. To add this, simply create double the amount of shared disks and select the «Normal» redundancy option when it is offered. Of course, this will take more disk space.
  • During the virtual disk creation, I always choose not to preallocate the disk space. This makes virtual disk access slower during the installation, but saves on wasted disk space.
  • This is not, and should not be considered, a production-ready system. It’s simply to allow you to get used to installing and using RAC.
  • The Single Client Access Name (SCAN) should really be defined in the DNS or GNS and round-robin between one of 3 addresses, which are on the same subnet as the public and virtual IPs. In this article I’ve defined it as a single IP address in the «/etc/hosts» file, which is wrong and will cause the cluster verification to fail, but it allows me to complete the install without the presence of a DNS. This approach will not work for 11.2.0.2 onward, where you must use the DNS.
  • The virtual machines used are only given 2Gig of swap, which causes a prerequisite check failure, but doesn’t prevent the installation working. If you want to avoid this, define 3+Gig of swap.
  • This article uses the 64-bit versions of Oracle Enterprise Linux and Oracle 11g Release 2.
Читайте также:  Fix all windows update errors

Download Software

Download the following software.

VMware Server Installation

Regardless of the host OS, the setup of the virtual machines should be similar.

First, install the VMware Server software. On Linux you do this with the following command as the root user.

Then finish the configuration by running the vmware-config.pl script as the root user. Most of the questions can be answered with the default response by pressing the return key. An example of the output can be seen here.

The web-based VMware Intrastructure Web Access Console is started by issuing the command «vmware» at the command prompt, or by pointing your browser to one of the two following URLs depending on whether you need Secure HTTP or not.

If you are using Secure HTTP, your browser may fail due to the self-signed certificate. In Firefox you can solve this by clicking the «Or you can add an exception. » link on the failure page.

On the resulting page, click the «Add Exception. » button..

On the «Add Security Exception» page, click the «Get Certificate» button, then click the «Confirm Security Exception» button.

You are then presented with the web-based login screen.

Log in with the user specified during the config stage and you are presented with the VMware Intrastructure Web Access Console.

The VMware Server is now installed and ready to use.

Virtual Machine Setup

Now we must define the two virtual RAC nodes. We can save time by defining one VM, then cloning it when it is installed.

Click the «Virtual Machine > Create Virtual Machine» menu option, or click the «Create Virtual Machine» link on the bottom right of the console.

Enter the name «RAC1» and accept the standard datastore by clicking the «Next» button.

Select the «Linux operating system» option, and set the version to «Red Hat Enterprise Linux 5 (64-bit)», then click the «Next» button.

Enter the required amount of memory and number of CPUs for the virtual machine, then click the «Next» button. You should enter a minimum of 2048MB of memory.

Click on the «Create a New Virtual Disk» link or click the «Next» button.

Set the disk size to «20 GB» and click the «Next» button.

Click the «Add a Network Adapter» link or click the «Next» button.

Select the «Bridged» option and click the «Next» button.

Click the «Use a Physical Drive» link, or click the «Next» button.

Accept the DVD properties by clicking the «Next» button.

Click the «Don’t Add a Floppy Drive» link.

Click the «Add a USB Controller» link, or click the «Next» button.

Click the «Finish» button to create the virtual machine.

Highlight the «RAC1» VM in the «Inventory» pane, then click the «Add Hardware» link in the «Commands» section to the right.

Click the «Network Adapter» link.

Select the «Bridged» option and click the «Next» button.

Click the «Finish» button.

The virtual machine is now configured so we can start the guest operating system installation.

Guest Operating System Installation

Place the first OEL 5 disk in the DVD drive and start the virtual machine by clicking the play button on the toolbar.

Click on the «Console» tab. If you have not previously installed the VMware browser plugin you will be prompted to do so. If it is already present, simply click on the black pane to the right to open a new console window.

The resulting console window will contain the OEL boot screen.

Continue through the OEL 5 installation as you would for a normal server. A general pictorial guide to the installation can be found here. More specifically, it should be a server installation with a minimum of 2G swap (3-4G if you want to avoid warnings), firewall and SELinux disabled and the following package groups installed:

  • GNOME Desktop Environment
  • Editors
  • Graphical Internet
  • Text-based Internet
  • Development Libraries
  • Development Tools
  • Server Configuration Tools
  • Administration Tools
  • Base
  • System Tools
  • X Window System

To be consistent with the rest of the article, the following information should be set during the installation.

  • hostname: rac1.localdomain
  • IP Address eth0: 192.168.2.101 (public address)
  • Default Gateway eth0: 192.168.2.1 (public address)
  • IP Address eth1: 192.168.0.101 (private address)
  • Default Gateway eth1: none

You are free to change the IP addresses to suit your network, but remember to stay consistent with those adjustments throughout the rest of the article.

Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

Automatic Setup

If you plan to use the «oracle-validated» package to perform all your prerequisite setup, follow the instructions at http://public-yum.oracle.com to setup the yum repository for OL, then perform the following command.

All necessary prerequisites will be performed automatically.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

Читайте также:  Rate limit windows server

Manual Setup

If you have not used the «oracle-validated» package to perform all prerequisites, you will need to manually perform the following setup tasks.

In addition to the basic OS installation, the following packages must be installed whilst logged in as the root user. This includes the 64-bit and 32-bit versions of some packages.

Add or amend the following lines to the «/etc/sysctl.conf» file.

Run the following command to change the current kernel parameters.

Add the following lines to the «/etc/security/limits.conf» file.

Add the following lines to the «/etc/pam.d/login» file, if it does not already exist.

Create the new groups and users.

Create the directories in which the Oracle software will be installed.

Additional Setup

Perform the following steps whilst logged into the «ol5-112-rac1» virtual machine as the root user.

Set the password for the «oracle» user.

Install the following package from the Oracle grid media after you’ve defined groups.

If you are not using DNS, the «/etc/hosts» file must contain the following information.

The SCAN address should not really be defined in the hosts file. Instead is should be defined on the DNS to round-robin between 3 addresses on the same subnet as the public IPs. For this installation, we will compromise and use the hosts file. This may cause problems if you are using 11.2.0.2 onward.

If you are using DNS, then only the first line needs to be present in the «/etc/hosts» file. The other entries are defined in the DNS, as described here. Having said that, I typically include all but the SCAN addresses.

Change the setting of SELinux to permissive by editing the «/etc/selinux/config» file, making sure the SELINUX flag is set as follows.

Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here. The following is an example of disabling the firewall.

Either configure NTP, or make sure it is not configured so the Oracle Cluster Time Synchronization Service (ctssd) can synchronize the times of the RAC nodes. If you want to deconfigure NTP do the following.

If you want to use NTP, you must add the «-x» option into the following line in the «/etc/sysconfig/ntpd» file.

Then restart NTP.

Create the directories in which the Oracle software will be installed.

Login as the «oracle» user and add the following lines at the end of the «/home/oracle/.bash_profile» file.

Create a file called «/home/oracle/grid_env» with the following contents.

Create a file called «/home/oracle/db_env» with the following contents.

Once the «/home/oracle/.bash_profile» has been run, you will be able to switch between environments as follows.

We’ve made a lot of changes, so it’s worth doing a reboot of the VM at this point to make sure all the changes have taken effect.

Install VMware Client Tools

On the web console, highlight the «RAC1» VM and click the «Install VMware Tools» link and click the subsequent «Install» button.

In the RAC1 console, right-click on the «VMwareTools*.rpm» file and select the «Open with «Software Installer»» option.

Click the «Apply» button and accept the warning by clicking the subsequent «Install Anyway» button.

Next, run the «vmware-config-tools.pl» script as the root user.

Accept all the default settings and pick the screen resolution of your choice. Ignore any warnings or errors. The VMware client tools are now installed.

Issue the «vmware-toolbox» command as the root user. On the subsequent dialog, check the «Time synchronization. » option and click the «Close» button.

Reboot the server before proceeding. After the reboot, it is possible the monitor will not be recognised. If this is the case don’t panic. Follow the instructions provided on the screen and reconfigure the monitor setting, which will allow the XServer to function correctly.

Create Shared Disks

Shut down the RAC1 virtual machine using the following command.

Create a directory on the host system to hold the shared virtual disks.

On the VMware Intrastructure Web Access Console, click the «Add Hardware» link.

Click the «Hard Disk» link, or click the «Next» button.

Click the «Create New Virtual Disk» link, or click the «Next» button.

Set the size to «10 GB» and the location to «[standard] shared/asm1.vmdk».

Expand the «Disk Mode» section and check the «Independent» and «Persistent» options. Expand the «Virtual Device Node» section and set the adapter to «SCSI 1» and the device to «1», then click the «Next» button.

Click the «Finish» button to add the new virtual disk.

Repeat the previous hard disk creation steps 4 more times, using the following values.

    File Name: [standard] shared/asm2.vmdk
    Virtual Device Node: SCSI 1:2
    Mode: Independent and Persistent

File Name: [standard] shared/asm3.vmdk
Virtual Device Node: SCSI 1:3
Mode: Independent and Persistent

File Name: [standard] shared/asm4.vmdk
Virtual Device Node: SCSI 1:4
Mode: Independent and Persistent

  • File Name: [standard] shared/asm5.vmdk
    Virtual Device Node: SCSI 1:5
    Mode: Independent and Persistent
  • At the end of this process, the virtual machine should look something like the picture below.

    Edit the contents of the «/u01/VM/RAC1/RAC1.vmx» file using a text editor, making sure the following entries are present. Some of the tries will already be present, some will not.

    Start the RAC1 virtual machine by clicking the «Play» button on the toolbar, then start the console as before. When the server has started, log in as the root user so you can partition the disks. The current disks can be seen by issuing the following commands.

    Use the «fdisk» command to partition the disks sdb to sdf. The following output shows the expected fdisk output for the sdb disk.

    In each case, the sequence of answers is «n», «p», «1», «Return», «Return», «p» and «w».

    Once all the disks are partitioned, the results can be seen by repeating the previous «ls» command.

    Determine your current kernel.

    Download the appropriate ASMLib RPMs from OTN. In this case we installed the last two from the media, so we just need the first package. For RHEL we would need all three of the following.

    Install the packages using the following command.

    Configure ASMLib using the following command.

    Load the kernel module using the following command.

    If you have any problems, run the following command to make sure you have the correct version of the driver.

    Mark the five shared disks as follows.

    It is unnecessary, but we can run the «scandisks» command to refresh the ASM disk configuration.

    We can see the disk are now visible to ASM using the «listdisks» command.

    The shared disks are now configured for the grid infrastructure.

    Clone the Virtual Machine

    The current version of VMware Server does not include an option to clone a virtual machine, but the following steps illustrate how this can be achieved manually.

    Shut down the RAC1 virtual machine using the following command.

    Читайте также:  Как избавиться от линукса

    Copy the RAC1 virtual machine using the following command.

    Edit the contents of the «/u01/VM/RAC2/RAC1.vmx» file, making the following change.

    Ignore discrepancies with the file names in the «/u01/VM/RAC2» directory. This does not affect the action of the virtual machine.

    In the VMware Infrastructure Web Access Console, select the «Virtual Machine > Add Virtual Machien to Inventory» menu options and browse for the «/u01/VM/RAC2/RAC1.vmx» file. Once opened, the RAC2 virtual machine is visible on the console.

    Start the RAC2 virtual machine by clicking the «Play» button on the toolbar. Select the «I _copied it» option click the «OK» button when prompted.

    Ignore any errors during the server startup. We are expecting the networking components to fail at this point.

    Log in to the RAC2 virtual machine as the root user and start the «Network Configuration» tool (System > Administration > Network).

    Remove the devices with the «%.bak» nicknames. To do this, highlight a device, deactivate, then delete it. This will leave just the regular «eth0» and «eth1» devices. Highlight the «eth0» interface and click the «Edit» button on the toolbar and alter the IP address to «192.168.2.102» in the resulting screen.

    Click on the «Hardware Device» tab and click the «Probe» button. Then accept the changes by clicking the «OK» button.

    Repeat the process for the «eth1» interface, this time setting the IP Address to «192.168.0.102», and making sure the default gateway is not set for the «eth1» interface.

    Click on the «DNS» tab and change the host name to «rac2.localdomain», then click on the «Devices» tab.

    Once you are finished, save the changes (File > Save) and activate the network interfaces by highlighting them and clicking the «Activate» button. Once activated, the screen should look like the following image.

    Edit the «/home/oracle/.bash_profile» file on the RAC2 node to correct the ORACLE_SID and ORACLE_HOSTNAME values.

    Also, amend the ORACLE_SID setting in the «/home/oracle/db_env» and «/home/oracle/grid_env» files.

    Start the RAC1 virtual machine and restart the RAC2 virtual machine. When both nodes have started, check they can both ping all the public and private IP addresses using the following commands.

    At this point the virtual IP addresses defined in the «/etc/hosts» file will not work, so don’t bother testing them.

    Prior to 11gR2 we would probably use the «runcluvfy.sh» utility in the clusterware root directory to check the prerequisites have been met. If you are intending to configure SSH connectivity using the installer this check should be omitted as it will always fail. If you want to setup SSH connectivity manually, then once it is done you can run the «runcluvfy.sh» with the following command.

    If you get any failures be sure to correct them before proceeding.

    It’s a good idea to take a snapshot of the virtual machines, so you can repeat the following stages if you run into any problems. To do this, shutdown both virtual machines and issue the following commands.

    The virtual machine setup is now complete.

    Install the Grid Infrastructure

    Start the RAC1 and RAC2 virtual machines, login to RAC1 as the oracle user and start the Oracle installer.

    Select the «Install and Configure Grid Infrastructure for a Cluster» option, then click the «Next» button.

    Select the «Typical Installation» option, then click the «Next» button.

    On the «Specify Cluster Configuration» screen, click the «Add» button.

    Enter the details of the second node in the cluster, then click the «OK» button.

    Click the «SSH Connectivity. » button and enter the password for the «oracle» user. Click the «Setup» button to to configure SSH connectivity, and the «Test» button to test it once it is complete.

    Click the «Identify network interfaces. » button and check the public and private networks are specified correctly. Once you are happy with them, click the «OK» button and the «Next» button on the previous screen.

    Enter «/u01/app/11.2.0/grid» as the software location and «Automatic Storage Manager» as the cluster registry storage type. Enter the ASM password and click the «Next» button.

    Set the redundancy to «External», select all 5 disks and click the «Next» button.

    Accept the default inventory directory by clicking the «Next» button.

    Wait while the prerequisite checks complete. If you have any issues, either fix them or check the «Ignore All» checkbox and click the «Next» button.

    If you are happy with the summary information, click the «Finish» button.

    Wait while the setup takes place.

    When prompted, run the configuration scripts on each node.

    The output from the «orainstRoot.sh» file should look something like that listed below.

    The output of the root.sh will vary a little depending on the node it is run on. Example output can be seen here (Node1, Node2).

    Once the scripts have completed, return to the «Execute Configuration Scripts» screen on RAC1 and click the «OK» button.

    Wait for the configuration assistants to complete.

    We expect the verification phase to fail with an error relating to the SCAN, assuming you are not using DNS.

    Provided this is the only error, it is safe to ignore this and continue by clicking the «Next» button.

    Click the «Close» button to exit the installer.

    It’s a good idea to take a snapshot of the virtual machines, so you can repeat the following stages if you run into any problems. To do this, shutdown both virtual machines and issue the following commands.

    The grid infrastructure installation is now complete.

    Install the Database

    Start the RAC1 and RAC2 virtual machines, login to RAC1 as the oracle user and start the Oracle installer.

    Uncheck the security updates checkbox and click the «Next» button.

    Accept the «Create and configure a database» option by clicking the «Next» button.

    Accept the «Server Class» option by clicking the «Next» button.

    Make sure both nodes are selected, then click the «Next» button.

    Accept the «Typical install» option by clicking the «Next» button.

    Enter «/u01/app/oracle/product/11.2.0/db_1» for the software location. The storage type should be set to «Automatic Storage Manager». Enter the appropriate passwords and database name, in this case «RAC.localdomain».

    Wait for the prerequisite check to complete. If there are any problems either fix them, or check the «Ignore All» checkbox and click the «Next» button.

    If you are happy with the summary information, click the «Finish» button.

    Wait while the installation takes place.

    Once the software installation is complete the Database Configuration Assistant (DBCA) will start automatically.

    Once the Database Configuration Assistant (DBCA) has finished, click the «OK» button.

    When prompted, run the configuration scripts on each node. When the scripts have been run on each node, click the «OK» button.

    Click the «Close» button to exit the installer.

    The RAC database creation is now complete.

    Check the Status of the RAC

    There are several ways to check the status of the RAC. The srvctl utility shows the current configuration and status of the RAC database.

    The V$ACTIVE_INSTANCES view can also display the current status of the instances.

    Источник

    Оцените статью