RHEL5.8安裝Oracle11g

一、安裝環境
[root@rusky-oracle11g ~]# uname -r
2.6.18-308.el5
[root@rusky-oracle11g ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
Kernel \r on an \m
[root@rusky-oracle11g ~]# uname -a
Linux rusky-oracle11g.com 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linuxphp


二、主機名及IP設置爲以下
[root@localhost local_repo]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.201 rhel201.com rhel201html

[root@localhost local_repo]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=rhel201.comlinux

[root@localhost local_repo]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:0C:29:C5:02:E2
ONBOOT=yes
IPADDR=192.168.1.201
NETMASK=255.255.255.0
GATEWAY=192.168.1.1c++

三、關閉selinux及防火牆
[root@rusky-oracle11g ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targetedbash


關閉防火牆:
[root@rusky-oracle11g ~]#chkconfig iptables off
[root@rusky-oracle11g ~]#service iptables stopsession


三、內核及其它相關參數設置
[root@rusky-oracle11g ~]# cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
#oracle

#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
# End of fileapp

 

 /sbin/sysctl -p 執行這條命令使配置生效

[root@rusky-oracle11g ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session optional pam_keyinit.so force revoke
session required pam_loginuid.so
session include system-auth
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so opendom

session required pam_limits.soide


四、安裝所需的包
配置本地yum源,使用yum命令安裝所需包。參考連接:http://www.cnblogs.com/rusking/p/4248946.html
The following or later version of packages for Asianux 3, Oracle Linux 5, and Red Hat Enterprise Linux 5 must be installed:

binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
還要下面這三個包也安裝:
On Asianux Server 3, Oracle Linux 5, and Red Hat Enterprise Linux 5:
unixODBC-2.2.11 (32-bit) or later
unixODBC-devel-2.2.11 (64-bit) or later
unixODBC-2.2.11 (64-bit) or later

最好重啓機器,以確保以前配置的相關內容生效。

五、建立用戶及組
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
passwd oracle


六、建立安裝目錄及受權
Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/11.2.0.4/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
If you are using X Emulation, login as root and issue the following command.

xhost +

七、設置oracle用戶環境變量
Login as the oracle user and add the following lines at the end of the "/home/oracle/.bash_profile" file.
以oracle用戶登陸添加以下內容到這個文件:/home/oracle/.bash_profile(注意修改紅色部份內容)
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=rhel201.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.1/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

===================================
修改系統環境變量/etc/profile
修改環境變量/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
八、執行安裝
installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

[root@rusky-oracle11g ~]#DISPLAY=192.168.1.201:0.0; export DISPLAY

或者是以root用戶登陸,執行該命令:xhost + 

切換到oracle用戶,輸入命令:xclock,正常的話會出現圖形界面的時鐘。以後,可執行./runInstaller在圖形界面安裝Oracle。
Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.

./runInstaller DISPLAY報錯處理:http://www.cnblogs.com/rusking/p/4232835.html

《參數文檔: http://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-7.php》

九、安裝報錯

 

9.1 During the link phase you will encounter an error invoking the "ins_emagent.mk" file. To fix this, edit the "$ORACLE_HOME/sysman/lib/ins_emagent.mk", doing a search and replace for the line shown below.

 

FROM:
$(MK_EMAGENT_NMECTL)
TO  :
$(MK_EMAGENT_NMECTL) -lnnz11

 

Click the "Retry" button.

9.2 安裝過程當中-檢查環境缺乏pdksh包,忽略即中

Proceed with the installation of your choice. You can see type of installation I performed by clicking on the links below to see screen shots of each stage. The "pdksh" package will be listed as missing, which can be ignored because we installed the "ksh" package instead.

相關文章
相關標籤/搜索