vi /etc/hosts
systemctl stop firewalld.service
systemctl disable firewalld.service
vi /etc/selinux/config
SELINUX=disabled
yum install -y bc ,binutils,compat-libcap1,compat-libstdc++-33,dtrace-utils,elfutils-libelf,elfutils-libelf-devel,fontconfig-devel,glibc,glibc-devel,ksh,libaio,libaio-devel,libdtrace-ctf-devel,libXrender,libXrender-devel,libX11,libXau,libXi,libXtst,libgcc,librdmacm-devel,libstdc++,libstdc++-devel,libxcb,make,net-tools,nfs-utils,python,python-configshell,python-rtslib,python-six,targetcli,smartmontools,sysstat,unixODBC
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
passwd oracle
mkdir -p /data/app/oracle/product/19.3/db_1
chown -R oracle:oinstall /data/app/
chmod -R 775 /data/app/
mkdir -p /home/oracle/etc
chown -R oracle:oinstall /home/oracle/etc
chmod -R 775 /home/oracle/etc
vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
**使配置生效**
/sbin/sysctl -p
vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
vi /home/oracle/.bash_profile
export ORACLE_SID=lcfa110 #数据库实例
export ORACLE_BASE=/data/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3/db_1 #家目录
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:/lib/usr/lib:/usr/local/lib
export TEMP=/tmp
export TMP=/tmp
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
**使其配置生效**
source /home/oracle/.bash_profile
cd /data/app/oracle/product/19.3/db_1
unzip LINUX.X64_193000_db_home.zip
cp /data/app/oracle/product/19.3/db_1/install/response/db_install.rsp /home/oracle/etc/
cp /data/app/oracle/product/19.3/db_1/assistants/netca/netca.rsp /home/oracle/etc/
cp /data/app/oracle/product/19.3/db_1/assistants/dbca/dbca.rsp /home/oracle/etc/
oracle.install.option=INSTALL_DB_SWONLY #安装类型
UNIX_GROUP_NAME=oinstall #安装组
INVENTORY_LOCATION=/data/app/oraInventory #INVENTORY目录
ORACLE_BASE=/data/app/oracle
oracle.install.db.InstallEdition=EE #ORCALE版本
oracle.install.db.OSDBA_GROUP=dba #dba用户组
oracle.install.db.OSOPER_GROUP=dba #dba用户组
oracle.install.db.OSBACKUPDBA_GROUP=dba #dba用户组
oracle.install.db.OSDGDBA_GROUP=dba #dba用户组
oracle.install.db.OSKMDBA_GROUP=dba #dba用户组
oracle.install.db.OSRACDBA_GROUP=dba #dba用户组
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE #数据库类型
oracle.install.db.config.starterdb.SID=lcfa110 #数据库实例
切到oracle用户
su - oracle
cd /data/app/oracle/product/19.3/db_1
echo $ORACLE_HOME #确定变量生效
./runInstaller -silent -responseFile /home/oracle/etc/db_install.rsp -ignorePrereq
执行安装成功会出现需要root执行的两个脚本;
新开一个root窗口执行即可
vi /home/oracle/etc/dbca.rsp
GDBNAME = lcfa110
SID = lcfa110
templateName=General_Purpose.dbc
建库
dbca -silent -createDatabase -responseFile /home/oracle/etc/dbca.rsp
执行dbca命令需要为sys、system用户创建密码,以下WARNING为密码长度小于8为的告警信息
以上命令执行过程中需要再另一个root窗口不断查看oracle进程是否还存活
ps -ef | grep ora_ | grep -v grep
**切换目录**
cd /data/app/oracle/product/19.3/db_1/bin
**使用命令配置监听过程**
netca /silent /responsefile /data/app/oracle/product/19.3/db_1/assistants/netca/netca.rsp
配置完成后
**查看监听端口** netstat -tnpl | grep 1521
**启动** lsnrctl start
**查看状态**lsnrctl status
**登录数据库**
sqlplus / as sysdba ;
**创建使用用户及授权**
create user vmtest identified by redhat;
grant connect, resource,dba to vmtest;
登录创建的数据库
sqlplus vmtest/redhat@lcfa110