Oracle Linux 5.5 安裝Oracle 10g

wuweilong發表於2011-11-17

Oracle Linux5.3上安裝資料庫

1、檢查作業系統版本

[root@ora10g ~]# uname -a

Linux ora10g.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:47 EDT 2009 i686 i686 i386 GNU/Linux

 

[root@ora10g ~]# lsb_release -a

LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch

Distributor ID: EnterpriseEnterpriseServer

Description:    Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)

Release:        5.4

Codename:       Carthage

 

2、檢查記憶體大小

[root@ora10g ~]# free

             total       used       free     shared    buffers     cached

Mem:       1035140     339916     695224          0      19824     267012

-/+ buffers/cache:      53080     982060

Swap:      2096440          0    2096440

 

3、  檢查磁碟空間利用率,

我們打算在 /orasoft 安裝資料庫軟體

我們打算在 /oradata 目錄中存放資料檔案和歸檔日誌

[root@ora10g ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda7             4.7G  3.0G  1.6G  66% /

/dev/sda6             2.0G   36M  1.9G   2% /tmp

/dev/sda3             4.9G  139M  4.5G   3% /orasoft

/dev/sda2             5.8G  141M  5.4G   3% /oradata

/dev/sda1             190M   12M  170M   7% /boot

tmpfs                 506M     0  506M   0% /dev/shm

 

4、建立相關的使用者及使用者組和相關目錄,並修改許可權和所有者及所屬組

[root@ora10g ~]# groupadd dba

[root@ora10g ~]# groupadd oinstall

[root@ora10g ~]# useradd -m -g oinstall -G dba -d /orasoft/home oracle

[root@ora10g ~]# passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based on a dictionary word

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

 

[root@ora10g ~]# chown -R oracle:oinstall /orasoft/ /oradata/

[root@ora10g ~]# chmod -R 755 /orasoft/ /oradata/

[root@ora10g ~]# cd/

-bash: cd/: No such file or directory

[root@ora10g ~]# cd /

[root@ora10g /]# ls -rtl

total 162

drwxr-xr-x  2 root   root      4096 Jan  9  2009 srv

drwxr-xr-x  2 root   root      4096 Jan  9  2009 opt

drwxr-xr-x  2 root   root      4096 Jan  9  2009 mnt

drwxr-xr-x  2 root   root      4096 Jan  9  2009 media

drwxr-xr-x  2 root   root      4096 Jan  9  2009 home

drwx------  2 root   root     16384 Nov 16 22:40 lost+found

drwxr-xr-x  2 root   root      4096 Nov 16 22:41 selinux

drwxr-xr-x 14 root   root      4096 Nov 16 22:46 usr

drwxr-xr-x  3 root   root      4096 Nov 16 22:49 tftpboot

drwxr-xr-x  4 root   root      1024 Nov 16 22:52 boot

drwxr-xr-x 13 root   root      4096 Nov 16 22:53 lib

drwxr-xr-x  2 root   root      4096 Nov 16 22:53 bin

drwxr-xr-x  2 root   root     12288 Nov 16 22:53 sbin

drwxr-xr-x 23 root   root      4096 Nov 16 22:58 var

drwxr-xr-x  3 oracle oinstall  4096 Nov 16 23:00 oradata

dr-xr-xr-x 94 root   root         0 Nov 16 23:30 proc

drwxr-xr-x 11 root   root         0 Nov 16 23:30 sys

drwxr-xr-x  2 root   root         0 Nov 16 23:31 misc

drwxr-xr-x  2 root   root         0 Nov 16 23:31 net

drwxrwxrwt  7 root   root      4096 Nov 16 23:31 tmp

drwxr-xr-x 11 root   root      3580 Nov 16 23:31 dev

drwxr-x---  6 root   root      4096 Nov 16 23:39 root

drwxr-xr-x  4 oracle oinstall  4096 Nov 16 23:46 orasoft

drwxr-xr-x 99 root   root     12288 Nov 16 23:46 etc

 

4、  修改核心引數 

在檔案最後新增如下內容,相關引數介紹將會在後期的oracle安裝引數詳解中進行介紹,有興趣的朋友可以繼續關注

[root@ora10g /]# vi /etc/sysctl.conf

--這部分為共享記憶體引數設定

kernel.shmall = 2097152        --共享記憶體段最大頁數

kernel.shmmax = 2147483648   --單個共享記憶體段大小的上限位元組數

kernel.shmmni = 4096         --共享記憶體段的最小長度

 

kernel.sem = 250 32000 100 128  --訊號量四個值分別代表:semmsl,semmns,semopm,semmni

fs.file-max = 65536             --配置系統中開啟的最大檔案數

net.ipv4.ip_local_port_range = 1024 65000   --本地網口限速

 

=262144

net.core.rmem_max=262144

net.core.wmem_default=262144

net.core.wmem_max=262144

 

 

"/etc/sysctl.conf" 47L, 1280C written

 

[root@ora10g /]# /sbin/sysctl -p

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 4294967295

kernel.shmall = 268435456

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

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.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

 

5、  修改安全限制引數

這兩個引數是對linux使用者可以使用的程式數和開啟的檔案數的設定限制

|'G
oxf%O l2UU
soft是軟限制:使用者可以超過這個設定的值,但一定不能超過hard 的值

hard是硬限制:一般softhard小。

如果用LV管理的話,還需要加上如下兩行:
M$K
c2C&[^doracle,db2,sqlserver,sybase,mysql,erp,scm,sap,java,.net
oracle soft memlock 3145728
x2e_


hB_)sloracle hard memlock 3145728 oracle,db2,sqlserver,sybase,mysql,erp,scm,sap,java,.net:}3y,Y6]-X0LY

[root@ora10g /]# vi /etc/security/limits.conf

oracle soft nproc 2047     --

oracle hard nproc 16384   --單使用者可開啟的最大程式數為16384

oracle soft nofile 1024     --

oracle hard nofile 65536   --可開啟最大檔案個數65536

 

"/etc/security/limits.conf" 56L, 1903C written

 

 

7、配置相關的限制

[root@ora10g /]# vi

/lib/security/pam_limits.so    ---設定可插入認證模組(PAM)限制

session required pam_limits.so              ---oracle設定Shell限制

"/etc/pam.d/login" 18L, 722C written

 

8、新增如下系統環境變數

[root@ora10g /]# vi /etc/profile

# /etc/profile

 

if [ $USER = "oracle" ]; then

    if [ $SHELL = "/bin/ksh" ]; then

        ulimit -p 1638

        ulimit -n 65536

    else

        ulimit -u 16384 -n 65536

    fi

fi

 

 

"/etc/profile" 68L, 1205C written

 

9、切換到oracle使用者下,建立相關oracle安裝的其它目錄和配置環境變數

[root@ora10g /]# su - oracle

[oracle@ora10g ~]$ mkdir -p /orasoft/product/10.2.0/db_1

[oracle@ora10g ~]$ mkdir -p /oradata/archive /oradata/admin /oradata/flash_back /oradata/wwl

 

10、經過檢查,目錄已經建立好了。

[oracle@ora10g /]$  cd oradata/

[oracle@ora10g oradata]$ ls

admin  archive  flash_back  lost+found  wwl

[oracle@ora10g oradata]$ ls -rtl

total 32

drwxr-xr-x 2 oracle oinstall 16384 Nov 16 22:41 lost+found

drwxr-xr-x 2 oracle oinstall  4096 Nov 16 23:51 archive

drwxr-xr-x 2 oracle oinstall  4096 Nov 16 23:51 wwl

drwxr-xr-x 2 oracle oinstall  4096 Nov 16 23:51 flash_back

drwxr-xr-x 2 oracle oinstall  4096 Nov 16 23:51 admin

 

 

11、進入使用者家目錄,修改bash_profile,新增使用者變數

[oracle@ora10g /]$ cd

[oracle@ora10g ~]$ vi .bash_profile

                           

[oracle@ora10g ~]$ cat .bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

 

export PATH

 

export ORACLE_SID=wwl              ---指定ORACLE SID

export ORACLE_BASE=/orasoft/        ---指定ORACLE_BASE目錄

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1   ---指定ORACLE_HOME目錄

export PATH=$PATH:$ORACLE_HOME/bin                   ---指定對應的命令執行PATH

export LD_LIBARY_PATH=$ORACLE_HOME/lib               --指定庫檔案存放的路徑

export LANG="zh_CN.GB18030";                         ---指定使用者語言

export PATH

umask 022

 

[oracle@ora10g ~]$ source ~/.bash_profile    ---讓剛新增的環境變數立即生效

12、關閉sendmail以及smb等無用的服務,並設定不自動啟動,開啟FTP服務,一會兒穿安裝介質上來。

[root@ora10g ~]# chkconfig sendmail off

[root@ora10g ~]# chkconfig cups off

[root@ora10g ~]# service vsftpd restart

Shutting down vsftpd: [FAILED]

Starting vsftpd for vsftpd: [  OK  ]

13、檢查如下軟體包是否都安裝了:

libXp-1.0.0-8.i386.rpm

openmotif22-2.2.3-18.i386.rpm

compat-db-4.2.52-5.1.i386.rpm

compat-gcc-34-3.4.6-4.i386.rpm

compat-gcc-34-c++-3.4.6-4.i386.rpm

compat-libstdc++-33-3.2.3-61.i386.rpm

libaio-0.3.106-3.2.i386.rpm

 

 

[root@ora10g ~]# rpm -qa|grep libXp-*

libXpm-3.5.5-3

libXp-devel-1.0.0-8.1.el5

libXpm-devel-3.5.5-3

libXp-1.0.0-8.1.el5

[root@ora10g ~]# rpm -qa|grep openmoti*

[root@ora10g ~]# rpm -qa|grep openmoti

[root@ora10g ~]# rpm -qa|grep open*

openssl-0.9.8e-12.el5

openjade-1.3.2-27

nautilus-open-terminal-0.6-6.el5

cscope-15.5-15.1.el5_3.1

openldap-devel-2.3.43-3.el5

openssh-server-4.3p2-36.el5

openldap-2.3.43-3.el5

openssh-4.3p2-36.el5

openssh-askpass-4.3p2-36.el5

openssl-devel-0.9.8e-12.el5

opensp-1.5.2-4

openssh-clients-4.3p2-36.el5

[root@ora10g ~]# rpm -qa|grep openm*

openssl-0.9.8e-12.el5

openjade-1.3.2-27

nautilus-open-terminal-0.6-6.el5

openldap-devel-2.3.43-3.el5

openssh-server-4.3p2-36.el5

openldap-2.3.43-3.el5

openssh-4.3p2-36.el5

openssh-askpass-4.3p2-36.el5

openssl-devel-0.9.8e-12.el5

opensp-1.5.2-4

openssh-clients-4.3p2-36.el5

[root@ora10g ~]# rpm -qa|grep compat-db*

java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115

[root@ora10g ~]# rpm -qa|grep compat-db

[root@ora10g ~]# rpm -qa|grep compa

compat-libgcc-296-2.96-138

compat-gcc-34-3.4.6-4

compat-gcc-34-g77-3.4.6-4

compat-libstdc++-296-2.96-138

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

java-1.4.2-gcj-compat-src-1.4.2.0-40jpp.115

compat-glibc-headers-2.3.4-2.26

java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115

avahi-compat-libdns_sd-0.6.16-6.el5

compat-libf2c-34-3.4.6-4

compat-libcom_err-1.0-7

compat-gcc-34-c++-3.4.6-4

compat-libstdc++-33-3.2.3-61

compat-glibc-2.3.4-2.26

[root@ora10g ~]# rpm -qa|grep compat-lib

compat-libgcc-296-2.96-138

compat-libstdc++-296-2.96-138

avahi-compat-libdns_sd-0.6.16-6.el5

compat-libf2c-34-3.4.6-4

compat-libcom_err-1.0-7

compat-libstdc++-33-3.2.3-61

 

14、掛載光碟,進行為未安裝的軟體包安裝

[root@ora10g media]# mount -t iso9660 /dev/cdrom /mnt

mount: block device /dev/cdrom is write-protected, mounting read-only

[root@ora10g media]# cd /mnt

[root@ora10g mnt]# ls

blafdoc.css     eula.py    README-en.html         Server

Cluster         GPL        RELEASE-NOTES-en       supportinfo

ClusterStorage  images     RELEASE-NOTES-en.html  TRANS.TBL

EULA            isolinux   RPM-GPG-KEY            VT

eula.en_US      README-en  RPM-GPG-KEY-oracle

[root@ora10g mnt]# cd Server/

 

[root@ora10g Server]# rpm -ivh openmotif22-2.2.3-18.i386.rpm

warning: openmotif22-2.2.3-18.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:openmotif22            ########################################### [100%]

[root@ora10g Server]# rpm -ivh compat-gcc-34-

compat-gcc-34-3.4.6-4.i386.rpm      compat-gcc-34-g77-3.4.6-4.i386.rpm

compat-gcc-34-c++-3.4.6-4.i386.rpm 

[root@ora10g Server]# rpm -ivh compat-gcc-34-3.4.6-4.i386.rpm

warning: compat-gcc-34-3.4.6-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

        package compat-gcc-34-3.4.6-4.i386 is already installed

[root@ora10g Server]# rpm -ivh compat-gcc-34-c++-3.4.6-4.i386.rpm

warning: compat-gcc-34-c++-3.4.6-4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

        package compat-gcc-34-c++-3.4.6-4.i386 is already installed

[root@ora10g Server]# rpm -ivh compat-db-4.2.52-5.1.i386.rpm

warning: compat-db-4.2.52-5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:compat-db              ########################################### [100%]

[root@ora10g Server]# rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm

warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

        package compat-libstdc++-33-3.2.3-61.i386 is already installed

[root@ora10g Server]# rpm -ivh compat-libstdc++-

compat-libstdc++-296-2.96-138.i386.rpm  compat-libstdc++-33-3.2.3-61.i386.rpm

[root@ora10g Server]# rpm -ivh libaio-0.3.106-3.2.i386.rpm

warning: libaio-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

        package libaio-0.3.106-3.2.i386 is already installed

 

15解壓縮剛上傳上來的介質

[root@ora10g Server]# su - oracle

[oracle@ora10g ~]$ ls

10201_database_linux32.zip

[oracle@ora10g ~]$ unzip 10201_database_linux32.zip

Archive:  10201_database_linux32.zip

   creating: database/

   creating: database/doc/

   creating: database/doc/dcommon/

  …….中間過程太多,已經省略

  creating: database/stage/fastcopy/

  inflating: database/stage/fastcopy/setperms1.sh 

  inflating: database/stage/fastcopy/oracle.server_EE_1.xml 

  inflating: database/stage/fastcopy/oracle.server_EE_exp_1.xml 

  inflating: database/stage/fastcopy/oracle.server_EE_dirs.lst 

  inflating: database/stage/fastcopy/oracle.server_EE_filemap.jar 

  inflating: database/stage/fastcopy/oracle.server_SE_1.xml 

  inflating: database/stage/fastcopy/oracle.server_SE_exp_1.xml 

  inflating: database/stage/fastcopy/oracle.server_SE_dirs.lst 

  inflating: database/stage/fastcopy/oracle.server_SE_filemap.jar 

  inflating: database/stage/fastcopy/oracle.server_Custom_1.xml 

  inflating: database/stage/fastcopy/oracle.server_Custom_exp_1.xml 

  inflating: database/stage/fastcopy/oracle.server_Custom_dirs.lst 

  inflating: database/stage/fastcopy/oracle.server_Custom_filemap.jar 

  inflating: database/stage/fastcopy/racfiles.jar 

  inflating: database/stage/oracle.server.10_2_0_1_0_1120187896349.bak 

  inflating: database/stage/oracle.server.10_2_0_1_0_dep_default.properties 

  inflating: database/stage/oracle.server.10_2_0_1_0_1120187896411.bak 

  inflating: database/stage/fastcopy.xml 

  inflating: database/welcome.html  

16、配置顯示終端:

[oracle@ora10g ~]$ export DISPLAY=192.168.5.1:0.0

[oracle@ora10g ~]$ xclock

Warning: Missing charsets in String to FontSet conversion

[oracle@ora10g ~]$ ls

c10201_database_linux32.zip  database

[oracle@ora10g ~]$ rm -rf 10201_database_linux32.zip

[oracle@ora10g ~]$ cd database/

[oracle@ora10g database]$ ls

doc  install  response  runInstaller  stage  welcome.html

 

17、開始正式安裝,加上-ignoreSysPreReqs該引數的目的是忽略系統版本好檢測。

[oracle@ora10g database]$ export LC_ALL=en_US

[oracle@ora10g database]$ ./runInstaller -ignoreSysPreReqs

Starting Oracle Universal Installer...

 

Checking installer requirements...

 

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2

                                      Passed

 

 

All installer requirements met.

 

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-11-17_12-16-27AM. Please wait ...[oracle@ora10g database]$ Oracle Universal Installer, Version 10.2.0.1.0 Production

Copyright (C) 1999, 2005, Oracle. All rights reserved.

 

 

詳細安裝過程見連線

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20674423/viewspace-711099/,如需轉載,請註明出處,否則將追究法律責任。

相關文章