1、 安装Oracle所需要的依赖包
sudo apt-get install automake sudo apt-get install autotools-dev sudo apt-get install binutils sudo apt-get install bzip2 sudo apt-get install elfutils sudo apt-get install expat sudo apt-get install gawk sudo apt-get install gcc sudo apt-get install gcc-multilib sudo apt-get install g++-multilib sudo apt-get install ia32-libs sudo apt-get install ksh sudo apt-get install less sudo apt-get install lesstif2 sudo apt-get install lesstif2-dev sudo apt-get install lib32z1 sudo apt-get install libaio1 sudo apt-get install libaio-dev sudo apt-get install libc6-dev sudo apt-get install libc6-dev-i386 sudo apt-get install libc6-i386 sudo apt-get install libelf-dev sudo apt-get install libltdl-dev sudo apt-get install libmotif4 sudo apt-get install libodbcinstq4-1 libodbcinstq4-1:i386 sudo apt-get install libpth-dev sudo apt-get install libpthread-stubs0 sudo apt-get install libpthread-stubs0-dev sudo apt-get install libstdc++5 sudo apt-get install lsb-cxx sudo apt-get install make sudo apt-get install openssh-server sudo apt-get install pdksh sudo apt-get install rlwrap sudo apt-get install rpm sudo apt-get install sysstat sudo apt-get install unixodbc sudo apt-get install unixodbc-dev sudo apt-get install unzip sudo apt-get install x11-utils sudo apt-get install zlibc
- 谨慎起见,最好都执行一遍。
2、创建用户和组
[root@oracledb ~]# groupadd -g 200 oinstall
[root@oracledb ~]# groupadd -g 201 dba
[root@oracledb ~]# useradd -u 440 -g oinstall -G dba oracle
[root@oracledb ~]# passwd oracle
3、修改内核参数
[root@oracledb ~]# vi /etc/sysctl.conf #末尾添加如下
net.ipv4.ip_local_port_range= 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
[root@oracledb ~]# sysctl -p
4、修改系统资源限制
[root@oracledb ~]# vi /etc/security/limits.conf #末尾添加如下
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@oracledb ~]# vi /etc/pam.d/login
session required pam_namespace.so #下面添加一条pam_limits.so
session required pam_limits.so
5、创建安装目录及设置权限
[root@oracledb ~]# mkdir /opt/oracle/app/
[root@oracledb ~]# mkdir /opt/oracle/oradata/
[root@oracledb ~]# chmod 755/opt/oracle/
[root@oracledb ~]# chmod 775/opt/oracle/app/
[root@oracledb ~]# chown oracle.oinstall -R /opt/oracle/
6、设置oracle环境变量
[oracle@oracledb ~]$ vi ~/.bash_profile
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ROACLE_PID=orcl
[oracle@oracledb ~]$ source .bash_profile #立即生效
7、欺骗oracle的安装程序
Oracle本身并不支持ubuntu来安装,所以要进行欺骗oracle的安装程序(sudo执行):
mkdir /usr/lib64 ln -s /etc /etc/rc.d ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/ ln -s /usr/bin/awk /bin/awk ln -s /usr/bin/basename /bin/basename ln -s /usr/bin/rpm /bin/rpm ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/ ln -s /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/ ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib64/ echo 'Red Hat Linux release 5' > /etc/redhat-release
8.DISPLAY错误
[root@dev ~]# xhost +
11、安装过程可能遇到的问题
一、Oracle安装界面乱码解决方法
执行:
exportNLS_LANG=AMERICAN_AMERICA.UTF8 export LC_ALL=C
二、Error in invoking target ‘install’ of makefile ‘/home/dong/tools/oracle11g/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk’. See ‘/home/dong/tools/oraInventory/logs/installActions2015-01-22_09-39-03AM.log’ for details.
解决方法如下:
从http://download.csdn.net/detail/adnerly/9467935下载,使用rpm安装这个glibc-static-2.17-55.el7.x86_64.rpm资源,安装即可, 然后点击retry ,接着往下执行
注:这是网上提供的解决方案,我的系统安装失败,我直接跳过了
三、Error in invoking target ‘agent nmhs’ of makefile ‘/home/dong/tools/oracle11g/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk’
解决方法:
打开新的终端窗口
使用vi命令,打开/home/dong/tools/oracle11g/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk文件,将$(MK_EMAGENT_NMECTL)
修改成$(MK_EMAGENT_NMECTL)-lnnz11
即可,
然后点击retry ,接着往下执行
四、Error in invoking target ‘all_no_orcl’ of makefile ‘/home/dong/tools/oracle11g/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk’. See ‘/home/dong/tools/Inventory/logs/installActions2016-03-19_02-37-44PM.log’ for details.
解决办法:
打开一个新的终端,输入如下四个命令:
sed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk
sed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
sed -i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/bin/genorasdksh
sed -i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/srvm/lib/ins_srvm.mk
然后在图形界面点击‘Retry’就能继续安装了。
sudo /home/dong/tools/Inventory/orainstRoot.sh sudo /home/dong/tools/oracle11g/product/11.2.0/dbhome_1/root.sh