CentOS5.6下安裝Oracle10G軟體 【保留報錯經驗】

黃炎龍發表於2014-07-26

CentOS5.6下安裝Oracle10G

********************************************************************************

*目標:在Centos系統下,安裝Oracle10g軟體

*步驟:

*                1、安裝包

*                2、域名解析設定及網路配置

*                3、建立使用者、組

*                4、配置核心引數、修改環境變數

*                5、設定shell限制

*                6、建立相關目錄、賦權

*                7、遠端圖形化安裝Oracle軟體

*******************************************************************************

1、安裝包

--掛載光碟

[root@localhost CentOS]#mount /dev/hdb /media --通過df -h檢視到相關目錄,依實際情況掛載

--配置yum

[root@localhost CentOS]# cd /etc/yum.repos.d/  --進入到該目錄下生成一個配置檔案

[root@localhost CentOS]# ls

[root@localhost CentOS]# cp CentOS-Debuginfo.repo yum.repo  --做一個拷貝

[root@localhost CentOS]# mv  CentOS-Debuginfo.repo    CentOS-Debuginfo.repo.bak  

[root@localhost CentOS]#cp * /hylbak  --yum.repos.d下檔案做一個備份

[root@localhost CentOS]#rm -rf Centos* --將無關檔案刪除

[root@localhost CentOS]#vi yum.repo

[debug]

name=CentOS-6 - Debuginfo

baseurl=file:///media                  --此處光碟掛載到了media目錄下

enabled=1

gpgcheck=0

#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6

~

~

[root@localhost CentOS]#yum install -y binutils-2.17.50.0.6   --舉例:使用yum安裝格式

[root@localhost CentOS]#rpm -q binutils-2.17.50.0.6   --舉例:使用rpm檢視軟體包安裝情況

--修改:不要按下面參考文件提示安裝,第一次按其安裝出錯

--安裝時需要使用下文修改的“黃色”標記安裝方案

--保留第一次缺失安裝包參考,引以為戒

--安裝包缺失時參考如下文件所致

--下表為第一次安裝,安裝後續發現出現包不全狀況,對其包進行更正和補充,若實際安裝採用之後的安裝包方案,此處不做刪除以示反例

 

安裝包參考(提醒:不要按此安裝,實際安裝見後文)

參考文件提示安裝包

實際通過光碟安裝包

binutils-2.17.50.0.6

binutils-2.17.50.0.6

compat-libstdc++-33-3.2.3

compat-libstdc++-33-3.2.3-61

elfutils-libelf-0.125

elfutils-libelf-0.137

elfutils-libelf-devel-0.125

elfutils-libelf-devel-0.137

elfutils-libelf-devel-static-0.125

elfutils-libelf-devel-static-0.137

gcc-4.1.2

gcc-4.1.2

gcc-c++-4.1.2

gcc-c++-4.1.2

glibc-common-2.5

glibc-common-2.5

glibc-devel-2.5

glibc-devel-2.5

glibc-headers-2.5

glibc-headers-2.5

kernel-headers-2.6.18

kernel-headers-2.6.18

ksh-20060214

ksh-20100202-1.el5_5.1

libaio-0.3.106

libaio-0.3.106

libaio-devel-0.3.106

libaio-devel-0.3.106

libgcc-4.1.2

libgcc-4.1.2

libgomp-4.1.2

libgomp-4.4.4-13.el5.x86_64

libstdc++-4.1.2

libstdc++-4.1.2

libstdc++-devel-4.1.2

libstdc++-devel-4.1.2

make-3.81

make-3.81

sysstat-7.0.2

sysstat-7.0.2

unixODBC-2.2.11(32 bit)

unixODBC-2.2.11-7.1

unixODBC-devel

unixODBC-devel-2.2.11-7.1.x86_64

pdksh-5.2.14

pdksh-5.2.14-36.el5

numactl-0.9.8

numactl-0.9.8

libXp-1.0.0

libXp-1.0.0

libXp-devel-1.0.0

libXp-devel-1.0.0-8.1.el5.x86_64、libXp-devel-1.0.0-8.1.el5.i386.rpm

libXau-devel-1.0.1

libXau-devel-1.0.1

 

 

--按錯誤參考安裝包指令

yuminstall -y binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3-61elfutils-libelf-0.137 elfutils-libelf-devel-0.137elfutils-libelf-devel-static-0.137 gcc-4.1.2 gcc-c++-4.1.2 glibc-common-2.5glibc-devel-2.5 glibc-headers-2.5 kernel-headers-2.6.18 ksh-20100202-1.el5_5.1libaio-0.3.106 libaio-devel-0.3.106 libgcc-4.1.2 libgomp-4.4.4-13.el5.x86_64libstdc++-4.1.2 libstdc++-devel-4.1.2 make-3.81 sysstat-7.0.2unixODBC-2.2.11-7.1 unixODBC-devel-2.2.11-7.1.x86_64 pdksh-5.2.14-36.el5numactl-0.9.8 libXp-1.0.0 libXp-devel-1.0.0-8.1.el5.x86_64libXp-devel-1.0.0-8.1.el5.i386.rpm libXau-devel-1.0.1

 

正確安裝包方案(使用以下安裝包流程,經過二次驗證成功)

--使用以下安裝包方案

--根據多次試驗,執行如下指令,安裝包

 

--安裝常用軟體

[root@hyl ~]# yum -y install autoconf automake binutils-devel bisoncpp dos2unix ftp gcc gcc-c++ lrzsz python-devel

 

--安裝 Oracle必需軟體:

[root@hyl ~]# yum -y install  compat-db  compat-db42 compat-db43  compat-gcc-34  compat-gcc-34-c++  compatlibstdc++-33 glibc-* glibc-*.i686libXpm-*.i686 libXp.so.6 libXt.so.6 libXtst.so.6 libgcc_s.so.1 ksh libXp libaio-develnumactl numactl-devel unixODBC unixODBC-devel

 

[root@hyl ~]# yum -y install glibc-devel.i386 glibc-devel.x86_64compat-db.i386 compat-db.x86_64 compat-libstdc++-296.i386compat-libstdc++-33.i386 compat-libstdc++-33.x86_64

 

[root@hyl ~]# yum -y install compat-gcc-34.x86_64compat-gcc-34-c++.x86_64 gcc.x86_64 gcc-c++.x86_64 pdksh.x86_64 openmotif.i386openmotif.x86_64 sysstat.x86_64

 

--驗證安裝包情況

[root@hyl yum.repos.d]# rpm -q glibc-devel.i386 glibc-devel.x86_64 compat-db.i386 compat-db.x86_64 compat-libstdc++-296.i386compat-libstdc++-33.i386 compat-libstdc++-33.x86_64

glibc-devel-2.5-58

glibc-devel-2.5-58

compat-db-4.2.52-5.1

compat-db-4.2.52-5.1

compat-libstdc++-296-2.96-138

compat-libstdc++-33-3.2.3-61

compat-libstdc++-33-3.2.3-61

[root@hyl yum.repos.d]# rpm -q compat-gcc-34.x86_64compat-gcc-34-c++.x86_64 gcc.x86_64 gcc-c++.x86_64 pdksh.x86_64 openmotif.i386openmotif.x86_64 sysstat.x86_64

compat-gcc-34-3.4.6-4.1

compat-gcc-34-c++-3.4.6-4.1

gcc-4.1.2-50.el5

gcc-c++-4.1.2-50.el5

pdksh-5.2.14-36.el5

openmotif-2.3.1-5.el5_5.1

openmotif-2.3.1-5.el5_5.1

sysstat-7.0.2-3.el5_5.1


2、域名解析設定及網路配置

[root@localhost CentOS]# vi /etc/hosts

127.0.0.1         localhost.localdomain localhost

::1              localhost6.localdomain6localhost6

192.168.56.103   hyl

[root@localhost CentOS]# vi/etc/sysconfig/network-scripts/ifcfg-eth0

# Intel Corporation 82540EM Gigabit Ethernet Controller

DEVICE=eth0

BOOTPROTO=static

IPADDR=192.168.56.103

NETMASK=255.255.255.0

HWADDR=08:00:27:29:DB:B2

ONBOOT=yes

~

~

[root@localhost CentOS]# service network restart

正在關閉介面 eth0:                                        [確定]

關閉環回介面:                                             [確定]

禁用 IPv4 包轉送:net.ipv4.ip_forward = 0

                                                          [確定]

彈出環回介面:                                             [確定]

彈出介面 eth0:                                            [確定]

[root@localhost CentOS]# vi /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

#HOSTNAME=localhost.localdomain

HOSTNAME=hyl

~

~

[root@localhost CentOS]# su - 

3、建立使用者、組

[root@hyl ~]# groupadd oinstall

[root@hyl ~]# groupadd dba

[root@hyl ~]# useradd -g oinstall -G dba oracle

[root@hyl ~]# passwd oracle

Changingpassword for user oracle.

New UNIXpassword: oracle

BADPASSWORD: it is based on a dictionary word

Retypenew UNIX password: oracle

passwd:all authentication tokens updated successfully.

[root@hyl ~]# id oracle

uid=501(oracle)gid=501(oinstall) groups=501(oinstall),502(dba)

4、配置核心引數、修改環境變數

[root@hyl ~]# vi /etc/sysctl.conf

新增:

kernel.shmall = 4294967296

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65500

net.core.rmem_default = 4194304

net.core.wmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_max = 262144

~

"/etc/sysctl.conf" 43L, 1228C written

[root@hyl ~]# 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= 68719476736

kernel.shmall= 4294967296

kernel.shmmni= 4096

kernel.sem= 250 32000 100 128

fs.file-max= 65536

net.ipv4.ip_local_port_range= 1024 65500

net.core.rmem_default= 4194304

net.core.wmem_default= 262144

net.core.rmem_max= 4194304

net.core.wmem_max= 262144

 

--修改oracle使用者的環境配置檔案

--執行:su - oracle切換到oracle使用者環境,然後編輯 .bash_profile檔案,更改PATH的配置,同時在環境變數中增加NLS_LANG的配置

[root@hyl yum.repos.d]# su - oracle

[oracle@hyl ~]$ vi .bash_profile

ORACLE_BASE=/home/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

ORACLE_SID=xcky

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH

5、設定 shell 限制

--新增以下引數

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

oracle              soft    nproc  2047

oracle              hard    nproc  16384

oracle              soft    nofile 1024

oracle              hard    nofile 65536

[root@hyl ~]# vi /etc/pam.d/login

--新增以下引數

session    required     /lib/security/pam_limits.so

session    required     pam_limits.so

[root@hyl ~]# vi /etc/profile                                         --新增以下引數

if [ $USER = "oracle" ]; then

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

              ulimit -p 16384

              ulimit -n 65536

        else

              ulimit -u 16384-n 65536

        fi

fi

--/etc/profile檔案中修改以下內容

ulimit –s –c 0 >/dev/null 2> &1 修改為

ulimit –s –c unlimited >/dev/null 2> &1

6、建立相關目錄、賦權

[root@hyl ~]# mkdir -p /home/u01/app/oracle

[root@hyl ~]# mkdir -p /home/u01/app/oracle/oraInventory

[root@hyl ~]# chown -R oracle:oinstall /home/u01/app/oracle

[root@hyl ~]# chmod -R 775 /home/u01/app/oracle

 

[oracle@hyl home]# mkdir -p /home/oracle/downloads

[root@hyl ~]# chown -R oracle:oinstall /home/oracle/downloads

--上傳安裝包

[root@hyl downloads]# zcat 10201_database_linux_x86_64.cpio.gz |cpio -idmv > /dev/null 2>&1  --上傳安裝包後,解壓安裝包

 

[root@hyl install]# vi/home/oracle/downloads/database/install/oraparam.ini

--新增redhat-5如下所示

[Certified Versions]

Linux=redhat-5,redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2

7、遠端圖形化安裝 Oracle 軟體

--使用X-manager軟體呼叫圖形化介面,操作參考如下


$./runInstaller    -X-manager下執行,出現亂碼問題

--以下解決亂碼問題

[root@hyl ~]# vi /etc/sysconfig/i18n

LANG="en_US.UTF-8"

#LANG="zh_CN.UTF-8"

~

~

--按參看下圖,輸入export指令











--安裝過程報錯:Errorinvoking target ‘install’ of makefile

--修改:以下報錯皆為第一次缺失包情況,若按上文修改後文件安裝包,將不會出現如下報錯

--保留報錯截圖,引以為戒


--rpm安裝缺失的包

[root@hyl CentOS]# find -name "compat-libstdc*"

./compat-libstdc++-296-2.96-138.i386.rpm

./compat-libstdc++-33-3.2.3-61.x86_64.rpm

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

[root@hyl CentOS]# rpm -ivh compat-libstdc++-296-2.96-138.i386.rpm

warning:compat-libstdc++-296-2.96-138.i386.rpm: Header V3 DSA signature: NOKEY, key IDe8562897

error:failed to stat /media/CentOS_5.6_Final: 沒有那個檔案或目錄

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

   1:compat-libstdc++-296   ###########################################[100%]

[root@hyl CentOS]# rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm

warning:compat-libstdc++-33-3.2.3-61.x86_64.rpm: Header V3 DSA signature: NOKEY, key IDe8562897

error:failed to stat /media/CentOS_5.6_Final: 沒有那個檔案或目錄

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

        packagecompat-libstdc++-33-3.2.3-61.x86_64 is already installed

[root@hyl CentOS]# 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 IDe8562897

error:failed to stat /media/CentOS_5.6_Final: 沒有那個檔案或目錄

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

        packagecompat-libstdc++-33-3.2.3-61.i386 is already installed

--嘗試點選Retry繼續

--再次報錯:Error invokingtarget‘agent nmo nmb’of makefile


--使用yum安裝如下包

glib-devel-1.2.10-20.el5 (i386)

glib-devel-1.2.10-20.el5 (x86_64)

glibc-devel-2.5-81.el5_8.2 (x86_64)

glibc-devel-2.5-81.el5_8.2 (i386)

--嘗試點選Retry繼續

--再次報錯,嘗試點選“Continue”繼續



[root@hyl ~]# /home/u01/app/oracle/oraInventory/orainstRoot.sh

Changingpermissions of /home/u01/app/oracle/oraInventory to 770.

Changinggroupname of /home/u01/app/oracle/oraInventory to oinstall.

Theexecution of the script is complete

[root@hyl ~]# /home/u01/app/oracle/product/10.2.0/db_1/root.sh

RunningOracle10 root.sh script...

Thefollowing environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /home/u01/app/oracle/product/10.2.0/db_1

Enterthe full pathname of the local bin directory: [/usr/local/bin]:

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...

Creating/etc/oratab file...

Entrieswill be added to the /etc/oratab file as needed by

DatabaseConfiguration Assistant when a database is created

Finishedrunning generic part of root.sh script.

Nowproduct-specific root actions will be performed.


--軟體安裝結束,由於過程中報錯,軟體安裝可能不成功,嘗試啟動dbca

$dbca --X-manager下無法啟動dbca

--刪除/home/oracleoracle安裝檔案,重新安裝軟體

--由於之前安裝過程中,出現缺失包情況,重新查閱官方文件,重新安裝和檢查需要的包

--此時注意到安裝包位數的區別,安裝64位的安裝包

[root@hyl ~]# yum -y install glibc-devel.i386 glibc-devel.x86_64compat-db.i386 compat-db.x86_64 compat-libstdc++-296.i386compat-libstdc++-33.i386 compat-libstdc++-33.x86_64

 

[root@hyl ~]# yum -y install compat-gcc-34.x86_64compat-gcc-34-c++.x86_64 gcc.x86_64 gcc-c++.x86_64 pdksh.x86_64 openmotif.i386openmotif.x86_64 sysstat.x86_64

 

--按照上文圖形化安裝oracle步驟,重新安裝oracle軟體,直到執行指令碼介面彈出,此時只需跑一個指令碼,如下圖


[root@hyl /]# /home/u01/app/oracle/product/10.2.0/db_1/root.sh

RunningOracle10 root.sh script...

 

Thefollowing environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /home/u01/app/oracle/product/10.2.0/db_1

 

Enter thefull pathname of the local bin directory: [/usr/local/bin]:

The file"dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying dbhome to /usr/local/bin ...

The file"oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file"coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...

 

Entrieswill be added to the /etc/oratab file as needed by

DatabaseConfiguration Assistant when a database is created

Finishedrunning generic part of root.sh script.

Nowproduct-specific root actions will be performed.

--按提示,點選完成結束oracle軟體的安裝

--經驗證,此次安裝oracle軟體成功,已經可以dbca建庫


說明:有關dbca建庫,請關注後續文章。


***********************************************宣告************************************************ 

原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明出處(http://blog.csdn.net/huangyanlong)。

表述有錯誤之處,請您留言,不勝感激。

提醒:點選目錄,更有助於您的檢視。

*****************************************************************************************************
























相關文章