1,下载oracle11g11.2.0.4.0安装包,解压
2,配置安装环境
1,下载配置环境文件
-------------------------------------------------------------------------------------------------------------------------------------
cd /etc/yum.repos.d wget http://public-yum.oracle.com/public-yum-ol7.repo wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle yum install oracle-rdbms-server-11gR2-preinstall -y ##安装Oracle环境配置程序,安装后环境自动配置
2,配置用户环境变量
------------------------------------------------------------------------------------------------------------------------------------- cat >> /home/oracle/.bash_profile << EOF #添加oracle用户的环境变量 export ORACLE_BASE=/opt/oracle export ORACLE_HOME=/opt/oracle/product/11.2.0/db_1 export ORACLE_SID=orcl export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib export TNS_ADMIN=$ORACLE_HOME/network/admin EOF
3,修改配置文件
-------------------------------------------------------------------------------------------------------------------------------------
修改解压后database目录下的 dbca.rsp db_install.rsp 这两个文件
[root@yktmbsvcpt opt]# cd database/
[root@yktmbsvcpt database]# ls
install readme.html response rpm runInstaller sshsetup stage welcome.html
[root@yktmbsvcpt database]# cd response/
[root@yktmbsvcpt response]# ls
dbca.rsp db_install.rsp netca.rsp
#################################################
db_install.rsp 文件需要修改的地方
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=主机名
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/opt/oracle/product/11.2.0/db_1
ORACLE_BASE=/opt/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=true
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=ZHS16GBK
oracle.install.db.config.starterdb.password.ALL=everhigh
DECLINE_SECURITY_UPDATES=true
#################################################
dbca.rsp 文件需要修改的地方
GDBNAME = "orcl"
SID = "orcl"
CHARACTERSET = "ZHS16GBK"
NATIONALCHARACTERSET= "UTF8"
#################################################
4,创建目录赋予权限
-------------------------------------------------------------------------------------------------------------------------------------
mkdir /opt/oracle
chown oracle:oinstall -R /opt/oracle
chown oracle:oinstall -R database ##oracle解压后的目录
chmod 755 -R /opt/oracle
chmod 755 -R database
5,执行脚本,安装数据库程序
-------------------------------------------------------------------------------------------------------------------------------------
su - oracle #切换用户
cd database
./runInstaller -silent -force -ignorePrereq -responseFile /opt/database/response/db_install.rsp
##执行后出现
Oracle Database 11g 的 安装 已成功。
请查看 '/opt/oracle/oraInventory/logs/silentInstall2023-05-05_10-46-59AM.log' 以获取详细资料。
以 root 用户的身份执行以下脚本:
1. /opt/oracle/oraInventory/orainstRoot.sh
2. /opt/oracle/product/11.2.0/db_1/root.sh
Successfully Setup Software.
###以上文字,表示安装成功,然后切换root用户执行脚本
###以 root 用户的身份执行以下脚本:
su - root
sh /opt/oracle/oraInventory/orainstRoot.sh
sh /opt/oracle/product/11.2.0/db_1/root.sh
6,执行脚本,安装监听程序
-------------------------------------------------------------------------------------------------------------------------------------
su - oracle
netca /silent /responseFile /opt/database/response/netca.rsp
7,执行脚本,安装数据库
-------------------------------------------------------------------------------------------------------------------------------------
dbca -silent -responseFile /opt/database/response/dbca.rsp ##执行后需要输入密码,输入配置文件密码即可
到此完成安装,开放防火墙,远程数据库即可。。。。