linux系统安装oracle
安装 oracle 21c (21.3)
- 快速安装 oracle 21c(下载地址),适用于:CentOS 7,不支持 Ubuntu
cd /opt/
wget -c http://iso.sqlfans.cn/oracle/LINUX.X64_213000_db_home.zip
wget -c http://iso.sqlfans.cn/oracle/install_oracle_21c.sh
bash install_oracle_21c.sh /opt /data 1522
echo 'select instance_name,status from v$instance;' | su - oracle -c "sqlplus / as sysdba"
ps -ef | grep oracle | grep -v grep | awk '{print $2}' | xargs kill -9
userdel -r oracle 2> /dev/null
rm -f /opt/install_oracle*.sh
rm -rf /data/oracle*
rm -rf /opt/oracle
rm -rf /opt/ORCLfmap
sed -i '/oracle/d' /etc/rc.local
安装 oracle 11g (11.2.0.4)
- 快速安装 oracle 11g(参考地址),适用于:CentOS 7,不支持 Ubuntu
cd /opt/
wget -c http://iso.sqlfans.cn/oracle/p13390677_112040_Linux-x86-64_1of7.zip
wget -c http://iso.sqlfans.cn/oracle/p13390677_112040_Linux-x86-64_2of7.zip
wget -c http://iso.sqlfans.cn/oracle/install_oracle_11g.sh
bash install_oracle_11g.sh /opt /data 1522
echo 'select instance_name,status from v$instance;' | su - oracle -c "sqlplus / as sysdba"
ps -ef | grep oracle | grep -v grep | awk '{print $2}' | xargs kill -9
userdel -r oracle 2> /dev/null
rm -f /opt/install_oracle*.sh
rm -rf /data/oracle*
rm -rf /opt/oracle
rm -rf /opt/ORCLfmap
sed -i '/oracle/d' /etc/rc.local
遇到的问题
- 问题1:同一台机器重复安装oracle会提示dbca执行失败,检查dbca.rsp与安装日志,提示SID已存在
[root@localhost opt]
The Oracle system identifier(SID) "orcl" already exists. Specify another SID.
- 问题2:从 oracle 18c 开始,需要将安装包解压到 $ORACLE_HOME 目录下,否则静默安装的时候会抛出下面的错误
./runInstaller -force -silent -noconfig -responseFile ./install/response/db_install.rsp -ignorePrereqFailure
[FATAL] [INS-35954] The installer has detected that the Oracle home location provided in the response file is not correct.
CAUSE: The Database Oracle home is the location from where the installer is executed.
It has been detected that the value set in the response file is different (/data/oracle_1522/product). Value expected is: /opt/oracle
ACTION: It is not required to specify ORACLE_HOME in the response file for Database installation.
Alternatively, set it to the location of the installer (/opt/oracle).
- 问题3:从 oracle 18c 开始,应答文件路径发生变化:
${base_dir}/oracle/response/db_install.rsp
${base_dir}/oracle/response/netca.rsp
${base_dir}/oracle/response/dbca.rsp
${data_dir}/oracle_1522/product/11.2.0/dbhome_1/network/admin/listener.ora
${data_dir}/oracle_1522/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
$ORACLE_HOME/install/response/db_install.rsp
$ORACLE_HOME/assistants/netca/netca.rsp
$ORACLE_HOME/assistants/dbca/dbca.rsp
${data_dir}/oracle_1522/homes/OraDB21Home1/network/admin/listener.ora
${data_dir}/oracle_1522/homes/OraDB21Home1/network/admin/tnsnames.ora