操作规范(二)——RHEL 5.4安装Oracle 10.2.0.4
本文PDF版下载 http://www.itpub.net/attachment.php?aid=721748
作者:xunzhao【转载时请以超链接形式标明文章出处和作者信息】
链接:http://xunzhaoxz.itpub.net/post/40016/518416
[oracle@LinuxNBU65 database]$ uname -a
Linux LinuxNBU65 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux
[oracle@LinuxNBU65 database]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[oracle@LinuxNBU65 database]$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Release: 5.4
Codename: Tikanga
[oracle@LinuxNBU65 database]$
[@more@]1. 系统环境准备
1.1. 创建组、用户
[root@LinuxNBU65 /]# groupadd -g 501 oinstall
[root@LinuxNBU65 /]# groupadd -g 502 dba
[root@LinuxNBU65 /]# useradd -u 501 -g oinstall -G dba oracle
[root@LinuxNBU65 /]# passwd oracle
[root@LinuxNBU65 /]# mkdir /oracle
[root@LinuxNBU65 /]# chown -R oracle:oinstall /oracle
1.2. 提高 Oracle 用户的 shell 限制
使用文本编辑器将下面列出的行添加到/etc/security/limits.conf、/etc/pam.d/login 和 /etc/profile。
1.2.1. /etc/security/limits.conf
[root@LinuxNBU65 ~]#vi /etc/security/limits.conf 添加以下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
1.2.2. /etc/pam.d/login
[root@LinuxNBU65 ~]# vi /etc/pam.d/login 添加以下内容
session required pam_limits.so
1.2.3. /etc/profile
[root@LinuxNBU65 ~]#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
1.3. 配置内核参数。
使用文本编辑器将下面列出的行添加到 /etc/sysctl.conf。要使更改立即生效,请执行sysctl –p。
[root@LinuxNBU65 ~]#vi /etc/sysctl.conf 添加以下内容
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 101365
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
1.4. 修改 /etc/hosts 文件。
# more /etc/hosts 根据实际环境添加相应主机、IP的映射
127.0.0.1 localhost
172.16.250.102 LinuxNBU65
1.5. 检查软件包
[root@LinuxNBU65 rpms]# rpm -q compat-db kernel-headers glibc-headers glibc-devel libgomp gcc libstdc++-devel gcc-c++ ksh sysstat libXp openmotif22 compat-libstdc++ compat-gcc-c++ compat-gcc
compat-db-4.2.52-5.1
kernel-headers-2.6.18-164.el5
glibc-headers-2.5-42
glibc-devel-2.5-42
libgomp-4.4.0-6.el5
gcc-4.1.2-46.el5
libstdc++-devel-4.1.2-46.el5
gcc-c++-4.1.2-46.el5
ksh-20080202-14.el5
sysstat-7.0.0-3.el5
libXp-1.0.0-8.1.el5
package openmotif22 is not installed
package compat-libstdc++ is not installed
package compat-gcc-c++ is not installed
package compat-gcc is not installed
[root@LinuxNBU65 rpms]#
上传并安装缺失的软件包
[root@LinuxNBU65 rpms]# 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 37017186
Preparing... ########################################### [100%]
1:compat-db ########################################### [100%]
[root@LinuxNBU65 rpms]#
[root@LinuxNBU65 rpms]# rpm -ivh sysstat-7.0.0-3.el5.i386.rpm
warning: sysstat-7.0.0-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sysstat ########################################### [100%]
[root@LinuxNBU65 rpms]#
[root@LinuxNBU65 rpms]# rpm -ivh libXp-1.0.0-8.i386.rpm
warning: libXp-1.0.0-8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:libXp ########################################### [100%]
[root@LinuxNBU65 rpms]#
[root@LinuxNBU65 rpms]# rpm -ivh openmotif-2.2.4-0.1.i386.rpm
Preparing... ########################################### [100%]
1:openmotif ########################################### [100%]
[root@LinuxNBU65 rpms]#
[root@LinuxNBU65 rpms]# rpm -ivh compat-libstdc++-7.3-2.96.128.i386.rpm
warning: compat-libstdc++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID 025e513b
Preparing... ########################################### [100%]
file /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so from install of compat-libstdc++-7.3-2.96.128.i386 conflicts with file from package compat-libstdc++-296-2.96-138.i386
[root@LinuxNBU65 rpms]#
[root@LinuxNBU65 rpms]# rpm -e compat-libstdc++-296-2.96-138.i386
[root@LinuxNBU65 rpms]#
[root@LinuxNBU65 rpms]# rpm -ivh compat-gcc-c++-7.3-2.96.128.i386.rpm
compat-gcc-7.3-2.96.128.i386.rpm
compat-libstdc++-devel-7.3-2.96.128.i386.rpm
warning: compat-gcc-c++-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID 73307de6
warning: compat-gcc-7.3-2.96.128.i386.rpm: Header V3 DSA signature: NOKEY, key ID 025e513b
Preparing... ########################################### [100%]
file /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so from install of compat-libstdc++-7.3-2.96.128.i386 conflicts with file from package compat-libstdc++-296-2.96-138.i386
[root@LinuxNBU65 rpms]#
1.6. 检查oracle用户的配置文件
[oracle@LinuxNBU65 ~]$ 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
set -o vi
export ORACLE_SID=rman
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/10.2
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG="American_america.zhs16gbk"
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss';
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
umask 022
[oracle@LinuxNBU65 ~]$ mkdir -p $ORACLE_HOME
1.7. 创建必要的目录并检查权限
[oracle@LinuxNBU65 ~]$mkdir /oracle/oraInventory
[oracle@LinuxNBU65 ~]$mkdir -p $ORACLE_HOME
2. 开始安装oracle 10.2.0.1
[oracle@LinuxNBU65 ~]$./runInstaller -ignoreSysPreReqs
截图请见附件PDF文档
手工选中内存报警项
上图中会检查操作系统版本、软件包、内核参数、文件系统空间、swap等信息:
Checking operating system package requirements ...
Checking for make-3.79; found make-1:3.81-3.el5. Passed
Checking for binutils-2.14; found binutils-2.17.50.0.6-12.el5. Passed
Checking for gcc-3.2; found gcc-4.1.2-46.el5. Passed
Checking for libaio-0.3.96; found libaio-0.3.106-3.2. Passed
Check complete. The overall result of this check is: Passed
=======================================================================
Checking kernel parameters
Checking for semmsl=250; found semmsl=250. Passed
Checking for semmns=32000; found semmns=32000. Passed
Checking for semopm=100; found semopm=100. Passed
Checking for semmni=128; found semmni=128. Passed
Checking for shmmax=536870912; found shmmax=4294967295. Passed
Checking for shmmni=4096; found shmmni=4096. Passed
Checking for shmall=2097152; found shmall=268435456. Passed
Checking for file-max=65536; found file-max=101365. Passed
Checking for VERSION=2.6.9; found VERSION=2.6.18-164.el5. Passed
Checking for ip_local_port_range=1024 - 65000; found ip_local_port_range=1024 - 65000. Passed
Checking for rmem_default=262144; found rmem_default=1048576. Passed
Checking for rmem_max=262144; found rmem_max=1048576. Passed
Checking for wmem_default=262144; found wmem_default=262144. Passed
Checking for wmem_max=262144; found wmem_max=262144. Passed
Check complete. The overall result of this check is: Passed
=======================================================================
[root@LinuxNBU65 ~]# ll /oracle/oraInventory/orainstRoot.sh
-rwxrwx--- 1 oracle oinstall 1120 Oct 18 15:55 /oracle/oraInventory/orainstRoot.sh
[root@LinuxNBU65 ~]# /oracle/oraInventory/orainstRoot.sh
Changing permissions of /oracle/oraInventory to 770.
Changing groupname of /oracle/oraInventory to oinstall.
The execution of the script is complete
[root@LinuxNBU65 ~]#
[root@LinuxNBU65 ~]#
[root@LinuxNBU65 ~]# ll /oracle/product/10.2/db_1/root.sh
-rwxr-xr-x 1 oracle oinstall 9502 Oct 18 15:55 /oracle/product/10.2/db_1/root.sh
[root@LinuxNBU65 ~]#
[root@LinuxNBU65 ~]# /oracle/product/10.2/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/product/10.2/db_1
Enter the 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...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
[root@LinuxNBU65 ~]#
3. 安装补丁10.2.0.4
截图请见附件PDF文档
以root用户运行两个脚本文件:
[root@LinuxNBU65 ~]# ll /oracle/oraInventory2/orainstRoot.sh
-rwxr-xr-x 1 oracle oinstall 1186 Oct 18 22:24 /oracle/oraInventory2/orainstRoot.sh
[root@LinuxNBU65 ~]# /oracle/oraInventory2/orainstRoot.sh
Changing permissions of /oracle/oraInventory2 to 770.
Changing groupname of /oracle/oraInventory2 to oinstall.
The execution of the script is complete
[root@LinuxNBU65 ~]#
[root@LinuxNBU65 ~]# ll /oracle/product/10.2/db_1/root.sh
-rwxr-xr-x 1 oracle oinstall 9553 Oct 18 22:24 /oracle/product/10.2/db_1/root.sh
[root@LinuxNBU65 ~]# /oracle/product/10.2/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/product/10.2/db_1
Enter the full 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 ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
[root@LinuxNBU65 ~]#
Oracle 10.2.0.4补丁安装结束。
4. 配置监听
截图请见附件PDF文档
5. DBCA创建数据库
以下这步选择数据库字符集和国家字符集等,该项内容极为重要,请与上层应用方确认后选择,中文环境下一般选择如下:
截图请见附件PDF文档
6. 客户端配置(可直接修改tnsnames.ora文件)
截图请见附件PDF文档
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22085031/viewspace-1050383/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22085031/viewspace-1050383/