目录
linux静默安装oracle19c
1、环境准备
1.1、安装包准备
下载名称为的安装包
LINUX.X64_193000_db_home.zip
1.2、关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
1.3、关闭selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
1.4、设置主机名
设定主机名
hostnamectl set-hostname dbserver42.localdomain
编辑/etc/hosts
192.168.0.42 dbserver42.localdomain dbserver42
确定/etc/hostname
设置正确
cat /etc/hostname
1.5、安装依赖
root用户执行
yum install -y https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
检查 RPM 日志文件以查看系统配置更改。
/var/log/oracle-database-preinstall-19c/backup/timestamp/orakernel.log
2、设置oracle用户环境
2.1、root创建oracle用户以及用户组
groupadd -g 54321 oinstall
useradd -u 54321 -g oinstall oracle
passwd oracle
2.2、创建Oracle的安装目录
root用户执行
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
mkdir -p /u01/app/oracle/oradata
chown -R oracle:oinstall /u01
chmod -R 775 /u01
2.3、设定oracle用户环境变量
用oracle用户编辑 ~/.bash_profile
文件
vi ~/.bash_profile
~/.bash_profile
:更改ORACLE_HOSTNAME、ORACLE_UNQNAME、ORACLE_SID、DATA_DIR
的参数
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=dbserver42.localdomain
export ORACLE_UNQNAME=ifrsdev
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=ifrsdev #实例名
export DATA_DIR=/u01/app/oracle/oradata
export PATH=/usr/sbin:/usr/local/bin:$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 LANG="en_US.UTF-8"
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
export NLS_DATA_FORMAT="YYYY-MM-DD HH24:MI:SS"
使环境变量生效(最好重启机器,确保所有配置生效)
source ~/.bash_profile
3、安装数据库
3.1、解压到ORACLE_HOME
cd $ORACLE_HOME
unzip /usr/local/src/LINUX.X64_193000_db_home.zip
3.2 、静默安装数据库软件
在oracle用户执行(使用图形安装需要直接用oracle用户登录,用su到oracle用户出现问题)(一行的)
参数-showProgress
不支持
./runInstaller -waitforcompletion -silent -showProgress \
-responseFile ${ORACLE_HOME}/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
ORACLE_HOSTNAME=${ORACLE_HOSTNAME} \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=${ORA_INVENTORY} \
SELECTED_LANGUAGES=en,zh_CN,zh_TW \
ORACLE_HOME=${ORACLE_HOME} \
ORACLE_BASE=${ORACLE_BASE} \
oracle.install.db.InstallEdition=SE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSBACKUPDBA_GROUP=dba \
oracle.install.db.OSDGDBA_GROUP=dba \
oracle.install.db.OSKMDBA_GROUP=dba \
oracle.install.db.OSRACDBA_GROUP=dba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true
执行:
./runInstaller -waitforcompletion -silent -responseFile ${ORACLE_HOME}/install/response/db_install.rsp oracle.install.option=INSTALL_DB_SWONLY ORACLE_HOSTNAME=${ORACLE_HOSTNAME} UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=${ORA_INVENTORY} SELECTED_LANGUAGES=en,zh_CN,zh_TW ORACLE_HOME=${ORACLE_HOME} ORACLE_BASE=${ORACLE_BASE} oracle.install.db.InstallEdition=SE oracle.install.db.OSDBA_GROUP=oinstall oracle.install.db.OSBACKUPDBA_GROUP=oinstall oracle.install.db.OSDGDBA_GROUP=oinstall oracle.install.db.OSKMDBA_GROUP=oinstall oracle.install.db.OSRACDBA_GROUP=oinstall SECURITY_UPDATES_VIA_MYORACLESUPPORT=false DECLINE_SECURITY_UPDATES=true
这里选择了SE标准版,EE企业版收费更高。
3.3、安装完成后用root用户执行
/u01/app/oracle/product/19.0.0/dbhome_1/root.sh
4、安装实例
4.1、查看监听状态
lsnrctl status
4.2、静默安装实例
oracle用户执行(一行的)
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword SysPassword1 \
-systemPassword SysPassword1 \
-createAsContainerDatabase false \
-databaseType MULTIPURPOSE \
-memoryMgmtType auto_sga \
-totalMemory 2000 \
-storageType FS \
-datafileDestination "${DATA_DIR}" \
-redoLogFileSize 50 \
-emConfiguration NONE \
执行:
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -responseFile NO_VALUE -characterSet AL32UTF8 -sysPassword SysPassword1 -systemPassword SysPassword1 -createAsContainerDatabase false -databaseType MULTIPURPOSE -memoryMgmtType auto_sga -totalMemory 2000 -storageType FS -datafileDestination "${DATA_DIR}" -redoLogFileSize 50 -emConfiguration NONE
完成安装显示:
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
60% complete
Completing Database Creation
66% complete
69% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/ifrsdev.
Database Information:
Global Database Name:ifrsdev
System Identifier(SID):ifrsdev
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ifrsdev/ifrsdev.log" for further details.
4.3 将动态参数写入到静态参数文件中
参数将会写在 $ORACLE_HOME/dbs
目录下
sqlplus / as sysdba
SQL> create pfile from spfile;
SQL> exit;
4.4、启动监听
lsnrctl status
lsnrctl start
标签:oracle19c,db,静默,export,ORACLE,install,linux,oracle,HOME
From: https://www.cnblogs.com/lgxdev/p/16962262.html