Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

第 45 章 Installing Oracle Database


45.1. Installing Oracle Database 10g Release 2 on Linux x86
45.2. 11gR2
45.3. Installing Oracle Client 11g
45.4. Silence Install - Database
45.4.1. Response File
45.4.2. OS 配置腳本
45.4.3. 運行 runInstaller
45.5. Silence Install - Client
45.6. oracle 817 script
45.7. Script for automatic startup on boot
45.8. Run level shell script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)

45.1. Installing Oracle Database 10g Release 2 on Linux x86

reference: http://www.oracle.com/technology/pub/articles/smiley_10gdb_install.html

To make these changes, cut and paste the following commands as root:

過程 45.1. Configure linux step by step

  1. Verifying Your Installation

    rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
    gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21

    installing package

    yum install compat-gcc-32 compat-gcc-32-c++ compat-gcc-32-g77 compat-libf2c-32 compat-libstdc++-296 compat-libstdc++-33 compat-db compat-readline43
  2. Verifying System Requirements

    grep MemTotal /proc/meminfo
    grep SwapTotal /proc/meminfo

    Swap = mem * 2

  3. Create the Oracle Groups and User Account

    groupadd oinstall
    groupadd dba
    useradd -m -g oinstall -G dba oracle
    passwd oracle
    id oracle
  4. Create Directories

    mkdir -p /u01/app/oracle
    chown -R oracle:oinstall /u01/app/oracle
    chmod -R 775 /u01/app/oracle
  5. Configuring the Linux Kernel Parameters

    cat >> /etc/sysctl.conf <<EOF
    kernel.shmall = 2097152
    kernel.shmmax = 536870912
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 65536
    net.ipv4.ip_local_port_range = 1024 65000
    /sbin/sysctl -p

    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
    /sbin/sysctl -a | grep rmem_default
    /sbin/sysctl -a | grep rmem_max
    /sbin/sysctl -a | grep wmem_default
    /sbin/sysctl -a | grep wmem_max
  6. Setting Shell Limits for the oracle User

    cat >> /etc/security/limits.conf <<EOF
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
  7. /etc/profile

    cat >> /etc/profile <<EOF
    if [ \$USER = "oracle" ]; then
     if [ \$SHELL = "/bin/ksh" ]; then
     ulimit -p 16384
     ulimit -n 65536
     ulimit -u 16384 -n 65536
     umask 022
    cat >> /etc/csh.login <<EOF
    if ( \$USER == "oracle" ) then
     limit maxproc 16384
     limit descriptors 65536
     umask 022
  8. .bash_profile

    # su - oracle
    $ vim .bash_profile
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/
    export ORACLE_SID=orcl
    export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

過程 45.2. Installing Oracle

  1. 編輯 /10201_database_linux32/database/install/oraparam.ini 添加

    vim 10201_database_linux32/database/install/oraparam.ini
    ### #[Certified Versions]
  2. install

    gunzip xxxx.cpio.gz
    cpio -idmv < xxxx.cpio
    export LANG=en_US
  3. dbstart

    # su - oracle
    # dbstart
    提示打開 /ade/vikrkuma_new/oracle/bin/tnslsnr 失敗

    編輯 /u01/app/oracle/product/

    # Set this to bring up Oracle Net Listener
    # Set this to bring up Oracle Net Listener

    /etc/oratable 將最後一行的最後一個字元由 “N” 改為 “Y”

    orcl: /u01/app/oracle/product/

過程 45.3. Configuring Storage

  1. Partition the Disks

    fdisk -l /dev/sdb
  2. Filesystems

    ZFS or btrfs

  3. Create the Mount Point

    mkdir /u02

    Add the New Filesystem to /etc/fstab

    /dev/sdb1 /u02 xfs defaults 1 1

    Mount the New Filesystem

    mount /u02
    df -h /u02
  4. Create Oracle Directories and Set Permissions

    mkdir -p /u02/oradata/demo1
    chown -R oracle:oinstall /u02/oradata
    chmod -R 775 /u02/oradata
  5. Create a New Tablespace in the New Filesystem

    $ sqlplus
    SQL*Plus: Release - 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 - 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.
    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.