02 - oracle server installation

Upload: zee-sniper

Post on 07-Apr-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 02 - Oracle Server Installation

    1/15

    32

    O2Oracle Server Installation

    Installing the Oracle server software is really a simple affair. Installing all the software will probably not

    take you more than a couple of hours. All the real effort goes into the proper planning of such things as

    the operating system configuration and physical space you need for your Oracle databases to function

    optimally.

    You can save yourself a lot of grief during the installation process by carefully reviewing three sets of

    installation documents:

    Oracle Installation Guide for your operating system.

    Release Notes and Release Notes Addendums.

    README files.

    Choice of Operating System

    All operating systems have good and bad points: none are suitable for all applications. In general, Oracle

    Corporation supports all the mainstream platforms, including:

    Linux on Intel and AMD Microsoft Windows on Intel and AMD

    Solaris on SPARC

    AIX on POWER

    HPUX on PA-RISC

    Linux deserves a special mention. Oracle Corporation has made a huge commitment to Linux, and Linux

    is used as the development platform for many products (including database release 11g). Linux comes in

    several distributions. The most popular for Oracle servers are Red Hat and SUSE, but do not ignore the

    Oracle distribution: Enterprise Linux. This is very well packaged and fully supported by Oracle

    Corporation.

    Directory and File Naming Conventions

    The Oracle needs a file system into which it can be installed. Oracle strongly recommends a disk layout

    methodology formally called the Optimal Flexible Architecture (OFA).

    The OFA is a set of recommendations from Oracle Corporation aimed at simplifying management of

    complex software and databases often running under multiple versions of software. The OFA essentially

    imposes a standardized way of naming the different physical components of Oracle and places them on

    the file system according to a logical plan.

    OFA was designed to achieve minimize disk contention, to provide for operating more than one database

    without administrative confusion, and to improve database performance. You can consider the OFA

    guidelines a set of best practices regarding two important issuesdisk layout and naming conventions

    based on extensive field experience by Oracle professionals.

    Mount Points

    Mounting refers to attach a directory with a file system. This directory is the top-level directory of a file

    system. Oracle recommends that all your Oracle mount points be named according to the convention /pm,

  • 8/6/2019 02 - Oracle Server Installation

    2/15

    33

    where p is a string constant to distinguish itself from other mount points, and m is a two-digit number.

    This means you can name your mount points /u01, /u02, /u03, and so on.

    Oracle recommends that you have four mount points to fully comply with the OFA guidelines. The first

    of these is for locating the Oracle Database 10g server binaries, and the other three are for holding the

    database files. Lets say youre creating mount points for a database named prod. In this case, the threemount points designated for the data files can be clearly named as follows: /u01/oradata/prod,

    /u02/oradata/prod, and /u03/oradata/prod. This nomenclature makes it clear that these file systems are

    meant for Oracle databases and that the data for different databases is stored on separate mount points.

    In Linux and UNIX systems, a home directory is the directory that a user lands in when he or she first

    logs in. All home directories should follow the naming convention /pm/h/u, where pm is the mount point

    name, h is a standard directory name, and u refers to the directory owner. For example, the

    /u01/app/oracle directory could be the home directory for the user named oracle. Note that the entire

    home directory for each user (e.g., /u01/app/oracle) is denoted by the letter h for the purposes of the

    following discussion.

    ORACLE _BASE Directory

    At the root of the Oracle directory structure is the directory called Oracle base, denoted by the

    environmental variable ORACLE_BASE. The Oracle base directory is the top directory for all Oracle

    software installations. Oracle recommends that you use the form /pm/h/u. Where:

    pm is the mount point name

    h is the name of a standard directory and

    u is the directorys owners name

    The default owner of the Oracle base directory is usually a user named oracle, and the standard directory

    is usually named app. Therefore, the Oracle base directory usually has the form of /pm/app/oracle (for

    example, /u01/app/oracle).

    ORACLE_HOME Directory

    The Oracle home directory, denoted by the ORACLE_HOME environment variable, is very important,

    since the Oracle server software executable files and other configuration files are located under this

    directory. For example, the $ORACLE_HOME/bin directory holds the executables for the Oracle

    products, and the $ORACLE_HOME/network directory holds the Oracle Net Services files.

    In order to comply with the OFA requirement of enabling the simultaneous running of multiple versions

    of Oracle software, you need to install Oracle software in a directory with the following path:

    /pm/h/u/product/v/type_[n], where:

    pm: The mount point name

    h: The standard directory name

    u: The owner of the directory, usually named oracle

    v: The version of the software

    type: The type of installation, such as database (db), client (client) or companion (companion)

    n: An optional counter, which enables you to install the same product multiple times under the

    same Oracle base directory

    In the preceding syntax for the Oracle home, /pm/h/u/product/v_type_[n], the first part, /pm/h/u, is

    nothing but the Oracle base directory. Thus the Oracle home directory is always located underneath the

    Oracle base directory, and it can also be specified as $ORACLE_BASE/product/v/type_[n].

    Oracle supports multiple Oracle homes, but you cant install products from one release of Oracle into an

    Oracle home directory of a different release. You must install the Oracle Database 10.2 soft-ware into a

    new Oracle home directory. For example, you cant install release 10.2 software into an existing Oracle9i

    Oracle home directory.

  • 8/6/2019 02 - Oracle Server Installation

    3/15

    34

    Oracle Inventory Directory

    Oracle uses a special directory called the Oracle Inventory Directory, also known as OraInventory, to

    store an inventory of all the Oracle software on a server. Multiple Oracle installations can share the same

    Oracle Inventory Directory. You need to specify the path for this directory only the first time you install

    an Oracle product on a server. The usual format of this directory is as follows:

    $ORACLE_BASE/ora_inventory.

    Administrative Files

    Every Oracle database has several administrative files associated with it. Among these files are con-

    figuration files, core dump files, trace files, export files, and other related log files. You need to store

    these files under separate directories for ease of maintenance.

    Oracle recommends the following directory structure for clarity: /h/admin/d/a, where:

    h is the Oracle base directory (e.g., /u01/app/oracle)

    admin indicates that this directory holds administration-related files (e.g bdump)

    d refers to the specific database, and

    a refers to the subdirectories for each specific type of administrative files

    Following is the list of standard administrative directories that youll need in most cases.

    adhoc; Contains ad hoc SQL files

    arch; Contains archived redo log files

    adump; Contains any audit files

    bdump; Contains background process trace files

    create; Contains SQL scripts that you can use for creating your databases

    cdump; Contains core dump files

    dpdump; Contains the Data Pump Export files

    pfile; Contains instance parameter files (such as init.ora)

    udump; Contains SQL trace files for user processes

    Product Files

    Oracle recommends that you keep each version of the software in a separate directory distinguished by

    the naming convention /h/product/v, where h is the home directory, product indicates that the software

    versions are under this directory, and v is the version of the product. For example, I have a directory on

    my system called /u01/app/oracle/product/10.1.0.2.0 under which I save all the Oracle server software

    subdirectories during installation. If I decide to install the 10.2.0 version, Ill do so under the directory

    /u01/app/oracle/product/10.2.0. You can see that this type of naming convention makes it very easy to

    install and manage multiple versions of the Oracle software.

    Database Files

    These include the data files that contain the table and index data and certain operational files called

    control files and redo log files.

    Oracle recommends that all tablespaces be named with no more than eight characters, with the format tn,

    where t is a descriptive name for the tablespace and n is a two-digit number. For data files, the

    recommended notation is /pm/q/d/tn.dbf, where pm is the mount point; q is an indicator, usually

    oradata, d is the database name, t is the descriptive name for the tablespace that contains this data file,

    and n is a two-digit number. Thus, a typical data file under the OFA guidelines would have a name like

    /u20/oradata/prod/system01.dbf, which refers to a data file in the System table-space.

  • 8/6/2019 02 - Oracle Server Installation

    4/15

    35

    The recommendation for control and redo files is to follow the naming conventions /pm/q/d/controln.ctl

    and /pm/q/d/redon.log, respectively. In this notation, pm is the mount point; q is an indicator, such as

    oradata, denoting that the files contain Oracle-related data; d is the data-base name, and n is a two-digit

    number.

    Flash Recovery AreaOracle Database 10g introduces the new flash recovery area, which is a disk area set apart for stor-ing all

    the recovery-related files. Its a good idea to create it on entirely different storage devices from where you

    have your data files. You also need to set another parameter, DB_RECOVERY_FILE_DEST, to indicate

    the location of the flash recovery area. You can set the physical size of the flash recovery area by using

    the DB_RECOVERY_FILE_DEST_SIZE initialization parameter.

    The following figure depicts the overall directory structure for Oracle installation.

  • 8/6/2019 02 - Oracle Server Installation

    5/15

    36

  • 8/6/2019 02 - Oracle Server Installation

    6/15

    37

    Performing Installation

    To successfully install the Oracle 10g on RHEL 5.x, one must complete the following steps.

    1. Checking Hardware Requirements

    2. Checking Software Requirements

    3. Checking Network Configuration

    4. Configure Kernel Parameters

    5. Changing Shell Limits

    6. Creating Groups & Users

    7. Creating Necessary Directories

    8. Configure Oracle User's Environment

    9. Running Oracle Universal Installer

    1. Checking Hardware Requirements

    Check the RAM size

    Check the Swap size

    Swap size should be 1.5 times of the RAM, if RAM size is between 1024MB and 2048MB,

    otherwise it should be equal to the size of RAM

    Check free space in /tmp directory

    There must be 400MB of disk space in the /tmp directory

    Check free disk space

    Oracle software requires 1.5GB to 3.5GB of disk space, while 1.2GB of disk space for a

    preconfigured database

    Determine whether the system architecture can run the oracle software

    Verify that the processor architecture matches the Oracle software release that you want to

    install

    2. Checking Software Requirements

  • 8/6/2019 02 - Oracle Server Installation

    7/15

  • 8/6/2019 02 - Oracle Server Installation

    8/15

    39

    Verify that the /etc/hosts file is used for name resolution. You can do this by checking the

    hosts file entry in the nsswitch.conf file as follows:

    The output of this command should contain an entry for files.

    Check hostname

    The output of this command should be similar to the output shown above

    Check that the domain name has not been set dynamically

    This command should not return any results.

    Check that the hosts file contains the fully qualified host name by using the following

    command:

    The output of this command should contain an entry for the fully qualified host name and for

    localhost.

    4. Configure Kernel Parameters

    Verify that the kernel parameters shown in the following list are set to values greater than or

    equal to the recommended value shown

    Semaphore Parameters: semmsl, semmns, semopm, semmni

    Shared Memory Segments: shmall, shmmax, shmmni

    File Handles: file-max

    Port Numbers: ip_local_port_range

    Socket Receive Buffer Size: rmem_default, rmem_max

    Socket Send Buffer Size: wmem_default, wmem_max

    # /sbin/sysctl -a | grep parameter_name

    Note; Oracle recommends that you tune these values to optimize the performance of the

    system. Refer to your operating system documentation for more information about tuning

    kernel parameters

    If the value of any kernel parameter is different from the recommended value, then using any

    text editor, create or edit the /etc/sysctl.conf file, and add or edit lines similar to the

    following:

  • 8/6/2019 02 - Oracle Server Installation

    9/15

    40

    Restart the system to persists the changes.

    5. Changing Shell Limits

    To improve the performance of the software on Linux systems, you must increase the

    following shell limits for the oracle user:

    nofile Maximum number of open file descriptors

    nproc Maximum number of processes available to a single user

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

    Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:

    6. Creating Groups & Users

  • 8/6/2019 02 - Oracle Server Installation

    10/15

    41

    Create OSDBA group (dba); identifies operating system user accounts that have database

    administrative privileges (the SYSDBA privilege), OSOPER group (oper); optional group.

    Create this group if you want a separate group of operating system users to have a limited set

    of database administrative privileges (the SYSOPER privilege), Orcale Inventory group

    (oinstall); create this group the first time you install Oracle software on the system

    To determine whether the Oracle Inventory group exists, enter the following command:

    # more /etc/oraInst.loc

    If the output of this command shows the oinstall group name, then the group already exists

    # /usr/sbin/groupadd oinstall

    # /usr/sbin/groupadd dba

    # /usr/sbin/groupadd oper

    Create an Oracle software owner user (oracle), to determine whether an Oracle software

    owner user named oracle exists, enter the following command:

    # id oracle

    If the oracle user exists, then the output from this command is similar to the following:

    uid=440(oracle) gid=200(oinstall) groups=201(dba),202(oper)

    To create the oracle user, enter a command similar to the following:

    # /usr/sbin/useradd -g oinstall -G dba -d /home/oracle -p

    oracle1 oracle

    In the preceding command,

    g denotes the primary group of the oracle user, which is the oinstall group

    G is the secondary group, which is the dba group

    d denotes the home directory for the new user

    p is the password for the oracle user

    The following command can also be used for setting password:

    # /usr/bin/passwd oracle

    7. Creating Necessary Directories

    Create Oracle Base Directory as

    # mkdir /u01/app

    # mkdir /u01/app/oracle

    Change owner of base directory to oracle and group to oinstall

    # chown -R oracle:oinstall /u01/app/oracle

    Change permission on base directory

    # chmod -R 775 /u01/app/oracle

    In the numeric 775 permission, 7 means rwx and 5 means r-x

    Oracle Home Directory (/u01/app/oracle/product/10.2.0/db_1). The OUI will automatically

    create this directory as assigns the oracle user the necessary privileges

    Oracle Inventory Directory ((/u01/app/oracle/ora_inventory). The OUI will prompt you for its

    location

    Create Flash Recovery Area directory, change owner and permissions

  • 8/6/2019 02 - Oracle Server Installation

    11/15

    42

    # mkdir /u01/app/oracle/flash_recovery

    # mkdir /u01/app/oracle/flash_recovery/db_1

    # chown -R oracle:oinstall /u01/app/oracle/flash_recovery/db_1

    # chmod -R 775 /u01/app/oracle/flash_recovery/db_1

    Similarly create /u01/app/oracle/admin/db_1 and other directories within db_1, refer OFA fordetails

    Create directories for database files as

    # mkdir /u02/oradata

    # mkdir /u02/oradata/db_1

    Change owner and permissions

    # chown -R oracle:oinstall /u02/oradata/db_1

    # chmod -R 775 /u02/oradata/db_1

    8. Configure Oracle User's Environment

    Log in as the oracle user and set the following environment variables:

    Check the default shell of the oracle user

    Open the oracle users shell startup file in any text editor, on bourne shell , bash shell, or

    korn shell it will be .bash_profile while on c shell it will be .login and enter the followinglines

    Depending on the oracle user's default shell, make the following changes to the default shell

    start-up file:

    For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the

    file on SUSE systems) /etc/profile.local:

  • 8/6/2019 02 - Oracle Server Installation

    12/15

    43

    For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file (or the file on

    SUSE systems)/etc/csh.login.local:

    if ( $USER == "oracle" ) thenlimit maxproc 16384limit descriptors 65536

    endif

    Run the shell script

    $ . ./.bash_profile

    9. Running Oracle Universal Installer

    Oracle Universal Installer (OUI) is a Java application that performs component-based installations. OUI

    provides the following capabilities for addressing software management and distribution:

    Automatic dependency resolution and complex logic handling

    Installation from the Web

    Component and suite installations

    Implicit deinstallation

    Support for multiple Oracle homes

    NLS or globalization support

    Support for distributed installations

    Unattended silent installations that use response files

    Create a staging directory, such as /staging, and copy the contents of the CD to this directory

    as shown:

    $ cp -r /mnt/cdrom /staging

    As an oracle user, start the installation, go to the /staging directory and run the followingcommand

  • 8/6/2019 02 - Oracle Server Installation

    13/15

    44

    Navigate the OUI pages and specify your preinstallation settings according to your

    installation plan as shown in the screen shots given below:

  • 8/6/2019 02 - Oracle Server Installation

    14/15

    45

  • 8/6/2019 02 - Oracle Server Installation

    15/15

    46