在Fedora上安装Oracle 10g
系统环境:Fedora 2、3、4、5、6、7
Oracle版本:10.2.0.1.0
安装过程分以下四个步骤
一,安装准备
二,下载安装
三,相关设置
四,常见错误
一,安装准备
1,创建oracle用户
以root用户登录,创建oracle用户以及其所属的dba组
1 2 3 | su - # groupadd dba # useradd -g dba oracle |
2,设置系统参数
编辑 /etc/sysctl.conf 文件并添加下列参数:
1 2 3 4 5 6 7 8 9 10 | kernel.shmall = 2097152 kernel.shmmax = 2147483648 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 = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 |
编辑后可以运行“sysctl -p” 生效,或者重启系统
编辑 /etc/pam.d/login 文件,并添加下行参数:
1 | session required /lib/security/pam_limits.so |
编辑 /etc/security/limits.conf 并添加下行参数:
1 2 3 4 | oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 |
禁用selinux,这个只是在Fedora 4版本中进行
编辑 /etc/selinux/config 改变SELINUX值为”disabled“
1 | SELINUX=disabled |
保存之后需要重启系统
3,创建oracle目录
1 2 3 | # mkdir /opt/oracle # mkdir /opt/oracle/10gR2 # chown -R oracle:dba /opt/oracle |
4,设置oracle环境变量
编辑 /home/oracle/.bash_profile 并添加下列行:
1 2 3 4 5 6 7 | ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/10gR2 ORACLE_SID=MY_ORACLE LD_LIBRARY_PATH=$ORACLE_HOME/lib PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH |
保存后通过下面命令是配置生效
1 2 3 | su - oracle cd /home/oracle . .bash_profile |
二,下载安装
1,下载并安装需要的rpm软件包
检查软件包安装情况:
1 2 | rpm -q binutils gcc glibc glibc-headers glibc-kernheaders glibc-devel compat-libstdc++ cpp compat-gcc make compat-db compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel openmotif openmotif21 setarch pdksh libaio libaio-devel 注意:在FC4中 pdksh软件包名称为ksh |
相应软件包下载地址
1 2 3 4 5 6 | FC2:http://download.fedora.redhat.com/pub/fedora/linux/core/2/i386/os/Fedora/RPMS/ FC3:http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/ FC4:http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/ FC5:http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os/Fedora/RPMS/ FC6:http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/Fedora/RPMS/ FC7:http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Everything/i386/os/Fedora/ |
安装rpm软件包:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # rpm -ivh binutils-2.15.94.0.2.2-2.i386.rpm \ compat-libgcc-296-2.96-132.fc4.i386.rpm \ compat-libstdc++-296-2.96-132.fc4.i386.rpm \ compat-libstdc++-33-3.2.3-47.fc4.i386.rpm \ cpp-4.0.0-8.i386.rpm \ gcc-4.0.0-8.i386.rpm \ gcc-c++-4.0.0-8.i386.rpm \ glibc-2.3.5-10.i386.rpm \ glibc-common-2.3.5-10.i386.rpm \ glibc-devel-2.3.5-10.i386.rpm \ glibc-headers-2.3.5-10.i386.rpm \ glibc-kernheaders-2.4-9.1.94.i386.rpm \ ksh-20050202-1.i386.rpm \ libaio-0.3.104-2.i386.rpm \ libaio-devel-0.3.104-2.i386.rpm \ libgcc-4.0.0-8.i386.rpm \ libstdc++-4.0.0-8.i386.rpm \ libstdc++-devel-4.0.0-8.i386.rpm \ make-3.80-7.i386.rpm \ openmotif-2.2.3-10.i386.rpm \ openmotif21-2.1.30-14.i386.rpm \ setarch-1.7-3.i386.rpm \ xorg-x11-deprecated-libs-6.8.2-31.i386.rpm |
2,下载oracle 10g
下载地址:http://www.oracle.com/technology/software/products/database/oracle10g/index.html
解压安装包
1 | unzip 10201_database_linux32.zip |
3,开始oracle的安装
1 2 | cd database ./runInstaller |
三,相关配置
1,关闭RAC 和 ASM进程,如果用不到这些
1 2 3 4 5 6 7 8 9 10 11 | su - # /etc/init.d/init.cssd disable # /etc/init.d/init.cssd stop 2,配置sqlplus增强工具 下载地址:http://ivan.kartik.sk/oracle/download_from.php?site_id=4 <pre lang="bash" line="1">su - # rpm -ivh rlwrap-0.24.fedora.i386.rpm # exit echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile . /home/oracle/.bash_profile |
四、常见安装错误
1,错误:DISPLAY not set. Please set the DISPLAY and try again.
以root用户打开终端或者ssh登录,通过下面命令均可可解决
命令一: export DISPLAY=:0.0
命令二: xhost +
2,错误:Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2005-07-07_09-40-45AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred.. java.lang.UnsatisfiedLinkError: /tmp/OraInstall2005-07-07_09-40-45AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
通过在FC3,4版本中安装 xorg-x11-deprecated-libs 软件包解决
在FC5,6,7中安装libXp软件包解决。
3,错误:cannot restore segment prot after reloc: Permission denied
方法一:修改 /etc/selinux/config 设置SELINUX为”disabled“并重启系统
方法二:下载selinux-policy-targeted-1.25.2-4.noarch.rpm 软件包并安装或升级
4,错误:error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
安装libaio和libaio-devel软件包,如果仍重复提示错误,以root用户运行”ldconfig“命令可以解决
5,错误:sed: -e expression #1, char 7: unterminated `s’ command error in $ORACLE_HOME/install/make.log
这个错误只会在FC5中出现,下载软件包 bash-3.0-31.i386.rpm 并强制安装
“rpm -ivh bash-3.0-31.i386.rpm –force”.
6,错误:Check complete. The overall result of this check is: Failed <<<< 检查缺失软件包并安装,或者修改系统参数为需要的值