系统级别准备工作
1.安装Oracle所需要的依赖包,依赖包有:
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
glibc-headers-2.5-12
gcc-4.1.1-52
gcc-c++-4.1.1-52
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
numactl-devel-0.9.8.i386
sysstat-7.0.0
fonts-chinese-3.02-9.6.el5.noarch.rpm
注意:在安装elfutils-libelf-devel-0.125-3.el5.i386.rpm 需要elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm 两个包同时装,两个包相互依赖,建议在图形化安装Oracle时认真查看安装所需要的依赖包,如果没装的,装完再安装
# rpm -ivh elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm
2.微调参数内核,如果省略此步骤,oracle在系统检测时会提示错误
a.在/etc/sysctl.conf添加以下内容:
# vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
b.设置/etc/sysctl.conf配置文件使参数生效
# sysctl -p
3.修改系统资源使用限额
a.修改/etc/security/limits.conf,在配置文件末加入以下内容(修改时可将*替换成Oracle用户)
# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
b.修改/etc/pam.d/login,在文件末尾加入以下内容,使其它系统资源限额设置生效:
#vi /etc/pam.d/login
session required pam_limits.so
4.关闭内核selinux选项
# vi /etc/selinux/config
SELINUX=disabled
5.设置网卡静态IP地址,修改/etc/sysconfig/network-scripts/ifcfg-eth0,将网卡地址设置为静态IP地址。进入RAC安装时,此步骤一定不能省略BOOTPROTO=static必须在ifcfg-eth0配置文件中始终存在,否则Oracle将提示网络检查报告。
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:0c:29:ce:d7:3e
NETMASK=255.255.255.0
IPADDR=192.168.200.4
TYPE=Ethernet
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
6.最好重启服务器。
oracle安装前的准备工作
1.创建Oracle用户及用户组,并设置密码。
# groupadd oinstall
# groupadd dba
# groupadd oper
# groupadd asmadimin
# useradd -g oinstall -G dba,oper,asmadimin oracle
# passwd oracle
2.创建Oracle安装目录及数据目录,并设置权限。
# mkdir -p /gavin/app/oracle/product/11.1.0/
# mkdir -p /gavin/oradata
# chmod -R 775 /gavin
# chown -R oracle.oinstall /gavin
3.修改RedHat发行版本,将RHEL 5.改为redhat-4,如果11g就不用了,10g默认只支持redhat-4
# vi /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
4.设置Oracle用户登录环境变量,修改/home/oracle/.bash_profile配置文件,在文件末尾加上以下内容:
export TMP=/tmp
export TMPDIR=/$TMP
export ORACLE_BASE=/gavin/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/
export ORACLE_SID=rhel50
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/sbin:/usr/local/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LANG="zh_CN.UTF-8"
export ORACLE_TERM=vt100
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
# su - oracle
[oracle@localhost ~]$ pwd
/home/oracle
[oracle@localhost ~]$ vi .bash_profile
开始安装Oracle
1.解压文件
[oracle@localhost tmp]$ unzip linux_11gR1_database_1013.zip
[oracle@localhost tmp]$ cd database/
[oracle@localhost database]$ ls
README doc install runInstaller stage welcome.html
2.开始安装
$ xhost +
$ su - oracle
[oracle@localhost database]$ ./runInstaller
注意:$ xhost +这个一定要执行,否则会报Can't connect to X11 window
server,启动不了图形化界面。
3.安装完成后需要Root的身分去配置脚本,此脚本用于更改/gavin/app/oraInventory/目录下的所有权限及工作组。
# /gavin/app/oraInventory/orainstRoot.sh
4.以root去执行脚本,将Oracle一些运行命复制到指定目录下。比如,将命令复制到/usr/bin目录下
# /gavin/app/oracle/product/11.1.0/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /gavin/app/oracle/product/11.1.0
Enter the full pathname of the local bin directory: [/usr/local/bin]: /usr/bin
Creating /usr/bbin directory...
Copying dbhome to /usr/bbin ...
Copying oraenv to /usr/bbin ...
Copying coraenv to /usr/bbin ...
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.
Finished product-specific root actions.
5.在浏览器输入https://192.168.200.4:1158/em进入EM企业管理到此,安装结束
1.安装Oracle所需要的依赖包,依赖包有:
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
glibc-headers-2.5-12
gcc-4.1.1-52
gcc-c++-4.1.1-52
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
numactl-devel-0.9.8.i386
sysstat-7.0.0
fonts-chinese-3.02-9.6.el5.noarch.rpm
注意:在安装elfutils-libelf-devel-0.125-3.el5.i386.rpm 需要elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm 两个包同时装,两个包相互依赖,建议在图形化安装Oracle时认真查看安装所需要的依赖包,如果没装的,装完再安装
# rpm -ivh elfutils-libelf-devel-0.125-3.el5.i386.rpm elfutils-libelf-devel-static-0.125-3.el5.i386.rpm
2.微调参数内核,如果省略此步骤,oracle在系统检测时会提示错误
a.在/etc/sysctl.conf添加以下内容:
# vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
b.设置/etc/sysctl.conf配置文件使参数生效
# sysctl -p
3.修改系统资源使用限额
a.修改/etc/security/limits.conf,在配置文件末加入以下内容(修改时可将*替换成Oracle用户)
# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
b.修改/etc/pam.d/login,在文件末尾加入以下内容,使其它系统资源限额设置生效:
#vi /etc/pam.d/login
session required pam_limits.so
4.关闭内核selinux选项
# vi /etc/selinux/config
SELINUX=disabled
5.设置网卡静态IP地址,修改/etc/sysconfig/network-scripts/ifcfg-eth0,将网卡地址设置为静态IP地址。进入RAC安装时,此步骤一定不能省略BOOTPROTO=static必须在ifcfg-eth0配置文件中始终存在,否则Oracle将提示网络检查报告。
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:0c:29:ce:d7:3e
NETMASK=255.255.255.0
IPADDR=192.168.200.4
TYPE=Ethernet
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
6.最好重启服务器。
oracle安装前的准备工作
1.创建Oracle用户及用户组,并设置密码。
# groupadd oinstall
# groupadd dba
# groupadd oper
# groupadd asmadimin
# useradd -g oinstall -G dba,oper,asmadimin oracle
# passwd oracle
2.创建Oracle安装目录及数据目录,并设置权限。
# mkdir -p /gavin/app/oracle/product/11.1.0/
# mkdir -p /gavin/oradata
# chmod -R 775 /gavin
# chown -R oracle.oinstall /gavin
3.修改RedHat发行版本,将RHEL 5.改为redhat-4,如果11g就不用了,10g默认只支持redhat-4
# vi /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
4.设置Oracle用户登录环境变量,修改/home/oracle/.bash_profile配置文件,在文件末尾加上以下内容:
export TMP=/tmp
export TMPDIR=/$TMP
export ORACLE_BASE=/gavin/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/
export ORACLE_SID=rhel50
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/sbin:/usr/local/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LANG="zh_CN.UTF-8"
export ORACLE_TERM=vt100
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
# su - oracle
[oracle@localhost ~]$ pwd
/home/oracle
[oracle@localhost ~]$ vi .bash_profile
开始安装Oracle
1.解压文件
[oracle@localhost tmp]$ unzip linux_11gR1_database_1013.zip
[oracle@localhost tmp]$ cd database/
[oracle@localhost database]$ ls
README doc install runInstaller stage welcome.html
2.开始安装
$ xhost +
$ su - oracle
[oracle@localhost database]$ ./runInstaller
注意:$ xhost +这个一定要执行,否则会报Can't connect to X11 window
server,启动不了图形化界面。
3.安装完成后需要Root的身分去配置脚本,此脚本用于更改/gavin/app/oraInventory/目录下的所有权限及工作组。
# /gavin/app/oraInventory/orainstRoot.sh
4.以root去执行脚本,将Oracle一些运行命复制到指定目录下。比如,将命令复制到/usr/bin目录下
# /gavin/app/oracle/product/11.1.0/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /gavin/app/oracle/product/11.1.0
Enter the full pathname of the local bin directory: [/usr/local/bin]: /usr/bin
Creating /usr/bbin directory...
Copying dbhome to /usr/bbin ...
Copying oraenv to /usr/bbin ...
Copying coraenv to /usr/bbin ...
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.
Finished product-specific root actions.
5.在浏览器输入https://192.168.200.4:1158/em进入EM企业管理到此,安装结束