数据库:Oracle 10.2 for Linux 32位
操作系统:RHEL5.2
需要:Root用户
1、检查基本配置信息
# grep MemTotal /proc/meminfo(至少512M)
[oracle@bj dbs]$ grep MemTotal /proc/meminfo
MemTotal: 515500 kB
# grep SwapTotal /proc/meminfo(至少1G)
[oracle@bj dbs]$ grep SwapTotal /proc/meminfo
SwapTotal: 1020116 kB
#df -k /tmp (至少400M)
[oracle@bj dbs]$ df -k /tmp
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 39534988 7292140 30202192 20% /
#df -k (至少4G)
[oracle@bj dbs]$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 39534988 7292140 30202192 20% /
/dev/sda1 101086 11083 84784 12% /boot
tmpfs 257748 0 257748 0% /dev/shm
#grep "model name" /proc/cpuinfo --查看处理器信息
[oracle@bj dbs]$ grep "model name" /proc/cpuinfo
model name: Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz
内存与Swap分区设置建议
内存大小 |
Swap分区大小 |
1-2G |
1.5倍内存大小 |
2-8G |
内存大小 |
大于8G |
0.75倍内存大小 |
2、检查安装依赖包
#rpm -q gcc make binutils openmotif glibc
unixODBC-devel-2.2.11-7.1.i386.rpm
sysstat-7.0.2-3.el5.i386.rpm
[oracle@bj dbs]$ rpm -q gcc make binutils openmotif glibc
gcc-4.1.2-42.el5
make-3.81-3.el5
binutils-2.17.50.0.6-6.el5
package openmotif is not installed
glibc-2.5-24
3、操作系统修改
3.1.修改操作系统版本号
cat>/etc/system-release<
readhat4 --Oracle10g支持RHEL4.5以下
Eof
3.2.修改内核参数/etc/sysctl.conf
kernel.shmmax = 2147483648 --共享内存段的最大尺寸
kernel.shmall = 2097152 --系统一次可以使用的共享内存总量(以页为单位)
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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
#/sbin/sysctl -p使修改内核参数生效
3.3.用户会话限制配置优化/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
limits.conf的格式如下:
username|@groupname type resource limit
username|@groupname:设置需要被限制的用户名,组名前面加@和用户名区别。也可以用通配符*来做所有用户的限制
type:有 soft,hard 和 -,soft 指的是当前系统生效的设置值。hard 表明系统中所能设定的最大值。soft 的限制不能比hard 限制高。用 - 就表明同时设置了soft和hard的值。
resource:
core - 限制内核文件的大小 date - 最大数据大小
fsize - 最大文件大小 memlock - 最大锁定内存地址空间
nofile - 打开文件的最大数目 rss - 最大持久设置大小
stack - 最大栈大小 cpu - 以分钟为单位的最多 CPU 时间
noproc - 进程的最大数目 as - 地址空间限制
maxlogins - 此用户允许登录的最大数目
4、创建用户及目录
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# id oracle
uid=500(oracle) gid=500(oinstall) 组=500(oinstall),501(dba)
# passwd oracle
mkdir -p /u01/app/oracle
su - oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
su -oracle
#vi .bash_profile设置环境变量
su -oracle
#source .bash_profile使设置生效
5、创建oraInst.loc文件
[root@bj ~]# touch /etc/oraInst.loc
[root@bj ~]# vi /etc/oraInst.loc
[root@bj ~]# cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
[root@bj ~]# cd /etc
[root@bj etc]# chown oracle:oinstall oraInst.loc
[root@bj etc]# chmod 664 oraInst.loc
[oracle@bj ~]$ pwd
/home/oracle
[oracle@bj ~]$ ls
10201_database_linux32.zip
[oracle@bj ~]$ unzip 10201_database_linux32.zip
6、编辑response文件
[oracle@bj response]$ pwd
/home/oracle/database/response
[oracle@bj response]$ cp enterprise.rsp /home/oracle/
#vi enterprise.rsp修改如下内容
FROM_LOCATION="/home/oracle/database/stage/products.xml" --修改此处避免复制后路径改变
ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1" --必须为绝对路径
ORACLE_HOME_NAME="RAC1" --Oracle服务器的名称,必须以字母开头
COMPONENT_LANGUAGES={"en","zh_CN"}
s_nameForDBAGrp="dba"
s_nameForOPERGrp="oinstall"
n_configurationOption=2 --1 同时创建数据库 2 同时创建ASM实例 3仅安装Oracle软件
其他项目用默认值即可
#chmod 700 enterprise.rsp
7、使用 runInstaller 安装软件
[oracle@bj ~]$ cd database/
#./runInstaller -ignoreSysPrereqs -silent -responseFile /home/oracle/enterprise.rsp
--------------------------------------
The installation of Oracle Database 10g was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2014-05-22_11-37-54PM.log' for more details.
---
查看log安装日志
[oracle@bj stage]$ tail -n 100 /u01/app/oracle/oraInventory/logs/silentInstall2014-05-22_11-37-54PM.log
silentInstall2014-05-22_11-37-54PM.log
WARNING:The following configuration scripts
/u01/app/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the configuration will not be complete and the product wont function properly. In order to get the product to function properly, you will be required to execute the scripts and the configuration tools after exiting the OUI.
The installation of Oracle Database 10g was successful.
使用ROOT用户执行root.sh脚本
[root@bj ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/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.
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
bj
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
到此,10g安装结束。
参考文档:http://blog.csdn.net/banpingzijy/article/details/17471919