Humble Trader

Friday, December 30, 2005

Install the Oracle Database

Introduction:

In this post, we will install the Oracle 10g Database Suite.

Aim:

An installed base-engine.

Requirements:

A configured Linux server.

Procedure:

  • Reboot the server.
  • Log in as root.
  • Open Terminal.
  • Set up sysctl.conf
    • # cd /etc
    • # vi sysctl.conf
    • Add the following lines to the bottom of this file:
      • # Oracle parameters:
      • kernel.shmall = 2097152
      • kernel.shmmax = 2147483648
      • kernel.shmmni = 4096
      • # semaphores: semmsl semmns semopm semmni
      • kernel.sem = 250 32000 100 128
      • fs.file-max = 65536
      • net.ipv4.ip_local_port_range = 1024 65000
      • net.core.rmem_default = 262144
      • net.core.wmem_default = 262144
      • net.core.rmem_max = 262144
      • net.core.wmem_max = 262144
  • Lodge the changes:
    • # /sbin/sysctl -p
  • Set security limits:
    • # cd /etc/security
    • # vi limits.conf
    • Add the following lines just before the line; '# End of file':
      • * soft nproc 2047
      • * hard nproc 16384
      • * soft nofile 1024
      • * hard nofile 65536
  • Set up pam:
    • # cd /etc/pam.d
    • # vi login
    • Add the following line just before the comment; '# pam_selinux.so open should be the last session rule':
      • session required /lib/security/pam_limits.so
  • Check that the correct packages are installed:
    • Run the following rpm commands. In each case, rpm should come back with at least the version indicated:
      • # rpm -q setarch -> setarch-1.7-3
      • # rpm -q tcl -> tcl-8.4.9-3
      • # rpm -q xorg-x11-deprecated-libs -> xorg-x11-deprecated-libs-6.8.2-31
      • # rpm -q openmotif -> openmotif-2.2.3-10
      • # rpm -q compat-db -> compat-db-4.2.52-2
      • # rpm -q compat-libstdc++-33 -> compat-libstdc++-33-3.2.3-47.fc4
      • # rpm -q compat-gcc-32 -> compat-gcc-32-3.2.3-47.fc4
      • # rpm -q compat-gcc-32-c++ -> compat-gcc-32-c++-3.2.3-47.fc4
  • Create the oracle user:
    • # groupadd oinstall
    • # groupadd dba
    • # groupadd oper
    • # useradd -g oinstall -G dba oracle
    • # passwd oracle
  • Create oracle's home file system:
    • # mkdir -p /u01/app/oracle/10.2.0.1/db01
    • # chown-R oracle.oinstall /u01
  • Change OS release information (Oracle thinks it can only run on certain OS's. It's wrong.):
    • # cd /etc
    • # vi redhat-release
    • Comment out Fedora... line with a #
    • Add line: redhat-3
  • Reboot the server so that the kernel changes take effect.
  • Set up oracle's account:
    • Log in as oracle and set up oralcle's desktop.
    • $ vi .bash_profile
    • Add the following lines to oracle's .bash_profile right below the line; 'export PATH':
# Oracle definitions & locations.
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/10.2.0.1/db01
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_TERM=vt100
export ORACLE_SID=`grep Y$ /etc/oratab | cut -d: -f1 | head -1`

umask 022

  • And while you're here, add chora.
  • Source .bash_profile:
    • $ cd
    • $ . ./.bash_profile
  • Download Oracle 10g:
    • This bit of the licence is important. We are going to get a Developer Licence - which is free - but, if you use this software for financial gain, you owe Oracle:
      • We grant you a nonexclusive, nontransferable limited license to use the programs only for the purpose of developing a single prototype of your application, and not for any other purpose. If you use the application you develop under this license for any internal data processing or for any commercial or production purposes, or you want to use the programs for any purpose other than as permitted under this agreement, you must contact us, or an Oracle reseller, to obtain the appropriate license. We may audit your use of the programs. Program documentation may accessed online at http://otn.oracle.com/docs.
    • $ mkdir oradb
    • $ cd oradb
    • Go here (from OTN - link through here to register) to get the software and download it to this directory - it is single file called; '10201_database_linux32.zip'. (I also burn it on to a CD. You never know when you'll need the install disk and why go through that download twice!)
  • Unzip the file:
    • $ unzip 10201_database_linux32.zip
    • This unzips the file to the sub-directory; 'database'.
  • Run the installer:
    • $ cd database
    • Open an xterm window: $ xterm &
    • In the xterm window: $ ./runInstaller
    • An Oracle Universal Installer (OUI) opens. (Get used to these types of windows. We are going to see a lot of them.)
  • Installer actions:
    • Select Installation Method:
      • Oracle Home Location: /u01/app/oracle/10.2.0.1/db01
      • Untick; Create Starter Database (additional 720MB) - (We will create a couple of databases later.)
      • [Next]
    • Specify Inventory directory and credentials:
      • Enter the full path of the inventory directory: /u01/app/oracle/oraInventory
      • [Next]
    • Product-Specific Prerequisite Checks:
      • The status of all of these should be 'Succeeded'. If some are not, this may still work but there is no guarantee. Before going on, you should check the OS changes we made above on this post.
      • [Next]
    • Summary:
      • [Install]
    • Execute Configuration scripts:
      • Some scripts need to be run as root:
      • Open Terminal.
      • Switch to root: $ su -
      • Enter root's password.
      • # cd /u01/app/oracle/oraInventory
      • # ./orainstRoot.sh
        • This throws a few messages as it executes.
      • # cd /u01/app/oracle/10.2.0.1/db01
      • # root.sh
        • This throws some messages and then asks for input:
          • Enter the full pathname of the local bin directory: [/usr/local/bin]: Just hit enter.
          • The script then puts a few files in the local bin directory, throws a few more messages and finishes.
      • You can leave root's Terminal window open.
      • Go back to the Installer...
      • [OK]
    • End of Installation:
      • This bit is important. Two URLs are listed. Note these down. Mine are listed on my Server Specification.
      • [Exit]
    • Exit:
      • [Yes]
    • Go to root's Terminal:
      • # cd /etc
      • # vi redhat-release
      • Change this back so that the only uncommented line reads; 'Fedora Core release 4 (Stentz)'.
  • Correct file permissions:
    • If you have a Metalink account:
      • Go to oracle's Terminal.
      • $ cd
      • $ mkdir patches
      • $ cd patches
      • Download this patch to this directory (Platform of Language is 'Linux x86').
      • $ unzip p4516865_10201_LINUX.zip
      • $ cd 4516865
      • $ export PATH=$PATH:$ORACLE_HOME/OPatch
      • $ which opatch
        • This should return a path to the opatch script.
      • $ opatch lsinventory:
        • This returns a number of messages, one of which is; Lsinventory Output file location : and a path.
      • $ opatch apply
        • This returns a number of messages cumulating in 'OPatch succeeded.'
      • $ cd $ORACLE_HOME/install
      • $ ./changePerm.sh
        • This is and interactive script:
          • Do you wish to continue (y/n) [n]: y
        • Eventually, the script returns with a number of messages, including; 'Finished running the script successfully'
    • If you don't have access to Metalink:
      • Try this - WARNING: I haven't tested this. While this will probably work, it may relax file permissions to a greater extent than by applying the patch. The security implications for this are unknown - at least by me:
        • Go to oracle's Terminal.
        • chmod -R a+rX $ORACLE_HOME
Testing:

Not much to test at the moment. The Oracle software is installed but we don't yet have a database. Let's create a couple of these in the next step.

0 Comments:

Post a Comment

<< Home