合 Ubuntu 16.04安装Oracle 11.2.0.4单机
环境准备
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | docker rm -f ub16oracle11g docker run -itd --name ub16oracle11g -h ub16oracle11g \ -p 33392:3389 \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/lhrubuntu1604:3.0 \ /bin/bash docker exec -it ub16oracle11g bash cat > /etc/apt/sources.list <<"EOF" deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb http://mirrors.aliyuncs.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyuncs.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyuncs.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyuncs.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyuncs.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.aliyuncs.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.aliyuncs.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.aliyuncs.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse EOF apt-get update cat > /tmp/b.sh <<"EOF" sudo apt-get install bzip2 sudo apt-get install elfutils sudo apt-get install automake sudo apt-get install autotools-dev sudo apt-get install binutils 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 EOF /tmp/b.sh -- Oracle默认不支持ubuntu需要欺骗一下Oracle安装程序,执行以下命令: sudo mkdir -p /usr/lib64 sudo ln -sf /etc /etc/rc.d sudo ln -sf /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/ sudo ln -sf /usr/bin/awk /bin/awk sudo ln -sf /usr/bin/basename /bin/basename sudo ln -sf /usr/bin/rpm /bin/rpm sudo ln -sf /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/ sudo ln -sf /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib64/ sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/ sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib64/ |
环境配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | groupadd -g 502 oinstall groupadd -g 503 dba groupadd -g 504 oper groupadd -g 505 asmadmin useradd -u 502 -g oinstall -G dba,asmadmin,oper -s /bin/bash -m oracle echo "oracle:lhr" | chpasswd mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1 chown -R oracle:oinstall /u01 chmod -R 775 /u01 cat > /etc/oraInst.loc <<"EOF" inventory_loc=/u01/app/oraInventory inst_group=oinstall EOF chown oracle:oinstall /etc/oraInst.loc chmod 664 /etc/oraInst.loc source /etc/oralnst.loc echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers cat >> /home/oracle/.bash_profile <<"EOF" export TMP=/tmp export TMPDIR=$TMP export ORACLE_SID=lhrdb export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export NLS_DATE_FORMAT='YYYY-MM-DD HH24:mi:ss' alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' alias sas='sqlplus / as sysdba' EOF echo 'fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.panic_on_oops = 1 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 net.ipv4.conf.all.rp_filter = 2 net.ipv4.conf.default.rp_filter = 2 fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 ' >> /etc/sysctl.conf && sysctl -p echo 'oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 16384 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768 ' >> /etc/security/limits.conf echo 'session required /lib64/security/pam_limits.so session required pam_limits.so ' >> /etc/pam.d/login echo '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 |
静默安装和建库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | echo xfce4-session > /home/oracle/.xsession chmod +x /home/oracle/.xsession service xrdp restart unzip p13390677_112040_Linux-x86-64_1of7.zip && unzip p13390677_112040_Linux-x86-64_2of7.zip su - oracle /soft/database/runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq \ oracle.install.option=INSTALL_DB_SWONLY \ DECLINE_SECURITY_UPDATES=true \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 \ ORACLE_BASE=/u01/app/oracle \ oracle.install.db.InstallEdition=EE \ oracle.install.db.isCustomInstall=false \ oracle.install.db.DBA_GROUP=dba \ oracle.install.db.OPER_GROUP=dba \ oracle.install.db.isRACOneInstall=false \ oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \ SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \ oracle.installer.autoupdates.option=SKIP_UPDATES -- 日志:/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log -- root用户执行 /u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh -- 解决错误 ll $ORACLE_HOME/rdbms/lib/config.o ll $ORACLE_HOME/bin/oracle mv $ORACLE_HOME/rdbms/lib/config.o $ORACLE_HOME/rdbms/lib/config.o.bad -- 此时执行sqlplus / as sysdba会报错:ORA-12547: TNS:lost contact -- 解决 sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk sed -i "s/KFOD_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk sed -i "s/AMDU_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk sed -i "s/\$LD \$LD_RUNTIME \$LD_OPT/& -Wl,--no-as-needed/g" $ORACLE_HOME/bin/genorasdksh sed -i "s/KFNDG_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/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 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 -- 重新编译,编译完成后sqlplus正常 cd $ORACLE_HOME/rdbms/lib relink all -- 调试安装 ./runInstaller -debug -logLevel finest strace ./runInstaller -- 静默建库 -- dbca -silent -deleteDatabase -sourceDB lhrdb dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \ -gdbname lhrdb -sid lhrdb \ -sysPassword lhr -systemPassword lhr \ -datafileDestination '/u01/app/oracle/oradata' \ -recoveryAreaDestination '/u01/app/oracle/flash_recovery_area' \ -redoLogFileSize 50 \ -storageType FS \ -characterset AL32UTF8 -nationalCharacterSet AL16UTF16 \ -sampleSchema true \ -totalMemory 512 \ -databaseType OLTP \ -emConfiguration NONE 日志:/u01/app/oracle/cfgtoollogs/dbca/silent.log_2023-03-16_08-52-06-AM 报错:ORA-29516: Aurora assertion failure: Assertion failure at joez.c:3422,可以忽略 在76%时卡住,其实数据库已经创建完了!!!可以直接执行如下的SQL: -- 创建spfile create spfile from memory; startup force -- 其它修改 lsnrctl start |
报错处理
报错1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | root@lhrubuntu2004:/# more /u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log | grep -i error | grep -v INFO collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'client_sharedlib' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'links proc gen_pcscfg' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/precomp/lib/ins_precomp.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'links proc gen_pcscfg' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/precomp/lib/ins_precomp.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'idg4odbc' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'idg4odbc' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'itnsping' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'itnsping' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/plsql/lib/ins_plsql.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/plsql/lib/ins_plsql.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'all_no_orcl' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'all_no_orcl' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/lib/ins_sqlplus.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/sqlplus/lib/ins_sqlplus.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'clientonlyinstall' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/ldap/lib/ins_ldap.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'clientonlyinstall' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/ldap/lib/ins_ldap.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'ioklist' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_nau.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'ioklist' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_nau.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/srvm/lib/ins_srvm.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/srvm/lib/ins_srvm.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'utilities' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'utilities' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'iokdstry iokinit' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_nau.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'iokdstry iokinit' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_nau.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_server.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_server.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Exception String: Error in invoking target 'itrcroute' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'itrcroute' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/network/lib/ins_net_client.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. collect2: error: ld returned 1 exit status Exception String: Error in invoking target 'irman ioracle' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. Error in invoking target 'irman ioracle' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/u01/app/oraInventory/logs/installActions2023-03-15_01-13-46PM.log' for details. root@lhrubuntu2004:/# |
解决:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk sudo sed -i "s/KFOD_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk sudo sed -i "s/AMDU_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk sudo sed -i "s/\$LD \$LD_RUNTIME \$LD_OPT/& -Wl,--no-as-needed/g" $ORACLE_HOME/bin/genorasdksh sudo sed -i "s/KFNDG_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/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 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 #'agent nmhs',修改ins_emagent.mk 176行,在$(MK_EMAGENT_NMECTL)后添加 -lnnz11 sudo sed -i 's/^\s∗$(MKEMAGENTNMECTL)\s∗$(MKEMAGENTNMECTL)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk # 'all_no_orcl'的kfod问题,修改env_rdbms.mk的KFOD_LINKLINE变量(2913行),添加 -Wl,--no-as-needed sudo sed -i "s/KFOD_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk # 'all_no_orcl'的amdu问题,修改env_rdbms.mk的AMDU_LINKLINE变量(2922行),添加 -Wl,--no-as-needed sudo sed -i "s/AMDU_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk # 'all_no_orcl'的genorasdksh问题,修改genorasdksh (289行),添加 -Wl,--no-as-needed sudo sed -i "s/\$LD \$LD_RUNTIME \$LD_OPT/& -Wl,--no-as-needed/g" $ORACLE_HOME/bin/genorasdksh # 'all_no_orcl'的renamedg问题,修改env_rdbms.mk的KFNDG_LINKLINE变量(2918行),添加 -Wl,--no-as-needed sudo sed -i "s/KFNDG_LINKLINE=\$(LINK) \$(S0MAIN)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk # 'install'的ins_srvm.mk问题,修改env_srvm.mk的GETCRSHOME_LINKLINE变量(1899行),添加 -Wl,--no-as-needed sudo sed -i "s/GETCRSHOME_LINKLINE=\$(LINK)/& -Wl,--no-as-needed/g" $ORACLE_HOME/srvm/lib/env_srvm.mk # 'install'的ins_net_server.mk问题,修改env_network.mk的TNSLSNR_LINKLINE变量(2232行),添加 -Wl,--no-as-needed sudo sed -i "s/TNSLSNR_LINKLINE=\$(LINK)/& -Wl,--no-as-needed/g" $ORACLE_HOME/network/lib/env_network.mk # 'irman ioracle'的ins_rdbms.mk问题,修改env_rdbms.mk的ORACLE_LINKLINE变量(2759行),添加 -Wl,--no-as-needed sudo sed -i "s/ORACLE_LINKLINE=\$(ORACLE_LINKER) \$(PL_FLAGS)/& -Wl,--no-as-needed/g" $ORACLE_HOME/rdbms/lib/env_rdbms.mk |
卸载
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | rm -rf /etc/ora* rm -rf /var/tmp/.oracle rm -rf /tmp/* rm -rf /u01/app/grid/* rm -rf /u01/app/oracle/* rm -rf /u01/app/oraInventory/* rm -rf /u01/app/* userdel oracle userdel grid groupdel oinstall groupdel dba groupdel oper groupdel asmadmin groupdel asmoper groupdel asmdba |
总结
1、我自己尝试了Ubuntu 14.04,Ubuntu 16.04,Ubuntu 18.04,Ubuntu 20.04,Ubuntu 22.04,这几个版本安装Oracle 11.2.0.4,都能安装成功,基本步骤一样,在Ubuntu 14.04,Ubuntu 16.04安装过程一样;在Ubuntu 18.04,Ubuntu 20.04,Ubuntu 22.04安装过程一样,不过需要把gcc进行降级处理,其它过程都一样;。
2、Ubuntu 14.04的gcc -v、g++ -v和cpp -v
都是4.8.4版本,而Ubuntu 16.04都是5.4.0版本,而Ubuntu 20.04都是7.5.0版本,而Ubuntu 20.04都是9.4.0版本,而Ubuntu 22.04都是11.3.0版本,只有4.8.4和5.4.0可以成功,这个很重要:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | root@ub14oracle11g:/# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) root@ub14oracle11g:/# g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) root@ub14oracle11g:/# cpp -v Using built-in specs. COLLECT_GCC=cpp Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-linux-gnu/4.8/cc1 -E -quiet -v -imultiarch x86_64-linux-gnu - -mtune=generic -march=x86-64 -fstack-protector -Wformat -Wformat-security ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-linux-gnu/4.8/include /usr/local/include /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. |