Centos7静默安装Oracle11g
1、创建用户和组
groupadd oinstall groupadd dba
useradd -g oinstall -g dba -m oracle passwd oracle
2、创建Oracle数据库的安装目录(for静默安装)
mkdir -p /opt/oracle mkdir -p /opt/oraInventory mkdir -p /opt/database
mkdir -p /opt/oracle/product/11.2.0 mkdir -p /opt/oracle/oradata
mkdir -p /opt/oracle/flash_recovery_area
chown -R oracle:oinstall /opt/oracle chown -R oracle:oinstall /opt/oracle/oradata chown -R oracle:oinstall /opt/oraInventory chown -R oracle:oinstall /opt/database chmod -R 775 /opt/oracle
3、配置oracle环境
su - oracle
vim .bash_profile 添加如下内容: # 注意:
# 1. ORACLE_SID 必须与创建的数据库实例名称一致,否则数据库启动后无法访问
# 2. ORACLE_HOME 根据实际情况填写,安装完毕以后,再检查一下,如果有误,需要调整,
确保正确
ORACLE_BASE=/opt/oracle
#ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 ORACLE_HOME=$ORACLE_BASE/product/11.2.0 ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
执行生效:
source .bash_profile 检查是否生效
echo $ORACLE_HOME
4、解压安装包
cd /opt
unzip linux.x64_11gR2_database_1of2.zip -d /opt/database unzip linux.x64_11gR2_database_2of2.zip -d /opt/database
5、用root账号创建/etc/oraInst.loc文件,
否则安装时会报错:
SEVERE: [FATAL] [INS-32038] The operating system group specified for central inventory (oraInventory) ownership is invalid.
vim /etc/oraInst.loc
inventory_loc=/opt/oraInventory inst_group=oinstall
6、安装未安装的package验证命令26个包,如果没有安装,需要先安装
Su - root
rpm -qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel
elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel
yum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel
elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel
####redhat7.5 执行的安装命令;
yum install -y compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-devel yum install -y ksh libaio-devel numactl-devel
yum install -y unixODBC unixODBC-devel oracleasm oracleasmlib oracleasm-support
注意,安装完以后,可以再重新执行一次 yum install 确认一下,是否有未安装的包。 如果出现 pdksh-5.2.14 没有安装,需要单独额外安装: 下面提供多个下载地址,如果不能下,就挨个尝试:
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm wget
ftp://ftp.icm.edu.pl/vol/rzm6/linux-scientificlinux/obsolete/58/x86_64/updates/fastbugs/pdksh-5.2.14-37.el5_8.1.x86_64.rpm wget
ftp://ftp.gwdg.de/linux/scientificlinux/scientific/58/x86_64/updates/fastbugs/pdksh-5.2.14-37.el5_8.1.x86_64.rpm wget
ftp://ftp.icm.edu.pl/vol/rzm6/linux-scientificlinux/obsolete/59/x86_64/SL/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
安装pdksh:
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
6.5Redhet无法使用yum 的操作:
参考yum配置文档
7、编辑静默安装响应文件
su oracle
cp -R /opt/database/database/response/ /home/oracle/
[oracle@localhost ~]$ ls -l /home/oracle/response/ total 76
-rw-r--r-- 1 oracle dba 44969 May 18 16:16 dbca.rsp