CentOS5.6下安装Oracle10G
******************************************************************************** *目标:在Centos系统下,安装Oracle10g软件 *步骤: * 1、安装包 * 2、域名解析设置及网络配置 * 3、创建用户、组 * 4、配置内核参数、修改环境变量 * 5、设置shell限制 * 6、创建相关目录、赋权 * 7、远程图形化安装Oracle软件 *******************************************************************************1、安装包--挂载光盘 [iyunv@localhost CentOS]#mount /dev/hdb /media --通过df -h查看到相关目录,依实际情况挂载 --配置yum [iyunv@localhost CentOS]# cd /etc/yum.repos.d/ --进入到该目录下生成一个配置文件 [iyunv@localhost CentOS]# cp CentOS-Debuginfo.repo yum.repo --做一个拷贝 [iyunv@localhost CentOS]#cp * /hylbak --将yum.repos.d下文件做一个备份 [iyunv@localhost CentOS]#rm -rf Centos* --将无关文件删除 [iyunv@localhost CentOS]#vi yum.repo [debug] name=CentOS-6 - Debuginfo baseurl=file:///media --此处光盘挂载到了media目录下 enabled=1 gpgcheck=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6 ~ ~ [iyunv@localhost CentOS]#yum install -y binutils-2.17.50.0.6 --举例:使用yum安装格式 [iyunv@localhost CentOS]#rpm -q binutils-2.17.50.0.6 --举例:使用rpm查看软件包安装情况 --修改:不要按下面参考文档提示安装,第一次按其安装出错 --安装时需要使用下文修改的“黄色”标记安装方案 --保留第一次缺失安装包参考,引以为戒 --安装包缺失时参考如下文档所致 --下表为第一次安装,安装后续发现出现包不全状况,对其包进行更正和补充,若实际安装采用之后的安装包方案,此处不做删除以示反例 安装包参考(提醒:不要按此安装,实际安装见后文) | 参考文档提示安装包 | 实际通过光盘安装包 | binutils-2.17.50.0.6 | binutils-2.17.50.0.6 | compat-libstdc++-33-3.2.3 | compat-libstdc++-33-3.2.3-61 | elfutils-libelf-0.125 | elfutils-libelf-0.137 | elfutils-libelf-devel-0.125 | elfutils-libelf-devel-0.137 | elfutils-libelf-devel-static-0.125 | elfutils-libelf-devel-static-0.137 | gcc-4.1.2 | gcc-4.1.2 | gcc-c++-4.1.2 | gcc-c++-4.1.2 | glibc-common-2.5 | glibc-common-2.5 | glibc-devel-2.5 | glibc-devel-2.5 | glibc-headers-2.5 | glibc-headers-2.5 | kernel-headers-2.6.18 | kernel-headers-2.6.18 | ksh-20060214 | ksh-20100202-1.el5_5.1 | libaio-0.3.106 | libaio-0.3.106 | libaio-devel-0.3.106 | libaio-devel-0.3.106 | libgcc-4.1.2 | libgcc-4.1.2 | libgomp-4.1.2 | libgomp-4.4.4-13.el5.x86_64 | libstdc++-4.1.2 | libstdc++-4.1.2 | libstdc++-devel-4.1.2 | libstdc++-devel-4.1.2 | make-3.81 | make-3.81 | sysstat-7.0.2 | sysstat-7.0.2 | unixODBC-2.2.11(32 bit) | unixODBC-2.2.11-7.1 | unixODBC-devel | unixODBC-devel-2.2.11-7.1.x86_64 | pdksh-5.2.14 | pdksh-5.2.14-36.el5 | numactl-0.9.8 | numactl-0.9.8 | libXp-1.0.0 | libXp-1.0.0 | libXp-devel-1.0.0 | libXp-devel-1.0.0-8.1.el5.x86_64、libXp-devel-1.0.0-8.1.el5.i386.rpm | libXau-devel-1.0.1 | libXau-devel-1.0.1 |
|
|
--按错误参考安装包指令 yuminstall -y binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3-61elfutils-libelf-0.137 elfutils-libelf-devel-0.137elfutils-libelf-devel-static-0.137 gcc-4.1.2 gcc-c++-4.1.2 glibc-common-2.5glibc-devel-2.5 glibc-headers-2.5 kernel-headers-2.6.18 ksh-20100202-1.el5_5.1libaio-0.3.106 libaio-devel-0.3.106 libgcc-4.1.2 libgomp-4.4.4-13.el5.x86_64libstdc++-4.1.2 libstdc++-devel-4.1.2 make-3.81 sysstat-7.0.2unixODBC-2.2.11-7.1 unixODBC-devel-2.2.11-7.1.x86_64 pdksh-5.2.14-36.el5numactl-0.9.8 libXp-1.0.0 libXp-devel-1.0.0-8.1.el5.x86_64libXp-devel-1.0.0-8.1.el5.i386.rpm libXau-devel-1.0.1
正确安装包方案(使用以下安装包流程,经过二次验证成功) --使用以下安装包方案 --根据多次试验,执行如下指令,安装包 --安装常用软件 [iyunv@hyl ~]# yum -y install autoconf automake binutils-devel bisoncpp dos2unix ftp gcc gcc-c++ lrzsz python-devel
--安装 Oracle必需软件: [iyunv@hyl ~]# yum -y install compat-db compat-db42 compat-db43 compat-gcc-34 compat-gcc-34-c++ compatlibstdc++-33 glibc-* glibc-*.i686libXpm-*.i686 libXp.so.6 libXt.so.6 libXtst.so.6 libgcc_s.so.1 ksh libXp libaio-develnumactl numactl-devel unixODBC unixODBC-devel
[iyunv@hyl ~]# yum -y install glibc-devel.i386 glibc-devel.x86_64compat-db.i386 compat-db.x86_64 compat-libstdc++-296.i386compat-libstdc++-33.i386 compat-libstdc++-33.x86_64
[iyunv@hyl ~]# yum -y install compat-gcc-34.x86_64compat-gcc-34-c++.x86_64 gcc.x86_64 gcc-c++.x86_64 pdksh.x86_64 openmotif.i386openmotif.x86_64 sysstat.x86_64
--验证安装包情况 [iyunv@hyl yum.repos.d]# rpm -q glibc-devel.i386 glibc-devel.x86_64 compat-db.i386 compat-db.x86_64 compat-libstdc++-296.i386compat-libstdc++-33.i386 compat-libstdc++-33.x86_64 glibc-devel-2.5-58 glibc-devel-2.5-58 compat-db-4.2.52-5.1 compat-db-4.2.52-5.1 compat-libstdc++-296-2.96-138 compat-libstdc++-33-3.2.3-61 compat-libstdc++-33-3.2.3-61 [iyunv@hyl yum.repos.d]# rpm -q compat-gcc-34.x86_64compat-gcc-34-c++.x86_64 gcc.x86_64 gcc-c++.x86_64 pdksh.x86_64 openmotif.i386openmotif.x86_64 sysstat.x86_64 compat-gcc-34-3.4.6-4.1 compat-gcc-34-c++-3.4.6-4.1 gcc-4.1.2-50.el5 gcc-c++-4.1.2-50.el5 pdksh-5.2.14-36.el5 openmotif-2.3.1-5.el5_5.1 openmotif-2.3.1-5.el5_5.1 sysstat-7.0.2-3.el5_5.1
2、域名解析设置及网络配置[iyunv@localhost CentOS]# vi /etc/hosts 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6localhost6 192.168.56.103 hyl
[iyunv@localhost CentOS]# vi/etc/sysconfig/network-scripts/ifcfg-eth0 # Intel Corporation 82540EM Gigabit Ethernet Controller DEVICE=eth0 BOOTPROTO=static IPADDR=192.168.56.103 NETMASK=255.255.255.0 HWADDR=08:00:27:29:DB:B2 ONBOOT=yes ~ ~
[iyunv@localhost CentOS]# service network restart 正在关闭接口 eth0: [确定] 关闭环回接口: [确定] 禁用 IPv4 包转送:net.ipv4.ip_forward = 0 [确定] 弹出环回接口: [确定] 弹出界面 eth0: [确定]
[iyunv@localhost CentOS]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no #HOSTNAME=localhost.localdomain HOSTNAME=hyl ~ ~
[iyunv@localhost CentOS]# su - 3、创建用户、组[iyunv@hyl ~]# groupadd oinstall [iyunv@hyl ~]# groupadd dba [iyunv@hyl ~]# useradd -g oinstall -G dba oracle [iyunv@hyl ~]# passwd oracle Changingpassword for user oracle. New UNIXpassword: oracle BADPASSWORD: it is based on a dictionary word Retypenew UNIX password: oracle passwd:all authentication tokens updated successfully. [iyunv@hyl ~]# id oracle uid=501(oracle)gid=501(oinstall) groups=501(oinstall),502(dba) 4、配置内核参数、修改环境变量[iyunv@hyl ~]# vi /etc/sysctl.conf 添加: kernel.shmall = 4294967296 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65500 net.core.rmem_default = 4194304 net.core.wmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_max = 262144 ~ "/etc/sysctl.conf" 43L, 1228C written
[iyunv@hyl ~]# sysctl -p net.ipv4.ip_forward= 0 net.ipv4.conf.default.rp_filter= 1 net.ipv4.conf.default.accept_source_route= 0 kernel.sysrq= 0 kernel.core_uses_pid= 1 net.ipv4.tcp_syncookies= 1 kernel.msgmnb= 65536 kernel.msgmax= 65536 kernel.shmmax= 68719476736 kernel.shmall= 4294967296 kernel.shmmni= 4096 kernel.sem= 250 32000 100 128 fs.file-max= 65536 net.ipv4.ip_local_port_range= 1024 65500 net.core.rmem_default= 4194304 net.core.wmem_default= 262144 net.core.rmem_max= 4194304 net.core.wmem_max= 262144
--修改oracle用户的环境配置文件 --执行:su - oracle切换到oracle用户环境,然后编辑 .bash_profile文件,更改PATH的配置,同时在环境变量中增加NLS_LANG的配置 [iyunv@hyl yum.repos.d]# su - oracle [oracle@hyl ~]$ vi .bash_profile ORACLE_BASE=/home/u01/app/oracle ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 ORACLE_SID=xcky PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH
5、设置 shell 限制--添加以下参数 [iyunv@hyl ~]# vi /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 [iyunv@hyl ~]# vi /etc/pam.d/login --添加以下参数 session required /lib/security/pam_limits.so session required pam_limits.so
[iyunv@hyl ~]# 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
--在/etc/profile文件中修改以下内容 ulimit –s –c 0 >/dev/null 2> &1 修改为 ulimit –s –c unlimited >/dev/null 2> &1
6、创建相关目录、赋权[iyunv@hyl ~]# mkdir -p /home/u01/app/oracle [iyunv@hyl ~]# mkdir -p /home/u01/app/oracle/oraInventory [iyunv@hyl ~]# chown -R oracle:oinstall /home/u01/app/oracle [iyunv@hyl ~]# chmod -R 775 /home/u01/app/oracle
[oracle@hyl home]# mkdir -p /home/oracle/downloads [iyunv@hyl ~]# chown -R oracle:oinstall /home/oracle/downloads --上传安装包 [iyunv@hyl downloads]# zcat 10201_database_linux_x86_64.cpio.gz |cpio -idmv > /dev/null 2>&1 --上传安装包后,解压安装包
[iyunv@hyl install]# vi/home/oracle/downloads/database/install/oraparam.ini --添加redhat-5如下所示 [Certified Versions] Linux=redhat-5,redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2
7、远程图形化安装 Oracle 软件--使用X-manager软件调用图形化界面,操作参考如下
$./runInstaller -X-manager下执行,出现乱码问题 --以下解决乱码问题 [iyunv@hyl ~]# vi /etc/sysconfig/i18n LANG="en_US.UTF-8" #LANG="zh_CN.UTF-8" ~ ~
--按参看下图,输入export指令
--安装过程报错:Errorinvoking target ‘install’ of makefile --修改:以下报错皆为第一次缺失包情况,若按上文修改后文档安装包,将不会出现如下报错 --保留报错截图,引以为戒
--rpm安装缺失的包 [iyunv@hyl CentOS]# find -name "compat-libstdc*" ./compat-libstdc++-296-2.96-138.i386.rpm ./compat-libstdc++-33-3.2.3-61.x86_64.rpm ./compat-libstdc++-33-3.2.3-61.i386.rpm [iyunv@hyl CentOS]# rpm -ivh compat-libstdc++-296-2.96-138.i386.rpm warning:compat-libstdc++-296-2.96-138.i386.rpm: Header V3 DSA signature: NOKEY, key IDe8562897 error:failed to stat /media/CentOS_5.6_Final: 没有那个文件或目录 Preparing... ########################################### [100%] 1:compat-libstdc++-296 ###########################################[100%] [iyunv@hyl CentOS]# rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm warning:compat-libstdc++-33-3.2.3-61.x86_64.rpm: Header V3 DSA signature: NOKEY, key IDe8562897 error:failed to stat /media/CentOS_5.6_Final: 没有那个文件或目录 Preparing... ###########################################[100%] packagecompat-libstdc++-33-3.2.3-61.x86_64 is already installed [iyunv@hyl CentOS]# rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm warning:compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key IDe8562897 error:failed to stat /media/CentOS_5.6_Final: 没有那个文件或目录 Preparing... ########################################### [100%] packagecompat-libstdc++-33-3.2.3-61.i386 is already installed --尝试点击Retry继续 --再次报错:Error invokingtarget‘agent nmo nmb’of makefile
--使用yum安装如下包 glib-devel-1.2.10-20.el5 (i386) glib-devel-1.2.10-20.el5 (x86_64) glibc-devel-2.5-81.el5_8.2 (x86_64) glibc-devel-2.5-81.el5_8.2 (i386)
--尝试点击Retry继续 --再次报错,尝试点击“Continue”继续
[iyunv@hyl ~]# /home/u01/app/oracle/oraInventory/orainstRoot.sh Changingpermissions of /home/u01/app/oracle/oraInventory to 770. Changinggroupname of /home/u01/app/oracle/oraInventory to oinstall. Theexecution of the script is complete [iyunv@hyl ~]# /home/u01/app/oracle/product/10.2.0/db_1/root.sh RunningOracle10 root.sh script... Thefollowing environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /home/u01/app/oracle/product/10.2.0/db_1 Enterthe 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... Entrieswill be added to the /etc/oratab file as needed by DatabaseConfiguration Assistant when a database is created Finishedrunning generic part of root.sh script. Nowproduct-specific root actions will be performed.
--软件安装结束,由于过程中报错,软件安装可能不成功,尝试启动dbca $dbca --X-manager下无法启动dbca --删除/home/oracle下oracle安装文件,重新安装软件 --由于之前安装过程中,出现缺失包情况,重新查阅官方文档,重新安装和检查需要的包
--此时注意到安装包位数的区别,安装64位的安装包
[iyunv@hyl ~]# yum -y install glibc-devel.i386 glibc-devel.x86_64compat-db.i386 compat-db.x86_64 compat-libstdc++-296.i386compat-libstdc++-33.i386 compat-libstdc++-33.x86_64
[iyunv@hyl ~]# yum -y install compat-gcc-34.x86_64compat-gcc-34-c++.x86_64 gcc.x86_64 gcc-c++.x86_64 pdksh.x86_64 openmotif.i386openmotif.x86_64 sysstat.x86_64
--按照上文图形化安装oracle步骤,重新安装oracle软件,直到执行脚本界面弹出,此时只需跑一个脚本,如下图
[iyunv@hyl /]# /home/u01/app/oracle/product/10.2.0/db_1/root.sh RunningOracle10 root.sh script...
Thefollowing environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /home/u01/app/oracle/product/10.2.0/db_1
Enter thefull 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 ...
Entrieswill be added to the /etc/oratab file as needed by
DatabaseConfiguration Assistant when a database is created
Finishedrunning generic part of root.sh script.
Nowproduct-specific root actions will be performed.
--按提示,点击完成结束oracle软件的安装 --经验证,此次安装oracle软件成功,已经可以dbca建库
|