虚拟机系统版本:centos7
虚拟机ip:192.168.5.144
oracle版本:19c
oracle下载地址:
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c
yum -y install compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc-devel ksh libaio-devel libaio-devel sysstat elfutils-libelf-devel fontconfig-devel libxcb smartmontools libX11 libXau libXtst libXrender libXrender-devel
groupadd oinstall
groupadd dba
groupadd asmdba
groupadd backupdba
groupadd dgdba
groupadd kmdba
groupadd racdba
groupadd oper
useradd -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper -m oracle
hostname oracledb
vim /etc/hosts
192.168.5.144 oracledb
vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 16451328
kernel.shmmax = 33692319744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
sysctl -p
vim /etc/selinux/config
SELINUX=disabled
systemctl stop firewalld.service
systemctl disable firewalld.service
重启虚拟机
reboot
mkdir -p /home/oracle/app/oracle/product/19.5.0
unzip LINUX.X64_193000_db_home.zip -d /home/oracle/app/oracle/product/19.5.0/
cd /home/oracle
chown -R oracle:oinstall app
chmod -R 755 app
vim /etc/security/limits.conf
@oinstall soft nofile 2048
@oinstall hard nofile 65536
@oinstall soft nproc 16384
@oinstall soft stack 10240
su oracle
vim .bash_profile
添加以下内容
export ORACLE_BASE=/home/oracle/app/oracle
export ORACLE_HOME=/home/oracle/app/oracle/product/19.5.0
export PATH=$PATH:$ORACLE_HOME/bin:/usr/local/bin
export ORACLE_HOSTNAME=oracledb
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
source .bash_profile
cd $ORACLE_HOME/install/response
cp db_install.rsp db_install.rsp.bak
vim db_install.rsp
// 主要修改以下参数
oracle.install.option=INSTALL_DB_SWONLY // 29行
UNIX_GROUP_NAME=oinstall // 34行
INVENTORY_LOCATION=/home/oracle/app/oraInventory // 41行
ORACLE_HOME=/home/oracle/app/oracle/product/19.5.0 // 45行
ORACLE_BASE=/home/oracle/app/oracle // 50行
oracle.install.db.InstallEdition=EE // 62行
oracle.install.db.OSDBA_GROUP=dba // 79行
oracle.install.db.OSOPER_GROUP=oper // 85行
oracle.install.db.OSBACKUPDBA_GROUP=backupdba // 90行
oracle.install.db.OSDGDBA_GROUP=dgdba // 95行
oracle.install.db.OSKMDBA_GROUP=kmdba // 100行
oracle.install.db.OSRACDBA_GROUP=racdba // 105行
oracle.install.db.rootconfig.executeRootScript=false // 120行
cd $ORACLE_HOME
./runInstaller -silent -responseFile /home/oracle/app/oracle/product/19.5.0/install/response/db_install.rsp
sh /home/oracle/app/oraInventory/orainstRoot.sh
sh /home/oracle/app/oracle/product/19.5.0/root.sh
su oracle
cd /home/oracle/app/oracle/product/19.5.0/assistants/netca
cp netca.rsp netca.rsp.bak
cd /home/oracle/app/oracle/product/19.5.0/bin
./netca /silent /responseFile /home/oracle/app/oracle/product/19.5.0/assistants/netca/netca.rsp
cd $ORACLE_HOME/assistants/dbca
cp dbca.rsp dbca.rsp.bak
vim dbca.rsp
修改以下内容
gdbName=orcl //32行
sid=orcl //42行
databaseConfigType=SI //52行
templateName=General_Purpose.dbc //223行
sysPassword=xiaoxiong //233行
systemPassword=xiaoxiong //243行
emConfiguration=NONE //262行
dbsnmpPassword=xiaoxiong //295行
datafileDestination=/home/oracle/app/oracle/oradata //411行
recoveryAreaDestination=/home/oracle/flash_recovery_area //421行
storageType=FS //431行
characterSet=ZHS16GBK //468行
nationalCharacterSet=AL16UTF16 //478行
sampleSchema=true //565行
totalMemory=2048 //604行
dbca -silent -createDatabase -responseFile /home/oracle/app/oracle/product/19.5.0/assistants/dbca/dbca.rsp
lsnrctl status #查看监听状态
lsnrctl restart # 重启监听
lsnrctl stop # 停止监听
lsnrctl start # 启动监听
sqlplus 登录数据库