柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!
全部博文(1669)
分类: Oracle
2012-04-16 17:53:09
一.安装 Oracle Linux 6.1 系统
我这里使用VBox 来安装,具体使用参考:
http://blog.csdn.net/tianlesoftware/article/details/6826389
在安装OS 时安装如下包:
Base System > Base
Base System > Client management tools
Base System > Compatibility libraries
Base System > Hardware monitoring utilities
Base System > Large Systems Performance
Base System > Network file system client
Base System > Performance Tools
Base System > Perl Support
Servers > Server Platform
Servers > System administration tools
Desktops > Desktop
Desktops > Desktop Platform
Desktops > Fonts
Desktops > General Purpose Desktop
Desktops > Graphical Administration Tools
Desktops > Input Methods
Desktops > X Window System
Development > Additional Development
Development > Development Tools
Applications >Internet Browser
二.安装 Oracle 11gR2
之前也整理了几篇Oracle安装的文章,参考:
http://blog.csdn.net/tianlesoftware/article/details/4718218
http://blog.csdn.net/tianlesoftware/article/details/6062816
这里我们看一下在OracleLinux 下Oracle 的安装。
2.1 安装软件下载
Oracle从11g开始安装介质就可以独立进行安装,从OTN上我们只能下载到11.2.0.1版本,从MOS上,我们可以下载到11.2.0.3版本。 我这里使用MOS上的11.2.0.3版本进行测试。
OTN上的下载地址:
2.2 解压缩 Patchset
Oracle 11g的Patchset 分几个文件,每个文件的作用都不同。
第一, 二个包表示database , 如果升级数据库,只需要这2个文件即可。
第三个包表示grid, 用来升级RAC 的CRS。如果升级RAC 要先用这个文件。
第四个表示客户端,
第五个表示gateways,
第六个表示examples, 这个是我们的示例文件安装包。
第七个表示deinstall .
更多内容参考:
Oracle 11gR2Patchset 不同文件作用 说明
http://blog.csdn.net/tianlesoftware/article/details/6818770
#11.2.0.3
unzipp10404530_112030_Linux-x86-64_1of7.zip
unzipp10404530_112030_Linux-x86-64_2of7.zip
2.3 修改hosts 文件
The "/etc/hosts" file mustcontain a fully qualified name for the server.
For example.
127.0.0.1 localhost
192.168.3.201 dave
2.4 修改配置参数
2.4.1 使用preinstall自动设置
之前单独整理了一篇Blog来说明preinstall 包,参考:
Oracle Linux6 下Oracle RDBMS Server 11gR2 Preinstall RPM 包说明
http://blog.csdn.net/tianlesoftware/article/details/7456878
该包会自动完成大部分的配置工作,从而提高我们部署的效率。
[root@dave Desktop]# yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Packageoracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-3.el6 will be installed
--> Processing Dependency: gcc-c forpackage: oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Processing Dependency:libstdc -devel for package:oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Processing Dependency: libaio-develfor package: oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Processing Dependency: ksh forpackage: oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Running transaction check
---> Package gcc-c .x86_640:4.4.6-3.el6 will be installed
--> Processing Dependency: libstdc =4.4.6-3.el6 for package: gcc-c -4.4.6-3.el6.x86_64
---> Package ksh.x86_640:20100621-12.el6_2.1 will be installed
---> Package libaio-devel.x86_640:0.3.107-10.el6 will be installed
---> Package libstdc -devel.x86_640:4.4.6-3.el6 will be installed
--> Running transaction check
---> Package libstdc .x86_640:4.4.5-6.el6 will be updated
---> Package libstdc .x86_640:4.4.6-3.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
oracle-rdbms-server-11gR2-preinstall
x86_641.0-3.el6 ol6_latest 15 k
Installing for dependencies:
gcc-c x86_64 4.4.6-3.el6 ol6_latest 4.7 M
ksh x86_6420100621-12.el6_2.1 ol6_latest 683 k
libaio-devel x86_640.3.107-10.el6 ol6_latest 13 k
libstdc -devel x86_64 4.4.6-3.el6 ol6_latest 1.5 M
Updating for dependencies:
libstdc x86_644.4.6-3.el6 ol6_latest 290 k
Transaction Summary
================================================================================
Install 5 Package(s)
Upgrade 1 Package(s)
Total size: 7.2 M
Total download size: 4.7 M
Is this ok [y/N]: y
Downloading Packages:
gcc-c -4.4.6-3.el6.x86_64.rpm | 4.7 MB 00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating :libstdc -4.4.6-3.el6.x86_64 1/7
Installing : libstdc -devel-4.4.6-3.el6.x86_64 2/7
Installing : gcc-c -4.4.6-3.el6.x86_64 3/7
Installing : libaio-devel-0.3.107-10.el6.x86_64 4/7
Installing : ksh-20100621-12.el6_2.1.x86_64 5/7
Installing : oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64 6/7
Cleanup :libstdc -4.4.5-6.el6.x86_64 7/7
Installed:
oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-3.el6
Dependency Installed:
gcc-c .x86_64 0:4.4.6-3.el6 ksh.x86_64 0:20100621-12.el6_2.1
libaio-devel.x86_64 0:0.3.107-10.el6 libstdc -devel.x86_64 0:4.4.6-3.el6
Dependency Updated:
libstdc .x86_64 0:4.4.6-3.el6
Complete!
[root@dave Desktop]#
2.4.2 手工设置
如果不使用rpm 包自动配置,就需要手工的做配置,具体的配置工作如下:
(1) 修改/etc/sysctl.conf 文件
Oracle 需求的最小配置如下:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586
可以使用如下命令来查看某个参数值:
/sbin/sysctl -a | grep
在/etc/sysctl.conf文件里在添加或者修改如下内容:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm,semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
修改完成之后执行如下命令使修改生效:
/sbin/sysctl –p
(2)在/etc/security/limits.conf 文件里添加如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
(3)安装相关的RPM 包
# From Oracle Linux 6 DVD
cd /media/cdrom/Server/Packages
rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64*nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686*nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc -33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c -4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc -4*x86_64*
rpm -Uvh libstdc -4*i686*
rpm -Uvh libstdc -devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc -33*i686*
rpm -Uvh compat-libcap*
cd /
eject
(4)创建groups 和 users
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper
useradd -u 502 -g oinstall -Gdba,asmdba,oper oracle
passwd oracle
2.5 其他设置
2.5.1 禁用SELINUX
在/etc/selinux/config里设置:SELINUX=disabled
修改这个参数需要重启系统才能生效。
2.5.2 创建目录并赋权
mkdir -p/u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
2.5.3 切换到oracle用户,并修改.bash_profile 文件
[oracle@dave ~]$ vi ~/.bash_profile
在.bash_profile文件里添加如下内容:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=dave; exportORACLE_HOSTNAME
ORACLE_UNQNAME=dave; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; exportORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1;export ORACLE_HOME
ORACLE_SID=dave; export ORACLE_SID
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/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH
2.6 安装软件
这里可以使用NoMachine,VNC 等工具。
http://blog.csdn.net/tianlesoftware/article/details/6003610
我这里直接在系统里来:
(1) 用root 用户执行:
Xhost
(2) 用Oracle 执行:
DISPLAY=
(3) 开始安装
./runInstaller
2.7 修改自启动参数
修改/etc/oratab 文件,将最后标记改成Y
Edit the "/etc/oratab" filesetting the restart flag for each instance to 'Y'.
dave:/u01/app/oracle/product/11.2.0/db_1:Y
关于Oracle实例开机自启动的更多内容参考:
Linux 下Oracle开机自启动 与 oratab, dbstart 脚本 说明
http://blog.csdn.net/tianlesoftware/article/details/7220657